Modified: trunk/Source/_javascript_Core/ChangeLog (141184 => 141185)
--- trunk/Source/_javascript_Core/ChangeLog 2013-01-30 00:57:56 UTC (rev 141184)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-01-30 00:59:21 UTC (rev 141185)
@@ -1,3 +1,20 @@
+2013-01-29 Filip Pizlo <[email protected]>
+
+ cloop.rb shouldn't use a method called 'dump' for code generation
+ https://bugs.webkit.org/show_bug.cgi?id=108251
+
+ Reviewed by Mark Hahnenberg.
+
+ Revert http://trac.webkit.org/changeset/141178 and rename 'dump' to 'clDump'.
+
+ Also made trivial build fixes for !ENABLE(JIT).
+
+ * offlineasm/cloop.rb:
+ * runtime/Executable.h:
+ (ExecutableBase):
+ (JSC::ExecutableBase::intrinsicFor):
+ * runtime/JSGlobalData.h:
+
2013-01-29 Geoffrey Garen <[email protected]>
Removed GGC because it has been disabled for a long time
Modified: trunk/Source/_javascript_Core/offlineasm/cloop.rb (141184 => 141185)
--- trunk/Source/_javascript_Core/offlineasm/cloop.rb 2013-01-30 00:57:56 UTC (rev 141184)
+++ trunk/Source/_javascript_Core/offlineasm/cloop.rb 2013-01-30 00:59:21 UTC (rev 141185)
@@ -55,7 +55,7 @@
class SpecialRegister < NoChildren
- def dump
+ def clDump
@name
end
def clValue(type=:int)
@@ -66,18 +66,67 @@
C_LOOP_SCRATCH_FPR = SpecialRegister.new("d8")
class RegisterID
+ def clDump
+ case name
+ when "t0"
+ "t0"
+ when "t1"
+ "t1"
+ when "t2"
+ "t2"
+ when "t3"
+ "t3"
+ when "t4"
+ "rPC"
+ when "t6"
+ "rBasePC"
+ when "csr1"
+ "tagTypeNumber"
+ when "csr2"
+ "tagMask"
+ when "cfr"
+ "cfr"
+ when "lr"
+ "rRetVPC"
+ when "sp"
+ "sp"
+ else
+ raise "Bad register #{name} for C_LOOP at #{codeOriginString}"
+ end
+ end
def clValue(type=:int)
- dump + cloopMapType(type)
+ clDump + cloopMapType(type)
end
end
class FPRegisterID
+ def clDump
+ case name
+ when "ft0", "fr"
+ "d0"
+ when "ft1"
+ "d1"
+ when "ft2"
+ "d2"
+ when "ft3"
+ "d3"
+ when "ft4"
+ "d4"
+ when "ft5"
+ "d5"
+ else
+ raise "Bad register #{name} for C_LOOP at #{codeOriginString}"
+ end
+ end
def clValue(type=:int)
- dump + cloopMapType(type)
+ clDump + cloopMapType(type)
end
end
class Immediate
+ def clDump
+ "#{value}"
+ end
def clValue(type=:int)
# There is a case of a very large unsigned number (0x8000000000000000)
# which we wish to encode. Unfortunately, the C/C++ compiler
@@ -107,6 +156,9 @@
end
class Address
+ def clDump
+ "[#{base.clDump}, #{offset.value}]"
+ end
def clValue(type=:int)
case type
when :int8; int8MemRef
@@ -177,6 +229,9 @@
end
class BaseIndex
+ def clDump
+ "[#{base.clDump}, #{offset.clDump}, #{index.clDump} << #{scaleShift}]"
+ end
def clValue(type=:int)
case type
when :int8; int8MemRef
@@ -239,8 +294,11 @@
end
class AbsoluteAddress
+ def clDump
+ "#{codeOriginString}"
+ end
def clValue
- dump
+ clDump
end
end
@@ -290,7 +348,7 @@
end
def clOperands(operands)
- operands.map{|v| v.dump}.join(", ")
+ operands.map{|v| v.clDump}.join(", ")
end
@@ -300,14 +358,14 @@
if operands.size == 3
$asm.putc "#{operands[2].clValue(type)} = #{operands[1].clValue(type)} #{operator} #{operands[0].clValue(type)};"
if operands[2].is_a? RegisterID and (type == :int32 or type == :uint32)
- $asm.putc "#{operands[2].dump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
+ $asm.putc "#{operands[2].clDump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
end
else
raise unless operands.size == 2
raise unless not operands[1].is_a? Immediate
$asm.putc "#{operands[1].clValue(type)} = #{operands[1].clValue(type)} #{operator} #{operands[0].clValue(type)};"
if operands[1].is_a? RegisterID and (type == :int32 or type == :uint32)
- $asm.putc "#{operands[1].dump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
+ $asm.putc "#{operands[1].clDump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
end
end
end
@@ -317,14 +375,14 @@
if operands.size == 3
$asm.putc "#{operands[2].clValue(type)} = #{operands[1].clValue(type)} #{operator} (#{operands[0].clValue(:int)} & 0x1f);"
if operands[2].is_a? RegisterID and (type == :int32 or type == :uint32)
- $asm.putc "#{operands[2].dump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
+ $asm.putc "#{operands[2].clDump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
end
else
raise unless operands.size == 2
raise unless not operands[1].is_a? Immediate
$asm.putc "#{operands[1].clValue(type)} = #{operands[1].clValue(type)} #{operator} (#{operands[0].clValue(:int)} & 0x1f);"
if operands[1].is_a? RegisterID and (type == :int32 or type == :uint32)
- $asm.putc "#{operands[1].dump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
+ $asm.putc "#{operands[1].clDump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
end
end
end
@@ -335,7 +393,7 @@
raise unless not operands[0].is_a? Immediate
$asm.putc "#{operands[0].clValue(type)} = #{operator}#{operands[0].clValue(type)};"
if operands[0].is_a? RegisterID and (type == :int32 or type == :uint32)
- $asm.putc "#{operands[0].dump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
+ $asm.putc "#{operands[0].clDump}.clearHighWord();" # Just clear it. It does nothing on the 32-bit port.
end
end
@@ -645,7 +703,7 @@
when "td2i"
$asm.putc "#{operands[1].clValue(:int)} = #{operands[0].clValue(:double)};"
- $asm.putc "#{operands[1].dump}.clearHighWord();"
+ $asm.putc "#{operands[1].clDump}.clearHighWord();"
when "bcd2i" # operands: srcDbl dstInt slowPath
$asm.putc "{"
@@ -654,7 +712,7 @@
$asm.putc " if (asInt32 != d || (!asInt32 && signbit(d))) // true for -0.0"
$asm.putc " goto #{operands[2].cLabel};"
$asm.putc " #{operands[1].clValue} = asInt32;"
- $asm.putc " #{operands[1].dump}.clearHighWord();"
+ $asm.putc " #{operands[1].clDump}.clearHighWord();"
$asm.putc "}"
when "move"
Modified: trunk/Source/_javascript_Core/runtime/Executable.h (141184 => 141185)
--- trunk/Source/_javascript_Core/runtime/Executable.h 2013-01-30 00:57:56 UTC (rev 141184)
+++ trunk/Source/_javascript_Core/runtime/Executable.h 2013-01-30 00:59:21 UTC (rev 141185)
@@ -176,16 +176,6 @@
return hasJITCodeForConstruct();
}
- // Intrinsics are only for calls, currently.
- Intrinsic intrinsic() const;
-
- Intrinsic intrinsicFor(CodeSpecializationKind kind) const
- {
- if (isCall(kind))
- return intrinsic();
- return NoIntrinsic;
- }
-
static ptrdiff_t offsetOfJITCodeFor(CodeSpecializationKind kind)
{
if (kind == CodeForCall)
@@ -211,6 +201,16 @@
}
#endif // ENABLE(JIT)
+ // Intrinsics are only for calls, currently.
+ Intrinsic intrinsic() const;
+
+ Intrinsic intrinsicFor(CodeSpecializationKind kind) const
+ {
+ if (isCall(kind))
+ return intrinsic();
+ return NoIntrinsic;
+ }
+
#if ENABLE(JIT) || ENABLE(LLINT_C_LOOP)
MacroAssemblerCodePtr hostCodeEntryFor(CodeSpecializationKind kind)
{
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.h (141184 => 141185)
--- trunk/Source/_javascript_Core/runtime/JSGlobalData.h 2013-01-30 00:57:56 UTC (rev 141184)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.h 2013-01-30 00:59:21 UTC (rev 141185)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,6 +39,7 @@
#include "JSCJSValue.h"
#include "JSLock.h"
#include "LLIntData.h"
+#include "MacroAssemblerCodeRef.h"
#include "NumericStrings.h"
#include "ProfilerDatabase.h"
#include "PrivateName.h"