From dd91e772430dc294e3bf478c119ef8d43c0a3358 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 12 Mar 2012 14:11:15 +0100 Subject: Imported WebKit commit 3db4eb1820ac8fb03065d7ea73a4d9db1e8fea1a (http://svn.webkit.org/repository/webkit/trunk@110422) This includes build fixes for the latest qtbase/qtdeclarative as well as the final QML2 API. --- Source/JavaScriptCore/offlineasm/ast.rb | 187 +++++++++++++++++++++++++++++++- 1 file changed, 186 insertions(+), 1 deletion(-) (limited to 'Source/JavaScriptCore/offlineasm/ast.rb') diff --git a/Source/JavaScriptCore/offlineasm/ast.rb b/Source/JavaScriptCore/offlineasm/ast.rb index f67b0fc60..e555b5d98 100644 --- a/Source/JavaScriptCore/offlineasm/ast.rb +++ b/Source/JavaScriptCore/offlineasm/ast.rb @@ -57,7 +57,7 @@ class Node end def codeOriginString - "line number #{@codeOrigin}" + @codeOrigin.to_s end def descendants @@ -383,6 +383,157 @@ class NegImmediate < Node end end +class OrImmediates < Node + attr_reader :left, :right + + def initialize(codeOrigin, left, right) + super(codeOrigin) + @left = left + @right = right + end + + def children + [@left, @right] + end + + def mapChildren + OrImmediates.new(codeOrigin, (yield @left), (yield @right)) + end + + def dump + "(#{left.dump} | #{right.dump})" + end + + def address? + false + end + + def label? + false + end + + def immediate? + true + end + + def register? + false + end +end + +class AndImmediates < Node + attr_reader :left, :right + + def initialize(codeOrigin, left, right) + super(codeOrigin) + @left = left + @right = right + end + + def children + [@left, @right] + end + + def mapChildren + AndImmediates.new(codeOrigin, (yield @left), (yield @right)) + end + + def dump + "(#{left.dump} & #{right.dump})" + end + + def address? + false + end + + def label? + false + end + + def immediate? + true + end + + def register? + false + end +end + +class XorImmediates < Node + attr_reader :left, :right + + def initialize(codeOrigin, left, right) + super(codeOrigin) + @left = left + @right = right + end + + def children + [@left, @right] + end + + def mapChildren + XorImmediates.new(codeOrigin, (yield @left), (yield @right)) + end + + def dump + "(#{left.dump} ^ #{right.dump})" + end + + def address? + false + end + + def label? + false + end + + def immediate? + true + end + + def register? + false + end +end + +class BitnotImmediate < Node + attr_reader :child + + def initialize(codeOrigin, child) + super(codeOrigin) + @child = child + end + + def children + [@child] + end + + def mapChildren + BitnotImmediate.new(codeOrigin, (yield @child)) + end + + def dump + "(~#{@child.dump})" + end + + def address? + false + end + + def label? + false + end + + def immediate? + true + end + + def register? + false + end +end + class RegisterID < NoChildren attr_reader :name @@ -459,6 +610,28 @@ class FPRegisterID < NoChildren end end +class SpecialRegister < NoChildren + def initialize(name) + @name = name + end + + def address? + false + end + + def label? + false + end + + def immediate? + false + end + + def register? + true + end +end + class Variable < NoChildren attr_reader :name @@ -479,6 +652,10 @@ class Variable < NoChildren def dump name end + + def inspect + "" + end end class Address < Node @@ -757,6 +934,10 @@ class LabelReference < Node def label? true end + + def immediate? + false + end end class LocalLabelReference < NoChildren @@ -790,6 +971,10 @@ class LocalLabelReference < NoChildren def label? true end + + def immediate? + false + end end class Sequence < Node -- cgit v1.2.1