The JITThunks class should be in its own file, and doing so should not break the build
https://bugs.webkit.org/show_bug.cgi?id=105696
Source/JavaScriptCore:
Rubber stamped by Sam Weinig and Geoffrey Garen.
This patch was supposed to just move JITThunks into its own file. But then I
realized that there is a horrible circular dependency chain between JSCell,
JSGlobalData, CallFrame, and Weak, which only works because of magical include
order in JITStubs.h, and the fact that JSGlobalData.h includes JITStubs.h
before it includes JSCell or JSValue.
I first tried to just get JITThunks.h to just magically do the same pointless
includes that JITStubs.h had, but then I decided to actually fix the underflying
problem, which was that JSCell needed CallFrame, CallFrame needed JSGlobalData,
JSGlobalData needed JITThunks, JITThunks needed Weak, and Weak needed JSCell.
Now, all of JSCell's outgoing dependencies are placed in JSCellInlines.h. This
also gave me an opportunity to move JSValue inline methods from JSCell.h into
JSValueInlines.h. But to make this really work, I needed to remove includes of
*Inlines.h from other headers (CodeBlock.h for example included JSValueInlines.h,
which defeats the whole entire purpose of having an Inlines.h file), and I needed
to add includes of *Inlines.h into a bunch of .cpp files. I did this mostly by
having .cpp files include Operations.h. In future, if you're adding a .cpp file
to JSC, you'll almost certainly have to include Operations.h unless you enjoy
link errors.
* API/JSBase.cpp:
* API/JSCallbackConstructor.cpp:
* API/JSCallbackFunction.cpp:
* API/JSCallbackObject.cpp:
* API/JSClassRef.cpp:
* API/JSContextRef.cpp:
* API/JSObjectRef.cpp:
* API/JSScriptRef.cpp:
* API/JSWeakObjectMapRefPrivate.cpp:
* JSCTypedArrayStubs.h:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayAllocationProfile.cpp:
* bytecode/CodeBlock.cpp:
* bytecode/GetByIdStatus.cpp:
* bytecode/LazyOperandValueProfile.cpp:
* bytecode/ResolveGlobalStatus.cpp:
* bytecode/SpeculatedType.cpp:
* bytecode/UnlinkedCodeBlock.cpp:
* bytecompiler/BytecodeGenerator.cpp:
* debugger/Debugger.cpp:
* debugger/DebuggerActivation.cpp:
* debugger/DebuggerCallFrame.cpp:
* dfg/DFGArgumentsSimplificationPhase.cpp:
* dfg/DFGArrayMode.cpp:
* dfg/DFGByteCodeParser.cpp:
* dfg/DFGConstantFoldingPhase.cpp:
* dfg/DFGDriver.cpp:
* dfg/DFGFixupPhase.cpp:
* dfg/DFGGraph.cpp:
* dfg/DFGJITCompiler.cpp:
* dfg/DFGOSREntry.cpp:
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGOSRExitCompiler32_64.cpp:
* dfg/DFGOSRExitCompiler64.cpp:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::silentSavePlanForGPR):
(DFG):
(JSC::DFG::SpeculativeJIT::silentSavePlanForFPR):
(JSC::DFG::SpeculativeJIT::silentSpill):
(JSC::DFG::SpeculativeJIT::silentFill):
* dfg/DFGSpeculativeJIT.h:
(SpeculativeJIT):
* dfg/DFGSpeculativeJIT32_64.cpp:
* dfg/DFGSpeculativeJIT64.cpp:
* dfg/DFGStructureCheckHoistingPhase.cpp:
* dfg/DFGVariableEventStream.cpp:
* heap/CopiedBlock.h:
* heap/CopiedSpace.cpp:
* heap/HandleSet.cpp:
* heap/Heap.cpp:
* heap/HeapStatistics.cpp:
* heap/SlotVisitor.cpp:
* heap/WeakBlock.cpp:
* interpreter/CallFrame.cpp:
* interpreter/CallFrame.h:
* jit/ClosureCallStubRoutine.cpp:
* jit/GCAwareJITStubRoutine.cpp:
* jit/JIT.cpp:
* jit/JITArithmetic.cpp:
* jit/JITArithmetic32_64.cpp:
* jit/JITCall.cpp:
* jit/JITCall32_64.cpp:
* jit/JITCode.h:
* jit/JITExceptions.cpp:
* jit/JITStubs.h:
* jit/JITThunks.h:
* jsc.cpp:
* llint/LLIntExceptions.cpp:
* profiler/LegacyProfiler.cpp:
* profiler/ProfileGenerator.cpp:
* profiler/ProfilerBytecode.cpp:
* profiler/ProfilerBytecodeSequence.cpp:
* profiler/ProfilerBytecodes.cpp:
* profiler/ProfilerCompilation.cpp:
* profiler/ProfilerCompiledBytecode.cpp:
* profiler/ProfilerDatabase.cpp:
* profiler/ProfilerOSRExit.cpp:
* profiler/ProfilerOSRExitSite.cpp:
* profiler/ProfilerOrigin.cpp:
* profiler/ProfilerOriginStack.cpp:
* profiler/ProfilerProfiledBytecodes.cpp:
* runtime/ArgList.cpp:
* runtime/Arguments.cpp:
* runtime/ArrayConstructor.cpp:
* runtime/BooleanConstructor.cpp:
* runtime/BooleanObject.cpp:
* runtime/BooleanPrototype.cpp:
* runtime/CallData.cpp:
* runtime/CodeCache.cpp:
* runtime/Completion.cpp:
* runtime/ConstructData.cpp:
* runtime/DateConstructor.cpp:
* runtime/DateInstance.cpp:
* runtime/DatePrototype.cpp:
* runtime/Error.cpp:
* runtime/ErrorConstructor.cpp:
* runtime/ErrorInstance.cpp:
* runtime/ErrorPrototype.cpp:
* runtime/ExceptionHelpers.cpp:
* runtime/Executable.cpp:
* runtime/FunctionConstructor.cpp:
* runtime/FunctionPrototype.cpp:
* runtime/GetterSetter.cpp:
* runtime/Identifier.cpp:
* runtime/InternalFunction.cpp:
* runtime/JSActivation.cpp:
* runtime/JSBoundFunction.cpp:
* runtime/JSCell.cpp:
* runtime/JSCell.h:
(JSC):
* runtime/JSCellInlines.h: Added.
(JSC):
(JSC::JSCell::JSCell):
(JSC::JSCell::finishCreation):
(JSC::JSCell::structure):
(JSC::JSCell::visitChildren):
(JSC::allocateCell):
(JSC::isZapped):
(JSC::JSCell::isObject):
(JSC::JSCell::isString):
(JSC::JSCell::isGetterSetter):
(JSC::JSCell::isProxy):
(JSC::JSCell::isAPIValueWrapper):
(JSC::JSCell::setStructure):
(JSC::JSCell::methodTable):
(JSC::JSCell::inherits):
(JSC::JSCell::fastGetOwnPropertySlot):
(JSC::JSCell::fastGetOwnProperty):
(JSC::JSCell::toBoolean):
* runtime/JSDateMath.cpp:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
(JSC):
* runtime/JSGlobalData.h:
(JSC):
(JSGlobalData):
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObjectFunctions.cpp:
* runtime/JSLock.cpp:
* runtime/JSNameScope.cpp:
* runtime/JSNotAnObject.cpp:
* runtime/JSONObject.cpp:
* runtime/JSObject.h:
(JSC):
* runtime/JSProxy.cpp:
* runtime/JSScope.cpp:
* runtime/JSSegmentedVariableObject.cpp:
* runtime/JSString.h:
(JSC):
* runtime/JSStringJoiner.cpp:
* runtime/JSSymbolTableObject.cpp:
* runtime/JSValue.cpp:
* runtime/JSValueInlines.h:
(JSC::JSValue::toInt32):
(JSC::JSValue::toUInt32):
(JSC):
(JSC::JSValue::isUInt32):
(JSC::JSValue::asUInt32):
(JSC::JSValue::asNumber):
(JSC::jsNaN):
(JSC::JSValue::JSValue):
(JSC::JSValue::encode):
(JSC::JSValue::decode):
(JSC::JSValue::operator bool):
(JSC::JSValue::operator==):
(JSC::JSValue::operator!=):
(JSC::JSValue::isEmpty):
(JSC::JSValue::isUndefined):
(JSC::JSValue::isNull):
(JSC::JSValue::isUndefinedOrNull):
(JSC::JSValue::isCell):
(JSC::JSValue::isInt32):
(JSC::JSValue::isDouble):
(JSC::JSValue::isTrue):
(JSC::JSValue::isFalse):
(JSC::JSValue::tag):
(JSC::JSValue::payload):
(JSC::JSValue::asInt32):
(JSC::JSValue::asDouble):
(JSC::JSValue::asCell):
(JSC::JSValue::isNumber):
(JSC::JSValue::isBoolean):
(JSC::JSValue::asBoolean):
(JSC::reinterpretDoubleToInt64):
(JSC::reinterpretInt64ToDouble):
(JSC::JSValue::isString):
(JSC::JSValue::isPrimitive):
(JSC::JSValue::isGetterSetter):
(JSC::JSValue::isObject):
(JSC::JSValue::getString):
(JSC::::getString):
(JSC::JSValue::getObject):
(JSC::JSValue::getUInt32):
(JSC::JSValue::toPrimitive):
(JSC::JSValue::getPrimitiveNumber):
(JSC::JSValue::toNumber):
(JSC::JSValue::toObject):
(JSC::JSValue::isFunction):
(JSC::JSValue::inherits):
(JSC::JSValue::toThisObject):
(JSC::JSValue::get):
(JSC::JSValue::put):
(JSC::JSValue::putByIndex):
(JSC::JSValue::structureOrUndefined):
(JSC::JSValue::equal):
(JSC::JSValue::equalSlowCaseInline):
(JSC::JSValue::strictEqualSlowCaseInline):
(JSC::JSValue::strictEqual):
* runtime/JSVariableObject.cpp:
* runtime/JSWithScope.cpp:
* runtime/JSWrapperObject.cpp:
* runtime/LiteralParser.cpp:
* runtime/Lookup.cpp:
* runtime/NameConstructor.cpp:
* runtime/NameInstance.cpp:
* runtime/NamePrototype.cpp:
* runtime/NativeErrorConstructor.cpp:
* runtime/NativeErrorPrototype.cpp:
* runtime/NumberConstructor.cpp:
* runtime/NumberObject.cpp:
* runtime/ObjectConstructor.cpp:
* runtime/ObjectPrototype.cpp:
* runtime/Operations.h:
(JSC):
* runtime/PropertySlot.cpp:
* runtime/RegExp.cpp:
* runtime/RegExpCache.cpp:
* runtime/RegExpCachedResult.cpp:
* runtime/RegExpConstructor.cpp:
* runtime/RegExpMatchesArray.cpp:
* runtime/RegExpObject.cpp:
* runtime/RegExpPrototype.cpp:
* runtime/SmallStrings.cpp:
* runtime/SparseArrayValueMap.cpp:
* runtime/StrictEvalActivation.cpp:
* runtime/StringConstructor.cpp:
* runtime/StringObject.cpp:
* runtime/StringRecursionChecker.cpp:
* runtime/Structure.h:
(JSC):
* runtime/StructureChain.cpp:
* runtime/TimeoutChecker.cpp:
* testRegExp.cpp:
Source/WebCore:
Rubber stamped by Sam Weinig.
All .cpp files that use the JSC internal API must now transitively include
Operations.h, and none of the major JSC headers do it for you to avoid
circularity. WebCore doesn't have to worry about circularity with JSC, so
this changes all of the major WebCore JSC base headers to include
Operations.h.
* bindings/js/BindingState.h:
* bindings/js/JSArrayBufferViewHelper.h:
* bindings/js/JSCustomXPathNSResolver.h:
* bindings/js/JSDOMBinding.h:
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDictionary.h:
* bindings/js/JSMessagePortCustom.h:
* bindings/js/JSNodeFilterCondition.h:
* bindings/js/ScriptValue.h:
* bindings/js/ScriptWrappable.h:
* bindings/js/SerializedScriptValue.cpp:
* bridge/c/c_utility.h:
* bridge/jsc/BridgeJSC.h:
* dom/Node.cpp:
* html/HTMLCanvasElement.cpp:
* html/HTMLImageLoader.cpp:
* plugins/efl/PluginViewEfl.cpp:
* xml/XMLHttpRequest.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139541 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/API/JSBase.cpp b/Source/JavaScriptCore/API/JSBase.cpp
index 677c681..d9886f2 100644
--- a/Source/JavaScriptCore/API/JSBase.cpp
+++ b/Source/JavaScriptCore/API/JSBase.cpp
@@ -29,14 +29,15 @@
#include "APICast.h"
#include "APIShims.h"
+#include "CallFrame.h"
+#include "Completion.h"
+#include "InitializeThreading.h"
+#include "JSGlobalObject.h"
+#include "JSLock.h"
+#include "JSObject.h"
#include "OpaqueJSString.h"
+#include "Operations.h"
#include "SourceCode.h"
-#include <interpreter/CallFrame.h>
-#include <runtime/InitializeThreading.h>
-#include <runtime/Completion.h>
-#include <runtime/JSGlobalObject.h>
-#include <runtime/JSLock.h>
-#include <runtime/JSObject.h>
#include <wtf/text/StringHash.h>
using namespace JSC;
diff --git a/Source/JavaScriptCore/API/JSCallbackConstructor.cpp b/Source/JavaScriptCore/API/JSCallbackConstructor.cpp
index c43182e..ed5c567 100644
--- a/Source/JavaScriptCore/API/JSCallbackConstructor.cpp
+++ b/Source/JavaScriptCore/API/JSCallbackConstructor.cpp
@@ -28,10 +28,11 @@
#include "APIShims.h"
#include "APICast.h"
-#include <runtime/Error.h>
-#include <runtime/JSGlobalObject.h>
-#include <runtime/JSLock.h>
-#include <runtime/ObjectPrototype.h>
+#include "Error.h"
+#include "JSGlobalObject.h"
+#include "JSLock.h"
+#include "ObjectPrototype.h"
+#include "Operations.h"
#include <wtf/Vector.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/API/JSCallbackFunction.cpp b/Source/JavaScriptCore/API/JSCallbackFunction.cpp
index aada87b..e4d0bed 100644
--- a/Source/JavaScriptCore/API/JSCallbackFunction.cpp
+++ b/Source/JavaScriptCore/API/JSCallbackFunction.cpp
@@ -30,10 +30,11 @@
#include "APICast.h"
#include "CodeBlock.h"
#include "ExceptionHelpers.h"
-#include "JSFunction.h"
#include "FunctionPrototype.h"
-#include <runtime/JSGlobalObject.h>
-#include <runtime/JSLock.h>
+#include "JSFunction.h"
+#include "JSGlobalObject.h"
+#include "JSLock.h"
+#include "Operations.h"
#include <wtf/Vector.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/API/JSCallbackObject.cpp b/Source/JavaScriptCore/API/JSCallbackObject.cpp
index 76866fe..e8c2975 100644
--- a/Source/JavaScriptCore/API/JSCallbackObject.cpp
+++ b/Source/JavaScriptCore/API/JSCallbackObject.cpp
@@ -28,6 +28,7 @@
#include "JSCallbackObject.h"
#include "Heap.h"
+#include "Operations.h"
#include <wtf/text/StringHash.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/API/JSClassRef.cpp b/Source/JavaScriptCore/API/JSClassRef.cpp
index f30b02a..4f41347 100644
--- a/Source/JavaScriptCore/API/JSClassRef.cpp
+++ b/Source/JavaScriptCore/API/JSClassRef.cpp
@@ -27,12 +27,13 @@
#include "JSClassRef.h"
#include "APICast.h"
+#include "Identifier.h"
+#include "InitializeThreading.h"
#include "JSCallbackObject.h"
+#include "JSGlobalObject.h"
#include "JSObjectRef.h"
-#include <runtime/InitializeThreading.h>
-#include <runtime/JSGlobalObject.h>
-#include <runtime/ObjectPrototype.h>
-#include <runtime/Identifier.h>
+#include "ObjectPrototype.h"
+#include "Operations.h"
#include <wtf/text/StringHash.h>
#include <wtf/unicode/UTF8.h>
diff --git a/Source/JavaScriptCore/API/JSContextRef.cpp b/Source/JavaScriptCore/API/JSContextRef.cpp
index 162c825..3ce6da9 100644
--- a/Source/JavaScriptCore/API/JSContextRef.cpp
+++ b/Source/JavaScriptCore/API/JSContextRef.cpp
@@ -35,6 +35,7 @@
#include "JSClassRef.h"
#include "JSGlobalObject.h"
#include "JSObject.h"
+#include "Operations.h"
#include <wtf/text/StringBuilder.h>
#include <wtf/text/StringHash.h>
diff --git a/Source/JavaScriptCore/API/JSObjectRef.cpp b/Source/JavaScriptCore/API/JSObjectRef.cpp
index c62efc6..d27f867 100644
--- a/Source/JavaScriptCore/API/JSObjectRef.cpp
+++ b/Source/JavaScriptCore/API/JSObjectRef.cpp
@@ -49,6 +49,7 @@
#include "JSString.h"
#include "JSValueRef.h"
#include "ObjectPrototype.h"
+#include "Operations.h"
#include "PropertyNameArray.h"
#include "RegExpConstructor.h"
diff --git a/Source/JavaScriptCore/API/JSScriptRef.cpp b/Source/JavaScriptCore/API/JSScriptRef.cpp
index 9789860..1d65c33 100644
--- a/Source/JavaScriptCore/API/JSScriptRef.cpp
+++ b/Source/JavaScriptCore/API/JSScriptRef.cpp
@@ -32,6 +32,7 @@
#include "JSGlobalData.h"
#include "JSScriptRefPrivate.h"
#include "OpaqueJSString.h"
+#include "Operations.h"
#include "Parser.h"
#include "SourceCode.h"
#include "SourceProvider.h"
diff --git a/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp b/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
index bdfce08..9d1e834 100644
--- a/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
+++ b/Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
@@ -31,6 +31,7 @@
#include "JSCallbackObject.h"
#include "JSValue.h"
#include "JSWeakObjectMapRefInternal.h"
+#include "Operations.h"
#include <wtf/HashMap.h>
#include <wtf/text/StringHash.h>
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 19970b3..c990f49 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,276 @@
+2013-01-10 Filip Pizlo <fpizlo@apple.com>
+
+ The JITThunks class should be in its own file, and doing so should not break the build
+ https://bugs.webkit.org/show_bug.cgi?id=105696
+
+ Rubber stamped by Sam Weinig and Geoffrey Garen.
+
+ This patch was supposed to just move JITThunks into its own file. But then I
+ realized that there is a horrible circular dependency chain between JSCell,
+ JSGlobalData, CallFrame, and Weak, which only works because of magical include
+ order in JITStubs.h, and the fact that JSGlobalData.h includes JITStubs.h
+ before it includes JSCell or JSValue.
+
+ I first tried to just get JITThunks.h to just magically do the same pointless
+ includes that JITStubs.h had, but then I decided to actually fix the underflying
+ problem, which was that JSCell needed CallFrame, CallFrame needed JSGlobalData,
+ JSGlobalData needed JITThunks, JITThunks needed Weak, and Weak needed JSCell.
+ Now, all of JSCell's outgoing dependencies are placed in JSCellInlines.h. This
+ also gave me an opportunity to move JSValue inline methods from JSCell.h into
+ JSValueInlines.h. But to make this really work, I needed to remove includes of
+ *Inlines.h from other headers (CodeBlock.h for example included JSValueInlines.h,
+ which defeats the whole entire purpose of having an Inlines.h file), and I needed
+ to add includes of *Inlines.h into a bunch of .cpp files. I did this mostly by
+ having .cpp files include Operations.h. In future, if you're adding a .cpp file
+ to JSC, you'll almost certainly have to include Operations.h unless you enjoy
+ link errors.
+
+ * API/JSBase.cpp:
+ * API/JSCallbackConstructor.cpp:
+ * API/JSCallbackFunction.cpp:
+ * API/JSCallbackObject.cpp:
+ * API/JSClassRef.cpp:
+ * API/JSContextRef.cpp:
+ * API/JSObjectRef.cpp:
+ * API/JSScriptRef.cpp:
+ * API/JSWeakObjectMapRefPrivate.cpp:
+ * JSCTypedArrayStubs.h:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * bytecode/ArrayAllocationProfile.cpp:
+ * bytecode/CodeBlock.cpp:
+ * bytecode/GetByIdStatus.cpp:
+ * bytecode/LazyOperandValueProfile.cpp:
+ * bytecode/ResolveGlobalStatus.cpp:
+ * bytecode/SpeculatedType.cpp:
+ * bytecode/UnlinkedCodeBlock.cpp:
+ * bytecompiler/BytecodeGenerator.cpp:
+ * debugger/Debugger.cpp:
+ * debugger/DebuggerActivation.cpp:
+ * debugger/DebuggerCallFrame.cpp:
+ * dfg/DFGArgumentsSimplificationPhase.cpp:
+ * dfg/DFGArrayMode.cpp:
+ * dfg/DFGByteCodeParser.cpp:
+ * dfg/DFGConstantFoldingPhase.cpp:
+ * dfg/DFGDriver.cpp:
+ * dfg/DFGFixupPhase.cpp:
+ * dfg/DFGGraph.cpp:
+ * dfg/DFGJITCompiler.cpp:
+ * dfg/DFGOSREntry.cpp:
+ * dfg/DFGOSRExitCompiler.cpp:
+ * dfg/DFGOSRExitCompiler32_64.cpp:
+ * dfg/DFGOSRExitCompiler64.cpp:
+ * dfg/DFGPredictionPropagationPhase.cpp:
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::silentSavePlanForGPR):
+ (DFG):
+ (JSC::DFG::SpeculativeJIT::silentSavePlanForFPR):
+ (JSC::DFG::SpeculativeJIT::silentSpill):
+ (JSC::DFG::SpeculativeJIT::silentFill):
+ * dfg/DFGSpeculativeJIT.h:
+ (SpeculativeJIT):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ * dfg/DFGSpeculativeJIT64.cpp:
+ * dfg/DFGStructureCheckHoistingPhase.cpp:
+ * dfg/DFGVariableEventStream.cpp:
+ * heap/CopiedBlock.h:
+ * heap/CopiedSpace.cpp:
+ * heap/HandleSet.cpp:
+ * heap/Heap.cpp:
+ * heap/HeapStatistics.cpp:
+ * heap/SlotVisitor.cpp:
+ * heap/WeakBlock.cpp:
+ * interpreter/CallFrame.cpp:
+ * interpreter/CallFrame.h:
+ * jit/ClosureCallStubRoutine.cpp:
+ * jit/GCAwareJITStubRoutine.cpp:
+ * jit/JIT.cpp:
+ * jit/JITArithmetic.cpp:
+ * jit/JITArithmetic32_64.cpp:
+ * jit/JITCall.cpp:
+ * jit/JITCall32_64.cpp:
+ * jit/JITCode.h:
+ * jit/JITExceptions.cpp:
+ * jit/JITStubs.h:
+ * jit/JITThunks.h:
+ * jsc.cpp:
+ * llint/LLIntExceptions.cpp:
+ * profiler/LegacyProfiler.cpp:
+ * profiler/ProfileGenerator.cpp:
+ * profiler/ProfilerBytecode.cpp:
+ * profiler/ProfilerBytecodeSequence.cpp:
+ * profiler/ProfilerBytecodes.cpp:
+ * profiler/ProfilerCompilation.cpp:
+ * profiler/ProfilerCompiledBytecode.cpp:
+ * profiler/ProfilerDatabase.cpp:
+ * profiler/ProfilerOSRExit.cpp:
+ * profiler/ProfilerOSRExitSite.cpp:
+ * profiler/ProfilerOrigin.cpp:
+ * profiler/ProfilerOriginStack.cpp:
+ * profiler/ProfilerProfiledBytecodes.cpp:
+ * runtime/ArgList.cpp:
+ * runtime/Arguments.cpp:
+ * runtime/ArrayConstructor.cpp:
+ * runtime/BooleanConstructor.cpp:
+ * runtime/BooleanObject.cpp:
+ * runtime/BooleanPrototype.cpp:
+ * runtime/CallData.cpp:
+ * runtime/CodeCache.cpp:
+ * runtime/Completion.cpp:
+ * runtime/ConstructData.cpp:
+ * runtime/DateConstructor.cpp:
+ * runtime/DateInstance.cpp:
+ * runtime/DatePrototype.cpp:
+ * runtime/Error.cpp:
+ * runtime/ErrorConstructor.cpp:
+ * runtime/ErrorInstance.cpp:
+ * runtime/ErrorPrototype.cpp:
+ * runtime/ExceptionHelpers.cpp:
+ * runtime/Executable.cpp:
+ * runtime/FunctionConstructor.cpp:
+ * runtime/FunctionPrototype.cpp:
+ * runtime/GetterSetter.cpp:
+ * runtime/Identifier.cpp:
+ * runtime/InternalFunction.cpp:
+ * runtime/JSActivation.cpp:
+ * runtime/JSBoundFunction.cpp:
+ * runtime/JSCell.cpp:
+ * runtime/JSCell.h:
+ (JSC):
+ * runtime/JSCellInlines.h: Added.
+ (JSC):
+ (JSC::JSCell::JSCell):
+ (JSC::JSCell::finishCreation):
+ (JSC::JSCell::structure):
+ (JSC::JSCell::visitChildren):
+ (JSC::allocateCell):
+ (JSC::isZapped):
+ (JSC::JSCell::isObject):
+ (JSC::JSCell::isString):
+ (JSC::JSCell::isGetterSetter):
+ (JSC::JSCell::isProxy):
+ (JSC::JSCell::isAPIValueWrapper):
+ (JSC::JSCell::setStructure):
+ (JSC::JSCell::methodTable):
+ (JSC::JSCell::inherits):
+ (JSC::JSCell::fastGetOwnPropertySlot):
+ (JSC::JSCell::fastGetOwnProperty):
+ (JSC::JSCell::toBoolean):
+ * runtime/JSDateMath.cpp:
+ * runtime/JSFunction.cpp:
+ * runtime/JSFunction.h:
+ (JSC):
+ * runtime/JSGlobalData.h:
+ (JSC):
+ (JSGlobalData):
+ * runtime/JSGlobalObject.cpp:
+ * runtime/JSGlobalObjectFunctions.cpp:
+ * runtime/JSLock.cpp:
+ * runtime/JSNameScope.cpp:
+ * runtime/JSNotAnObject.cpp:
+ * runtime/JSONObject.cpp:
+ * runtime/JSObject.h:
+ (JSC):
+ * runtime/JSProxy.cpp:
+ * runtime/JSScope.cpp:
+ * runtime/JSSegmentedVariableObject.cpp:
+ * runtime/JSString.h:
+ (JSC):
+ * runtime/JSStringJoiner.cpp:
+ * runtime/JSSymbolTableObject.cpp:
+ * runtime/JSValue.cpp:
+ * runtime/JSValueInlines.h:
+ (JSC::JSValue::toInt32):
+ (JSC::JSValue::toUInt32):
+ (JSC):
+ (JSC::JSValue::isUInt32):
+ (JSC::JSValue::asUInt32):
+ (JSC::JSValue::asNumber):
+ (JSC::jsNaN):
+ (JSC::JSValue::JSValue):
+ (JSC::JSValue::encode):
+ (JSC::JSValue::decode):
+ (JSC::JSValue::operator bool):
+ (JSC::JSValue::operator==):
+ (JSC::JSValue::operator!=):
+ (JSC::JSValue::isEmpty):
+ (JSC::JSValue::isUndefined):
+ (JSC::JSValue::isNull):
+ (JSC::JSValue::isUndefinedOrNull):
+ (JSC::JSValue::isCell):
+ (JSC::JSValue::isInt32):
+ (JSC::JSValue::isDouble):
+ (JSC::JSValue::isTrue):
+ (JSC::JSValue::isFalse):
+ (JSC::JSValue::tag):
+ (JSC::JSValue::payload):
+ (JSC::JSValue::asInt32):
+ (JSC::JSValue::asDouble):
+ (JSC::JSValue::asCell):
+ (JSC::JSValue::isNumber):
+ (JSC::JSValue::isBoolean):
+ (JSC::JSValue::asBoolean):
+ (JSC::reinterpretDoubleToInt64):
+ (JSC::reinterpretInt64ToDouble):
+ (JSC::JSValue::isString):
+ (JSC::JSValue::isPrimitive):
+ (JSC::JSValue::isGetterSetter):
+ (JSC::JSValue::isObject):
+ (JSC::JSValue::getString):
+ (JSC::::getString):
+ (JSC::JSValue::getObject):
+ (JSC::JSValue::getUInt32):
+ (JSC::JSValue::toPrimitive):
+ (JSC::JSValue::getPrimitiveNumber):
+ (JSC::JSValue::toNumber):
+ (JSC::JSValue::toObject):
+ (JSC::JSValue::isFunction):
+ (JSC::JSValue::inherits):
+ (JSC::JSValue::toThisObject):
+ (JSC::JSValue::get):
+ (JSC::JSValue::put):
+ (JSC::JSValue::putByIndex):
+ (JSC::JSValue::structureOrUndefined):
+ (JSC::JSValue::equal):
+ (JSC::JSValue::equalSlowCaseInline):
+ (JSC::JSValue::strictEqualSlowCaseInline):
+ (JSC::JSValue::strictEqual):
+ * runtime/JSVariableObject.cpp:
+ * runtime/JSWithScope.cpp:
+ * runtime/JSWrapperObject.cpp:
+ * runtime/LiteralParser.cpp:
+ * runtime/Lookup.cpp:
+ * runtime/NameConstructor.cpp:
+ * runtime/NameInstance.cpp:
+ * runtime/NamePrototype.cpp:
+ * runtime/NativeErrorConstructor.cpp:
+ * runtime/NativeErrorPrototype.cpp:
+ * runtime/NumberConstructor.cpp:
+ * runtime/NumberObject.cpp:
+ * runtime/ObjectConstructor.cpp:
+ * runtime/ObjectPrototype.cpp:
+ * runtime/Operations.h:
+ (JSC):
+ * runtime/PropertySlot.cpp:
+ * runtime/RegExp.cpp:
+ * runtime/RegExpCache.cpp:
+ * runtime/RegExpCachedResult.cpp:
+ * runtime/RegExpConstructor.cpp:
+ * runtime/RegExpMatchesArray.cpp:
+ * runtime/RegExpObject.cpp:
+ * runtime/RegExpPrototype.cpp:
+ * runtime/SmallStrings.cpp:
+ * runtime/SparseArrayValueMap.cpp:
+ * runtime/StrictEvalActivation.cpp:
+ * runtime/StringConstructor.cpp:
+ * runtime/StringObject.cpp:
+ * runtime/StringRecursionChecker.cpp:
+ * runtime/Structure.h:
+ (JSC):
+ * runtime/StructureChain.cpp:
+ * runtime/TimeoutChecker.cpp:
+ * testRegExp.cpp:
+
2013-01-11 Filip Pizlo <fpizlo@apple.com>
If you use Phantom to force something to be live across an OSR exit, you should put it after the OSR exit
diff --git a/Source/JavaScriptCore/JSCTypedArrayStubs.h b/Source/JavaScriptCore/JSCTypedArrayStubs.h
index 91481fa..fdc3ead 100644
--- a/Source/JavaScriptCore/JSCTypedArrayStubs.h
+++ b/Source/JavaScriptCore/JSCTypedArrayStubs.h
@@ -28,6 +28,7 @@
#include "JSDestructibleObject.h"
#include "ObjectPrototype.h"
+#include "Operations.h"
#include <wtf/Float32Array.h>
#include <wtf/Float64Array.h>
#include <wtf/Forward.h>
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
index 332e497..f3fba42 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
@@ -2197,7 +2197,6 @@
RelativePath="..\..\jit\JITStubs.h"
>
</File>
- <File
RelativePath="..\..\jit\JITThunks.cpp"
>
</File>
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index cead0bf..2149910 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -199,6 +199,7 @@
0F9332A514CA7DDD0085F3C6 /* StructureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329B14CA7DC10085F3C6 /* StructureSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F96EBB316676EF6008BADE3 /* CodeBlockWithJITType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F96EBB116676EF4008BADE3 /* CodeBlockWithJITType.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F9749711687ADE400A4FF6A /* JSCellInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F97496F1687ADE200A4FF6A /* JSCellInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F9D3370165DBB90005AD387 /* Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D336E165DBB8D005AD387 /* Disassembler.cpp */; };
0F9FC8C314E1B5FE00D52AE0 /* PolymorphicPutByIdList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9FC8BF14E1B5FB00D52AE0 /* PolymorphicPutByIdList.cpp */; };
0F9FC8C414E1B60000D52AE0 /* PolymorphicPutByIdList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9FC8C014E1B5FB00D52AE0 /* PolymorphicPutByIdList.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1056,6 +1057,7 @@
0F93329B14CA7DC10085F3C6 /* StructureSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureSet.h; sourceTree = "<group>"; };
0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueProfile.h; sourceTree = "<group>"; };
0F96EBB116676EF4008BADE3 /* CodeBlockWithJITType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeBlockWithJITType.h; sourceTree = "<group>"; };
+ 0F97496F1687ADE200A4FF6A /* JSCellInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCellInlines.h; sourceTree = "<group>"; };
0F9D336E165DBB8D005AD387 /* Disassembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Disassembler.cpp; path = disassembler/Disassembler.cpp; sourceTree = "<group>"; };
0F9FC8BF14E1B5FB00D52AE0 /* PolymorphicPutByIdList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolymorphicPutByIdList.cpp; sourceTree = "<group>"; };
0F9FC8C014E1B5FB00D52AE0 /* PolymorphicPutByIdList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolymorphicPutByIdList.h; sourceTree = "<group>"; };
@@ -2342,6 +2344,7 @@
86FA9E90142BBB2E001773B7 /* JSBoundFunction.h */,
BC7F8FBA0E19D1EF008632C0 /* JSCell.cpp */,
BC1167D80E19BCC9008066DD /* JSCell.h */,
+ 0F97496F1687ADE200A4FF6A /* JSCellInlines.h */,
9788FC221471AD0C0068CE2D /* JSDateMath.cpp */,
9788FC231471AD0C0068CE2D /* JSDateMath.h */,
C2A7F687160432D400F76B98 /* JSDestructibleObject.h */,
@@ -3266,6 +3269,9 @@
86704B8812DBA33700A9FE7B /* YarrParser.h in Headers */,
86704B8A12DBA33700A9FE7B /* YarrPattern.h in Headers */,
86704B4312DB8A8100A9FE7B /* YarrSyntaxChecker.h in Headers */,
+ 0F5EF91F16878F7D003E5C25 /* JITThunks.h in Headers */,
+ 0F572D4F16879FDD00E57FBD /* ThunkGenerator.h in Headers */,
+ 0F9749711687ADE400A4FF6A /* JSCellInlines.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/JavaScriptCore/bytecode/ArrayAllocationProfile.cpp b/Source/JavaScriptCore/bytecode/ArrayAllocationProfile.cpp
index aa682da..6d9afda 100644
--- a/Source/JavaScriptCore/bytecode/ArrayAllocationProfile.cpp
+++ b/Source/JavaScriptCore/bytecode/ArrayAllocationProfile.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "ArrayAllocationProfile.h"
+#include "Operations.h"
+
namespace JSC {
void ArrayAllocationProfile::updateIndexingType()
diff --git a/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp b/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
index c90f9c7..1c1143e 100644
--- a/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
+++ b/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
@@ -28,6 +28,7 @@
#include "CodeBlock.h"
#include "LLIntCallLinkInfo.h"
+#include "Operations.h"
#include <wtf/CommaPrinter.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index f54d7e2..1102a5b 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -45,6 +45,7 @@
#include "JSNameScope.h"
#include "JSValue.h"
#include "LowLevelInterpreter.h"
+#include "Operations.h"
#include "ReduceWhitespace.h"
#include "RepatchBuffer.h"
#include "SlotVisitorInlines.h"
diff --git a/Source/JavaScriptCore/bytecode/CodeOrigin.cpp b/Source/JavaScriptCore/bytecode/CodeOrigin.cpp
index 52b8e30..6e8acd2 100644
--- a/Source/JavaScriptCore/bytecode/CodeOrigin.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeOrigin.cpp
@@ -29,6 +29,7 @@
#include "CallFrame.h"
#include "CodeBlock.h"
#include "Executable.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp b/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
index d17c173..b10be90 100644
--- a/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
+++ b/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
@@ -30,6 +30,7 @@
#include "JSScope.h"
#include "LLIntData.h"
#include "LowLevelInterpreter.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp b/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp
index f923e4a..97b8f3b 100644
--- a/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp
+++ b/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp
@@ -28,6 +28,8 @@
#if ENABLE(VALUE_PROFILER)
+#include "Operations.h"
+
namespace JSC {
CompressedLazyOperandValueProfileHolder::CompressedLazyOperandValueProfileHolder() { }
diff --git a/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp b/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp
index 7814f8c..0cee38d 100644
--- a/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp
+++ b/Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp
@@ -28,6 +28,7 @@
#include "CodeBlock.h"
#include "JSValue.h"
+#include "Operations.h"
#include "Structure.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/bytecode/SpeculatedType.cpp b/Source/JavaScriptCore/bytecode/SpeculatedType.cpp
index a07ca2b..7b78592 100644
--- a/Source/JavaScriptCore/bytecode/SpeculatedType.cpp
+++ b/Source/JavaScriptCore/bytecode/SpeculatedType.cpp
@@ -32,6 +32,7 @@
#include "Arguments.h"
#include "JSArray.h"
#include "JSFunction.h"
+#include "Operations.h"
#include "ValueProfile.h"
#include <wtf/BoundsCheckedPointer.h>
#include <wtf/StringPrintStream.h>
diff --git a/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp b/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
index 0be6737..5ceaac7 100644
--- a/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
@@ -32,6 +32,7 @@
#include "CodeCache.h"
#include "Executable.h"
#include "JSString.h"
+#include "Operations.h"
#include "SourceProvider.h"
#include "Structure.h"
#include "SymbolTable.h"
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index 5072416..81456fc 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -38,6 +38,7 @@
#include "JSFunction.h"
#include "JSNameScope.h"
#include "LowLevelInterpreter.h"
+#include "Operations.h"
#include "Options.h"
#include "StrongInlines.h"
#include <wtf/text/WTFString.h>
diff --git a/Source/JavaScriptCore/debugger/Debugger.cpp b/Source/JavaScriptCore/debugger/Debugger.cpp
index 7eda52d..2bfa256 100644
--- a/Source/JavaScriptCore/debugger/Debugger.cpp
+++ b/Source/JavaScriptCore/debugger/Debugger.cpp
@@ -26,6 +26,7 @@
#include "Interpreter.h"
#include "JSFunction.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
#include "Parser.h"
#include "Protect.h"
diff --git a/Source/JavaScriptCore/debugger/DebuggerActivation.cpp b/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
index e234680..2c173f7 100644
--- a/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
+++ b/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
@@ -27,6 +27,7 @@
#include "DebuggerActivation.h"
#include "JSActivation.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
index e924ad3..d898b17 100644
--- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
+++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
@@ -32,6 +32,7 @@
#include "JSFunction.h"
#include "CodeBlock.h"
#include "Interpreter.h"
+#include "Operations.h"
#include "Parser.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
index cef9e3d..7d635ac 100644
--- a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
@@ -35,6 +35,7 @@
#include "DFGPhase.h"
#include "DFGValidate.h"
#include "DFGVariableAccessDataDump.h"
+#include "Operations.h"
#include <wtf/HashSet.h>
#include <wtf/HashMap.h>
diff --git a/Source/JavaScriptCore/dfg/DFGArrayMode.cpp b/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
index a8323ba..b23b042 100644
--- a/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
+++ b/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
@@ -30,6 +30,7 @@
#include "DFGAbstractValue.h"
#include "DFGGraph.h"
+#include "Operations.h"
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index ebf9569..3e31c3d 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -35,6 +35,7 @@
#include "DFGArrayMode.h"
#include "DFGCapabilities.h"
#include "GetByIdStatus.h"
+#include "JSValueInlines.h"
#include "PutByIdStatus.h"
#include "ResolveGlobalStatus.h"
#include <wtf/HashMap.h>
diff --git a/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp b/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
index 9fb8c5b..baeaafd 100644
--- a/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
@@ -34,6 +34,7 @@
#include "DFGInsertionSet.h"
#include "DFGPhase.h"
#include "GetByIdStatus.h"
+#include "Operations.h"
#include "PutByIdStatus.h"
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGDriver.cpp b/Source/JavaScriptCore/dfg/DFGDriver.cpp
index 42b5b79..3a67a42 100644
--- a/Source/JavaScriptCore/dfg/DFGDriver.cpp
+++ b/Source/JavaScriptCore/dfg/DFGDriver.cpp
@@ -44,6 +44,7 @@
#include "DFGStructureCheckHoistingPhase.h"
#include "DFGValidate.h"
#include "DFGVirtualRegisterAllocationPhase.h"
+#include "Operations.h"
#include "Options.h"
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
index 629ccf3..8228e81 100644
--- a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
@@ -31,6 +31,7 @@
#include "DFGGraph.h"
#include "DFGInsertionSet.h"
#include "DFGPhase.h"
+#include "Operations.h"
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGGraph.cpp b/Source/JavaScriptCore/dfg/DFGGraph.cpp
index f67fce4..a86b78f 100644
--- a/Source/JavaScriptCore/dfg/DFGGraph.cpp
+++ b/Source/JavaScriptCore/dfg/DFGGraph.cpp
@@ -28,6 +28,7 @@
#include "CodeBlock.h"
#include "DFGVariableAccessDataDump.h"
+#include "Operations.h"
#if ENABLE(DFG_JIT)
diff --git a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
index 5c4e8cc..2842599 100644
--- a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
+++ b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
@@ -36,6 +36,7 @@
#include "DFGSpeculativeJIT.h"
#include "DFGThunks.h"
#include "JSGlobalData.h"
+#include "JSValueInlines.h"
#include "LinkBuffer.h"
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGOSREntry.cpp b/Source/JavaScriptCore/dfg/DFGOSREntry.cpp
index a991228..b30f1f0 100644
--- a/Source/JavaScriptCore/dfg/DFGOSREntry.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSREntry.cpp
@@ -32,6 +32,7 @@
#include "CodeBlock.h"
#include "DFGNode.h"
#include "JIT.h"
+#include "Operations.h"
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp
index 81f8a48..ca96ce9 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp
@@ -31,6 +31,7 @@
#include "CallFrame.h"
#include "DFGCommon.h"
#include "LinkBuffer.h"
+#include "Operations.h"
#include "RepatchBuffer.h"
#include <wtf/StringPrintStream.h>
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
index d1a6881..4dfb090 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
@@ -29,6 +29,7 @@
#if ENABLE(DFG_JIT) && USE(JSVALUE32_64)
#include "DFGOperations.h"
+#include "Operations.h"
#include <wtf/DataLog.h>
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
index e768fe8..e4d3fbf 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
@@ -29,6 +29,7 @@
#if ENABLE(DFG_JIT) && USE(JSVALUE64)
#include "DFGOperations.h"
+#include "Operations.h"
#include <wtf/DataLog.h>
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
index 64f788c..ae0992e 100644
--- a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
@@ -30,6 +30,7 @@
#include "DFGGraph.h"
#include "DFGPhase.h"
+#include "Operations.h"
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index bd3fda2..fcacecf 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -32,6 +32,7 @@
#include "DFGArrayifySlowPathGenerator.h"
#include "DFGCallArrayAllocatorSlowPathGenerator.h"
#include "DFGSlowPathGenerator.h"
+#include "JSValueInlines.h"
#include "LinkBuffer.h"
namespace JSC { namespace DFG {
@@ -364,6 +365,276 @@
m_fprs = RegisterBank<FPRInfo>();
}
+SilentRegisterSavePlan SpeculativeJIT::silentSavePlanForGPR(VirtualRegister spillMe, GPRReg source)
+{
+ GenerationInfo& info = m_generationInfo[spillMe];
+ NodeIndex nodeIndex = info.nodeIndex();
+ Node& node = at(nodeIndex);
+ DataFormat registerFormat = info.registerFormat();
+ ASSERT(registerFormat != DataFormatNone);
+ ASSERT(registerFormat != DataFormatDouble);
+
+ SilentSpillAction spillAction;
+ SilentFillAction fillAction;
+
+ if (!info.needsSpill())
+ spillAction = DoNothingForSpill;
+ else {
+#if USE(JSVALUE64)
+ ASSERT(info.gpr() == source);
+ if (registerFormat == DataFormatInteger)
+ spillAction = Store32Payload;
+ else if (registerFormat == DataFormatCell || registerFormat == DataFormatStorage)
+ spillAction = StorePtr;
+ else {
+ ASSERT(registerFormat & DataFormatJS);
+ spillAction = Store64;
+ }
+#elif USE(JSVALUE32_64)
+ if (registerFormat & DataFormatJS) {
+ ASSERT(info.tagGPR() == source || info.payloadGPR() == source);
+ spillAction = source == info.tagGPR() ? Store32Tag : Store32Payload;
+ } else {
+ ASSERT(info.gpr() == source);
+ spillAction = Store32Payload;
+ }
+#endif
+ }
+
+ if (registerFormat == DataFormatInteger) {
+ ASSERT(info.gpr() == source);
+ ASSERT(isJSInteger(info.registerFormat()));
+ if (node.hasConstant()) {
+ ASSERT(isInt32Constant(nodeIndex));
+ fillAction = SetInt32Constant;
+ } else
+ fillAction = Load32Payload;
+ } else if (registerFormat == DataFormatBoolean) {
+#if USE(JSVALUE64)
+ ASSERT_NOT_REACHED();
+ fillAction = DoNothingForFill;
+#elif USE(JSVALUE32_64)
+ ASSERT(info.gpr() == source);
+ if (node.hasConstant()) {
+ ASSERT(isBooleanConstant(nodeIndex));
+ fillAction = SetBooleanConstant;
+ } else
+ fillAction = Load32Payload;
+#endif
+ } else if (registerFormat == DataFormatCell) {
+ ASSERT(info.gpr() == source);
+ if (node.hasConstant()) {
+ JSValue value = valueOfJSConstant(nodeIndex);
+ ASSERT_UNUSED(value, value.isCell());
+ fillAction = SetCellConstant;
+ } else {
+#if USE(JSVALUE64)
+ fillAction = LoadPtr;
+#else
+ fillAction = Load32Payload;
+#endif
+ }
+ } else if (registerFormat == DataFormatStorage) {
+ ASSERT(info.gpr() == source);
+ fillAction = LoadPtr;
+ } else {
+ ASSERT(registerFormat & DataFormatJS);
+#if USE(JSVALUE64)
+ ASSERT(info.gpr() == source);
+ if (node.hasConstant()) {
+ if (valueOfJSConstant(nodeIndex).isCell())
+ fillAction = SetTrustedJSConstant;
+ else
+ fillAction = SetJSConstant;
+ } else if (info.spillFormat() == DataFormatInteger) {
+ ASSERT(registerFormat == DataFormatJSInteger);
+ fillAction = Load32PayloadBoxInt;
+ } else if (info.spillFormat() == DataFormatDouble) {
+ ASSERT(registerFormat == DataFormatJSDouble);
+ fillAction = LoadDoubleBoxDouble;
+ } else
+ fillAction = Load64;
+#else
+ ASSERT(info.tagGPR() == source || info.payloadGPR() == source);
+ if (node.hasConstant())
+ fillAction = info.tagGPR() == source ? SetJSConstantTag : SetJSConstantPayload;
+ else if (info.payloadGPR() == source)
+ fillAction = Load32Payload;
+ else { // Fill the Tag
+ switch (info.spillFormat()) {
+ case DataFormatInteger:
+ ASSERT(registerFormat == DataFormatJSInteger);
+ fillAction = SetInt32Tag;
+ break;
+ case DataFormatCell:
+ ASSERT(registerFormat == DataFormatJSCell);
+ fillAction = SetCellTag;
+ break;
+ case DataFormatBoolean:
+ ASSERT(registerFormat == DataFormatJSBoolean);
+ fillAction = SetBooleanTag;
+ break;
+ default:
+ fillAction = Load32Tag;
+ break;
+ }
+ }
+#endif
+ }
+
+ return SilentRegisterSavePlan(spillAction, fillAction, nodeIndex, source);
+}
+
+SilentRegisterSavePlan SpeculativeJIT::silentSavePlanForFPR(VirtualRegister spillMe, FPRReg source)
+{
+ GenerationInfo& info = m_generationInfo[spillMe];
+ NodeIndex nodeIndex = info.nodeIndex();
+ Node& node = at(nodeIndex);
+ ASSERT(info.registerFormat() == DataFormatDouble);
+
+ SilentSpillAction spillAction;
+ SilentFillAction fillAction;
+
+ if (!info.needsSpill())
+ spillAction = DoNothingForSpill;
+ else {
+ ASSERT(!at(info.nodeIndex()).hasConstant());
+ ASSERT(info.spillFormat() == DataFormatNone);
+ ASSERT(info.fpr() == source);
+ spillAction = StoreDouble;
+ }
+
+#if USE(JSVALUE64)
+ if (node.hasConstant()) {
+ ASSERT(isNumberConstant(nodeIndex));
+ fillAction = SetDoubleConstant;
+ } else if (info.spillFormat() != DataFormatNone && info.spillFormat() != DataFormatDouble) {
+ // it was already spilled previously and not as a double, which means we need unboxing.
+ ASSERT(info.spillFormat() & DataFormatJS);
+ fillAction = LoadJSUnboxDouble;
+ } else
+ fillAction = LoadDouble;
+#elif USE(JSVALUE32_64)
+ ASSERT(info.registerFormat() == DataFormatDouble || info.registerFormat() == DataFormatJSDouble);
+ if (node.hasConstant()) {
+ ASSERT(isNumberConstant(nodeIndex));
+ fillAction = SetDoubleConstant;
+ } else
+ fillAction = LoadDouble;
+#endif
+
+ return SilentRegisterSavePlan(spillAction, fillAction, nodeIndex, source);
+}
+
+void SpeculativeJIT::silentSpill(const SilentRegisterSavePlan& plan)
+{
+ switch (plan.spillAction()) {
+ case DoNothingForSpill:
+ break;
+ case Store32Tag:
+ m_jit.store32(plan.gpr(), JITCompiler::tagFor(at(plan.nodeIndex()).virtualRegister()));
+ break;
+ case Store32Payload:
+ m_jit.store32(plan.gpr(), JITCompiler::payloadFor(at(plan.nodeIndex()).virtualRegister()));
+ break;
+ case StorePtr:
+ m_jit.storePtr(plan.gpr(), JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()));
+ break;
+#if USE(JSVALUE64)
+ case Store64:
+ m_jit.store64(plan.gpr(), JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()));
+ break;
+#endif
+ case StoreDouble:
+ m_jit.storeDouble(plan.fpr(), JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()));
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+}
+
+void SpeculativeJIT::silentFill(const SilentRegisterSavePlan& plan, GPRReg canTrample)
+{
+#if USE(JSVALUE32_64)
+ UNUSED_PARAM(canTrample);
+#endif
+ switch (plan.fillAction()) {
+ case DoNothingForFill:
+ break;
+ case SetInt32Constant:
+ m_jit.move(Imm32(valueOfInt32Constant(plan.nodeIndex())), plan.gpr());
+ break;
+ case SetBooleanConstant:
+ m_jit.move(TrustedImm32(valueOfBooleanConstant(plan.nodeIndex())), plan.gpr());
+ break;
+ case SetCellConstant:
+ m_jit.move(TrustedImmPtr(valueOfJSConstant(plan.nodeIndex()).asCell()), plan.gpr());
+ break;
+#if USE(JSVALUE64)
+ case SetTrustedJSConstant:
+ m_jit.move(valueOfJSConstantAsImm64(plan.nodeIndex()).asTrustedImm64(), plan.gpr());
+ break;
+ case SetJSConstant:
+ m_jit.move(valueOfJSConstantAsImm64(plan.nodeIndex()), plan.gpr());
+ break;
+ case SetDoubleConstant:
+ m_jit.move(Imm64(reinterpretDoubleToInt64(valueOfNumberConstant(plan.nodeIndex()))), canTrample);
+ m_jit.move64ToDouble(canTrample, plan.fpr());
+ break;
+ case Load32PayloadBoxInt:
+ m_jit.load32(JITCompiler::payloadFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
+ m_jit.or64(GPRInfo::tagTypeNumberRegister, plan.gpr());
+ break;
+ case LoadDoubleBoxDouble:
+ m_jit.load64(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
+ m_jit.sub64(GPRInfo::tagTypeNumberRegister, plan.gpr());
+ break;
+ case LoadJSUnboxDouble:
+ m_jit.load64(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), canTrample);
+ unboxDouble(canTrample, plan.fpr());
+ break;
+#else
+ case SetJSConstantTag:
+ m_jit.move(Imm32(valueOfJSConstant(plan.nodeIndex()).tag()), plan.gpr());
+ break;
+ case SetJSConstantPayload:
+ m_jit.move(Imm32(valueOfJSConstant(plan.nodeIndex()).payload()), plan.gpr());
+ break;
+ case SetInt32Tag:
+ m_jit.move(TrustedImm32(JSValue::Int32Tag), plan.gpr());
+ break;
+ case SetCellTag:
+ m_jit.move(TrustedImm32(JSValue::CellTag), plan.gpr());
+ break;
+ case SetBooleanTag:
+ m_jit.move(TrustedImm32(JSValue::BooleanTag), plan.gpr());
+ break;
+ case SetDoubleConstant:
+ m_jit.loadDouble(addressOfDoubleConstant(plan.nodeIndex()), plan.fpr());
+ break;
+#endif
+ case Load32Tag:
+ m_jit.load32(JITCompiler::tagFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
+ break;
+ case Load32Payload:
+ m_jit.load32(JITCompiler::payloadFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
+ break;
+ case LoadPtr:
+ m_jit.loadPtr(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
+ break;
+#if USE(JSVALUE64)
+ case Load64:
+ m_jit.load64(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
+ break;
+#endif
+ case LoadDouble:
+ m_jit.loadDouble(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.fpr());
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+}
+
const TypedArrayDescriptor* SpeculativeJIT::typedArrayDescriptor(ArrayMode arrayMode)
{
switch (arrayMode.type()) {
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
index 5ea1076..63e3520 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
@@ -332,275 +332,10 @@
// they spill all live values to the appropriate
// slots in the JSStack without changing any state
// in the GenerationInfo.
- SilentRegisterSavePlan silentSavePlanForGPR(VirtualRegister spillMe, GPRReg source)
- {
- GenerationInfo& info = m_generationInfo[spillMe];
- NodeIndex nodeIndex = info.nodeIndex();
- Node& node = at(nodeIndex);
- DataFormat registerFormat = info.registerFormat();
- ASSERT(registerFormat != DataFormatNone);
- ASSERT(registerFormat != DataFormatDouble);
-
- SilentSpillAction spillAction;
- SilentFillAction fillAction;
-
- if (!info.needsSpill())
- spillAction = DoNothingForSpill;
- else {
-#if USE(JSVALUE64)
- ASSERT(info.gpr() == source);
- if (registerFormat == DataFormatInteger)
- spillAction = Store32Payload;
- else if (registerFormat == DataFormatCell || registerFormat == DataFormatStorage)
- spillAction = StorePtr;
- else {
- ASSERT(registerFormat & DataFormatJS);
- spillAction = Store64;
- }
-#elif USE(JSVALUE32_64)
- if (registerFormat & DataFormatJS) {
- ASSERT(info.tagGPR() == source || info.payloadGPR() == source);
- spillAction = source == info.tagGPR() ? Store32Tag : Store32Payload;
- } else {
- ASSERT(info.gpr() == source);
- spillAction = Store32Payload;
- }
-#endif
- }
-
- if (registerFormat == DataFormatInteger) {
- ASSERT(info.gpr() == source);
- ASSERT(isJSInteger(info.registerFormat()));
- if (node.hasConstant()) {
- ASSERT(isInt32Constant(nodeIndex));
- fillAction = SetInt32Constant;
- } else
- fillAction = Load32Payload;
- } else if (registerFormat == DataFormatBoolean) {
-#if USE(JSVALUE64)
- ASSERT_NOT_REACHED();
- fillAction = DoNothingForFill;
-#elif USE(JSVALUE32_64)
- ASSERT(info.gpr() == source);
- if (node.hasConstant()) {
- ASSERT(isBooleanConstant(nodeIndex));
- fillAction = SetBooleanConstant;
- } else
- fillAction = Load32Payload;
-#endif
- } else if (registerFormat == DataFormatCell) {
- ASSERT(info.gpr() == source);
- if (node.hasConstant()) {
- JSValue value = valueOfJSConstant(nodeIndex);
- ASSERT_UNUSED(value, value.isCell());
- fillAction = SetCellConstant;
- } else {
-#if USE(JSVALUE64)
- fillAction = LoadPtr;
-#else
- fillAction = Load32Payload;
-#endif
- }
- } else if (registerFormat == DataFormatStorage) {
- ASSERT(info.gpr() == source);
- fillAction = LoadPtr;
- } else {
- ASSERT(registerFormat & DataFormatJS);
-#if USE(JSVALUE64)
- ASSERT(info.gpr() == source);
- if (node.hasConstant()) {
- if (valueOfJSConstant(nodeIndex).isCell())
- fillAction = SetTrustedJSConstant;
- else
- fillAction = SetJSConstant;
- } else if (info.spillFormat() == DataFormatInteger) {
- ASSERT(registerFormat == DataFormatJSInteger);
- fillAction = Load32PayloadBoxInt;
- } else if (info.spillFormat() == DataFormatDouble) {
- ASSERT(registerFormat == DataFormatJSDouble);
- fillAction = LoadDoubleBoxDouble;
- } else
- fillAction = Load64;
-#else
- ASSERT(info.tagGPR() == source || info.payloadGPR() == source);
- if (node.hasConstant())
- fillAction = info.tagGPR() == source ? SetJSConstantTag : SetJSConstantPayload;
- else if (info.payloadGPR() == source)
- fillAction = Load32Payload;
- else { // Fill the Tag
- switch (info.spillFormat()) {
- case DataFormatInteger:
- ASSERT(registerFormat == DataFormatJSInteger);
- fillAction = SetInt32Tag;
- break;
- case DataFormatCell:
- ASSERT(registerFormat == DataFormatJSCell);
- fillAction = SetCellTag;
- break;
- case DataFormatBoolean:
- ASSERT(registerFormat == DataFormatJSBoolean);
- fillAction = SetBooleanTag;
- break;
- default:
- fillAction = Load32Tag;
- break;
- }
- }
-#endif
- }
-
- return SilentRegisterSavePlan(spillAction, fillAction, nodeIndex, source);
- }
-
- SilentRegisterSavePlan silentSavePlanForFPR(VirtualRegister spillMe, FPRReg source)
- {
- GenerationInfo& info = m_generationInfo[spillMe];
- NodeIndex nodeIndex = info.nodeIndex();
- Node& node = at(nodeIndex);
- ASSERT(info.registerFormat() == DataFormatDouble);
-
- SilentSpillAction spillAction;
- SilentFillAction fillAction;
-
- if (!info.needsSpill())
- spillAction = DoNothingForSpill;
- else {
- ASSERT(!at(info.nodeIndex()).hasConstant());
- ASSERT(info.spillFormat() == DataFormatNone);
- ASSERT(info.fpr() == source);
- spillAction = StoreDouble;
- }
-
-#if USE(JSVALUE64)
- if (node.hasConstant()) {
- ASSERT(isNumberConstant(nodeIndex));
- fillAction = SetDoubleConstant;
- } else if (info.spillFormat() != DataFormatNone && info.spillFormat() != DataFormatDouble) {
- // it was already spilled previously and not as a double, which means we need unboxing.
- ASSERT(info.spillFormat() & DataFormatJS);
- fillAction = LoadJSUnboxDouble;
- } else
- fillAction = LoadDouble;
-#elif USE(JSVALUE32_64)
- ASSERT(info.registerFormat() == DataFormatDouble || info.registerFormat() == DataFormatJSDouble);
- if (node.hasConstant()) {
- ASSERT(isNumberConstant(nodeIndex));
- fillAction = SetDoubleConstant;
- } else
- fillAction = LoadDouble;
-#endif
-
- return SilentRegisterSavePlan(spillAction, fillAction, nodeIndex, source);
- }
-
- void silentSpill(const SilentRegisterSavePlan& plan)
- {
- switch (plan.spillAction()) {
- case DoNothingForSpill:
- break;
- case Store32Tag:
- m_jit.store32(plan.gpr(), JITCompiler::tagFor(at(plan.nodeIndex()).virtualRegister()));
- break;
- case Store32Payload:
- m_jit.store32(plan.gpr(), JITCompiler::payloadFor(at(plan.nodeIndex()).virtualRegister()));
- break;
- case StorePtr:
- m_jit.storePtr(plan.gpr(), JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()));
- break;
-#if USE(JSVALUE64)
- case Store64:
- m_jit.store64(plan.gpr(), JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()));
- break;
-#endif
- case StoreDouble:
- m_jit.storeDouble(plan.fpr(), JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()));
- break;
- default:
- ASSERT_NOT_REACHED();
- }
- }
-
- void silentFill(const SilentRegisterSavePlan& plan, GPRReg canTrample)
- {
-#if USE(JSVALUE32_64)
- UNUSED_PARAM(canTrample);
-#endif
- switch (plan.fillAction()) {
- case DoNothingForFill:
- break;
- case SetInt32Constant:
- m_jit.move(Imm32(valueOfInt32Constant(plan.nodeIndex())), plan.gpr());
- break;
- case SetBooleanConstant:
- m_jit.move(TrustedImm32(valueOfBooleanConstant(plan.nodeIndex())), plan.gpr());
- break;
- case SetCellConstant:
- m_jit.move(TrustedImmPtr(valueOfJSConstant(plan.nodeIndex()).asCell()), plan.gpr());
- break;
-#if USE(JSVALUE64)
- case SetTrustedJSConstant:
- m_jit.move(valueOfJSConstantAsImm64(plan.nodeIndex()).asTrustedImm64(), plan.gpr());
- break;
- case SetJSConstant:
- m_jit.move(valueOfJSConstantAsImm64(plan.nodeIndex()), plan.gpr());
- break;
- case SetDoubleConstant:
- m_jit.move(Imm64(reinterpretDoubleToInt64(valueOfNumberConstant(plan.nodeIndex()))), canTrample);
- m_jit.move64ToDouble(canTrample, plan.fpr());
- break;
- case Load32PayloadBoxInt:
- m_jit.load32(JITCompiler::payloadFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
- m_jit.or64(GPRInfo::tagTypeNumberRegister, plan.gpr());
- break;
- case LoadDoubleBoxDouble:
- m_jit.load64(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
- m_jit.sub64(GPRInfo::tagTypeNumberRegister, plan.gpr());
- break;
- case LoadJSUnboxDouble:
- m_jit.load64(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), canTrample);
- unboxDouble(canTrample, plan.fpr());
- break;
-#else
- case SetJSConstantTag:
- m_jit.move(Imm32(valueOfJSConstant(plan.nodeIndex()).tag()), plan.gpr());
- break;
- case SetJSConstantPayload:
- m_jit.move(Imm32(valueOfJSConstant(plan.nodeIndex()).payload()), plan.gpr());
- break;
- case SetInt32Tag:
- m_jit.move(TrustedImm32(JSValue::Int32Tag), plan.gpr());
- break;
- case SetCellTag:
- m_jit.move(TrustedImm32(JSValue::CellTag), plan.gpr());
- break;
- case SetBooleanTag:
- m_jit.move(TrustedImm32(JSValue::BooleanTag), plan.gpr());
- break;
- case SetDoubleConstant:
- m_jit.loadDouble(addressOfDoubleConstant(plan.nodeIndex()), plan.fpr());
- break;
-#endif
- case Load32Tag:
- m_jit.load32(JITCompiler::tagFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
- break;
- case Load32Payload:
- m_jit.load32(JITCompiler::payloadFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
- break;
- case LoadPtr:
- m_jit.loadPtr(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
- break;
-#if USE(JSVALUE64)
- case Load64:
- m_jit.load64(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.gpr());
- break;
-#endif
- case LoadDouble:
- m_jit.loadDouble(JITCompiler::addressFor(at(plan.nodeIndex()).virtualRegister()), plan.fpr());
- break;
- default:
- ASSERT_NOT_REACHED();
- }
- }
+ SilentRegisterSavePlan silentSavePlanForGPR(VirtualRegister spillMe, GPRReg source);
+ SilentRegisterSavePlan silentSavePlanForFPR(VirtualRegister spillMe, FPRReg source);
+ void silentSpill(const SilentRegisterSavePlan&);
+ void silentFill(const SilentRegisterSavePlan&, GPRReg canTrample);
template<typename CollectionType>
void silentSpillAllRegistersImpl(bool doSpill, CollectionType& plans, GPRReg exclude, GPRReg exclude2 = InvalidGPRReg, FPRReg fprExclude = InvalidFPRReg)
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
index 05ca69a..5d755b3 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
@@ -34,6 +34,7 @@
#include "DFGSlowPathGenerator.h"
#include "JSActivation.h"
#include "ObjectPrototype.h"
+#include "Operations.h"
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index dffbd08..869ad32 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -32,6 +32,7 @@
#include "ArrayPrototype.h"
#include "DFGCallArrayAllocatorSlowPathGenerator.h"
#include "DFGSlowPathGenerator.h"
+#include "JSValueInlines.h"
#include "ObjectPrototype.h"
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp b/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
index d3a239e..a70f56a 100644
--- a/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
@@ -33,6 +33,7 @@
#include "DFGInsertionSet.h"
#include "DFGPhase.h"
#include "DFGVariableAccessDataDump.h"
+#include "Operations.h"
#include <wtf/HashMap.h>
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp b/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp
index d8652af..72b881f 100644
--- a/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp
+++ b/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp
@@ -30,6 +30,7 @@
#include "CodeBlock.h"
#include "DFGValueSource.h"
+#include "Operations.h"
#include <wtf/DataLog.h>
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/heap/CopiedBlock.h b/Source/JavaScriptCore/heap/CopiedBlock.h
index cc60a010..bd5784b 100644
--- a/Source/JavaScriptCore/heap/CopiedBlock.h
+++ b/Source/JavaScriptCore/heap/CopiedBlock.h
@@ -30,7 +30,6 @@
#include "CopyWorkList.h"
#include "HeapBlock.h"
#include "JSValue.h"
-#include "JSValueInlines.h"
#include "Options.h"
#include <wtf/Atomics.h>
#include <wtf/OwnPtr.h>
diff --git a/Source/JavaScriptCore/heap/CopiedSpace.cpp b/Source/JavaScriptCore/heap/CopiedSpace.cpp
index b235de1..f7afbdd 100644
--- a/Source/JavaScriptCore/heap/CopiedSpace.cpp
+++ b/Source/JavaScriptCore/heap/CopiedSpace.cpp
@@ -28,6 +28,7 @@
#include "CopiedSpaceInlines.h"
#include "GCActivityCallback.h"
+#include "Operations.h"
#include "Options.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/heap/HandleSet.cpp b/Source/JavaScriptCore/heap/HandleSet.cpp
index a6ccf29..dad0a7b 100644
--- a/Source/JavaScriptCore/heap/HandleSet.cpp
+++ b/Source/JavaScriptCore/heap/HandleSet.cpp
@@ -28,6 +28,7 @@
#include "HeapRootVisitor.h"
#include "JSObject.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp
index 6cf7050..83b9de7 100644
--- a/Source/JavaScriptCore/heap/Heap.cpp
+++ b/Source/JavaScriptCore/heap/Heap.cpp
@@ -35,6 +35,7 @@
#include "JSGlobalObject.h"
#include "JSLock.h"
#include "JSONObject.h"
+#include "Operations.h"
#include "Tracing.h"
#include "UnlinkedCodeBlock.h"
#include "WeakSetInlines.h"
diff --git a/Source/JavaScriptCore/heap/HeapStatistics.cpp b/Source/JavaScriptCore/heap/HeapStatistics.cpp
index 2b98fe7..55e3e9d 100644
--- a/Source/JavaScriptCore/heap/HeapStatistics.cpp
+++ b/Source/JavaScriptCore/heap/HeapStatistics.cpp
@@ -28,6 +28,7 @@
#include "Heap.h"
#include "JSObject.h"
+#include "Operations.h"
#include "Options.h"
#include <stdlib.h>
#if OS(UNIX)
diff --git a/Source/JavaScriptCore/heap/MarkedBlock.cpp b/Source/JavaScriptCore/heap/MarkedBlock.cpp
index 9a036f8..0b7f719 100644
--- a/Source/JavaScriptCore/heap/MarkedBlock.cpp
+++ b/Source/JavaScriptCore/heap/MarkedBlock.cpp
@@ -29,7 +29,7 @@
#include "IncrementalSweeper.h"
#include "JSCell.h"
#include "JSDestructibleObject.h"
-
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/heap/SlotVisitor.cpp b/Source/JavaScriptCore/heap/SlotVisitor.cpp
index 3ff4b48..81c31e2 100644
--- a/Source/JavaScriptCore/heap/SlotVisitor.cpp
+++ b/Source/JavaScriptCore/heap/SlotVisitor.cpp
@@ -11,6 +11,7 @@
#include "JSGlobalData.h"
#include "JSObject.h"
#include "JSString.h"
+#include "Operations.h"
#include <wtf/StackStats.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/heap/WeakBlock.cpp b/Source/JavaScriptCore/heap/WeakBlock.cpp
index 5f01f34..9570905 100644
--- a/Source/JavaScriptCore/heap/WeakBlock.cpp
+++ b/Source/JavaScriptCore/heap/WeakBlock.cpp
@@ -29,7 +29,7 @@
#include "Heap.h"
#include "HeapRootVisitor.h"
#include "JSObject.h"
-
+#include "Operations.h"
#include "Structure.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/interpreter/CallFrame.cpp b/Source/JavaScriptCore/interpreter/CallFrame.cpp
index da506c3..3afe610 100644
--- a/Source/JavaScriptCore/interpreter/CallFrame.cpp
+++ b/Source/JavaScriptCore/interpreter/CallFrame.cpp
@@ -28,6 +28,7 @@
#include "CodeBlock.h"
#include "Interpreter.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/interpreter/CallFrame.h b/Source/JavaScriptCore/interpreter/CallFrame.h
index 2b0ea3a..120d0858 100644
--- a/Source/JavaScriptCore/interpreter/CallFrame.h
+++ b/Source/JavaScriptCore/interpreter/CallFrame.h
@@ -27,6 +27,7 @@
#include "JSGlobalData.h"
#include "JSStack.h"
#include "MacroAssemblerCodeRef.h"
+#include "Register.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/jit/ClosureCallStubRoutine.cpp b/Source/JavaScriptCore/jit/ClosureCallStubRoutine.cpp
index 73704aa..7cf84f5 100644
--- a/Source/JavaScriptCore/jit/ClosureCallStubRoutine.cpp
+++ b/Source/JavaScriptCore/jit/ClosureCallStubRoutine.cpp
@@ -31,6 +31,7 @@
#include "Executable.h"
#include "Heap.h"
#include "JSGlobalData.h"
+#include "Operations.h"
#include "SlotVisitor.h"
#include "Structure.h"
diff --git a/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp b/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp
index 521e497..ce21a2f 100644
--- a/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp
+++ b/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp
@@ -30,6 +30,7 @@
#include "Heap.h"
#include "JSGlobalData.h"
+#include "Operations.h"
#include "SlotVisitor.h"
#include "Structure.h"
diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp
index 1188d3a..ec636fb 100644
--- a/Source/JavaScriptCore/jit/JIT.cpp
+++ b/Source/JavaScriptCore/jit/JIT.cpp
@@ -43,6 +43,7 @@
#include "JSArray.h"
#include "JSFunction.h"
#include "LinkBuffer.h"
+#include "Operations.h"
#include "RepatchBuffer.h"
#include "ResultType.h"
#include "SamplingTool.h"
diff --git a/Source/JavaScriptCore/jit/JITArithmetic.cpp b/Source/JavaScriptCore/jit/JITArithmetic.cpp
index bcb3dd7..9077d02 100644
--- a/Source/JavaScriptCore/jit/JITArithmetic.cpp
+++ b/Source/JavaScriptCore/jit/JITArithmetic.cpp
@@ -35,6 +35,7 @@
#include "JSArray.h"
#include "JSFunction.h"
#include "Interpreter.h"
+#include "Operations.h"
#include "ResultType.h"
#include "SamplingTool.h"
diff --git a/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp b/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp
index 960d060..7f75dba 100644
--- a/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp
@@ -36,6 +36,7 @@
#include "JSArray.h"
#include "JSFunction.h"
#include "Interpreter.h"
+#include "Operations.h"
#include "ResultType.h"
#include "SamplingTool.h"
diff --git a/Source/JavaScriptCore/jit/JITCall.cpp b/Source/JavaScriptCore/jit/JITCall.cpp
index c616f55..cdd7528 100644
--- a/Source/JavaScriptCore/jit/JITCall.cpp
+++ b/Source/JavaScriptCore/jit/JITCall.cpp
@@ -36,6 +36,7 @@
#include "JSArray.h"
#include "JSFunction.h"
#include "Interpreter.h"
+#include "Operations.h"
#include "RepatchBuffer.h"
#include "ResultType.h"
#include "SamplingTool.h"
diff --git a/Source/JavaScriptCore/jit/JITCall32_64.cpp b/Source/JavaScriptCore/jit/JITCall32_64.cpp
index a29f650..90395b2 100644
--- a/Source/JavaScriptCore/jit/JITCall32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITCall32_64.cpp
@@ -36,6 +36,7 @@
#include "JITStubCall.h"
#include "JSArray.h"
#include "JSFunction.h"
+#include "Operations.h"
#include "RepatchBuffer.h"
#include "ResultType.h"
#include "SamplingTool.h"
diff --git a/Source/JavaScriptCore/jit/JITCode.h b/Source/JavaScriptCore/jit/JITCode.h
index 89bbbcb..78ae8ae 100644
--- a/Source/JavaScriptCore/jit/JITCode.h
+++ b/Source/JavaScriptCore/jit/JITCode.h
@@ -28,8 +28,9 @@
#if ENABLE(JIT) || ENABLE(LLINT)
#include "CallFrame.h"
-#include "JSValue.h"
#include "Disassembler.h"
+#include "JITStubs.h"
+#include "JSValue.h"
#include "LegacyProfiler.h"
#include "MacroAssemblerCodeRef.h"
#endif
diff --git a/Source/JavaScriptCore/jit/JITExceptions.cpp b/Source/JavaScriptCore/jit/JITExceptions.cpp
index aeb8694..c48e09a 100644
--- a/Source/JavaScriptCore/jit/JITExceptions.cpp
+++ b/Source/JavaScriptCore/jit/JITExceptions.cpp
@@ -31,6 +31,7 @@
#include "Interpreter.h"
#include "JSGlobalData.h"
#include "JSValue.h"
+#include "Operations.h"
#if ENABLE(JIT) || ENABLE(LLINT)
diff --git a/Source/JavaScriptCore/jit/JITStubs.h b/Source/JavaScriptCore/jit/JITStubs.h
index 4920811..f7a30d4 100644
--- a/Source/JavaScriptCore/jit/JITStubs.h
+++ b/Source/JavaScriptCore/jit/JITStubs.h
@@ -36,8 +36,6 @@
#include "MacroAssemblerCodeRef.h"
#include "Register.h"
#include "ResolveOperation.h"
-#include "ThunkGenerators.h"
-#include <wtf/HashMap.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/jit/JITThunks.h b/Source/JavaScriptCore/jit/JITThunks.h
index 0f73809..10f74ea 100644
--- a/Source/JavaScriptCore/jit/JITThunks.h
+++ b/Source/JavaScriptCore/jit/JITThunks.h
@@ -34,10 +34,11 @@
#include "Intrinsic.h"
#include "LowLevelInterpreter.h"
#include "MacroAssemblerCodeRef.h"
-#include "Register.h"
-#include "ResolveOperation.h"
-#include "ThunkGenerators.h"
+#include "ThunkGenerator.h"
+#include "Weak.h"
#include <wtf/HashMap.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/RefPtr.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp
index dea9fd4..e243a78 100644
--- a/Source/JavaScriptCore/jsc.cpp
+++ b/Source/JavaScriptCore/jsc.cpp
@@ -36,6 +36,7 @@
#include "JSLock.h"
#include "JSProxy.h"
#include "JSString.h"
+#include "Operations.h"
#include "SamplingTool.h"
#include <math.h>
#include <stdio.h>
diff --git a/Source/JavaScriptCore/llint/LLIntExceptions.cpp b/Source/JavaScriptCore/llint/LLIntExceptions.cpp
index 17c15aa..0192070 100644
--- a/Source/JavaScriptCore/llint/LLIntExceptions.cpp
+++ b/Source/JavaScriptCore/llint/LLIntExceptions.cpp
@@ -34,6 +34,7 @@
#include "JITExceptions.h"
#include "LLIntCommon.h"
#include "LowLevelInterpreter.h"
+#include "Operations.h"
namespace JSC { namespace LLInt {
diff --git a/Source/JavaScriptCore/profiler/LegacyProfiler.cpp b/Source/JavaScriptCore/profiler/LegacyProfiler.cpp
index 0b66d48..22d4a42 100644
--- a/Source/JavaScriptCore/profiler/LegacyProfiler.cpp
+++ b/Source/JavaScriptCore/profiler/LegacyProfiler.cpp
@@ -36,6 +36,7 @@
#include "JSFunction.h"
#include "JSGlobalObject.h"
#include "Nodes.h"
+#include "Operations.h"
#include "Profile.h"
#include "ProfileGenerator.h"
#include "ProfileNode.h"
diff --git a/Source/JavaScriptCore/profiler/ProfileGenerator.cpp b/Source/JavaScriptCore/profiler/ProfileGenerator.cpp
index c3b1d25..d240aff 100644
--- a/Source/JavaScriptCore/profiler/ProfileGenerator.cpp
+++ b/Source/JavaScriptCore/profiler/ProfileGenerator.cpp
@@ -33,6 +33,7 @@
#include "JSFunction.h"
#include "Interpreter.h"
#include "LegacyProfiler.h"
+#include "Operations.h"
#include "Profile.h"
#include "Tracing.h"
diff --git a/Source/JavaScriptCore/profiler/ProfilerBytecode.cpp b/Source/JavaScriptCore/profiler/ProfilerBytecode.cpp
index 2bc99b9..3755a27 100644
--- a/Source/JavaScriptCore/profiler/ProfilerBytecode.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerBytecode.cpp
@@ -27,6 +27,7 @@
#include "ProfilerBytecode.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
namespace JSC { namespace Profiler {
diff --git a/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp b/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
index 49205b8..afd567b 100644
--- a/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
@@ -29,6 +29,7 @@
#include "CodeBlock.h"
#include "JSGlobalObject.h"
#include "Operands.h"
+#include "Operations.h"
#include <wtf/StringPrintStream.h>
namespace JSC { namespace Profiler {
diff --git a/Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp b/Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp
index d3156e3..481f4de 100644
--- a/Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp
@@ -28,6 +28,7 @@
#include "CodeBlock.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
#include <wtf/StringPrintStream.h>
namespace JSC { namespace Profiler {
diff --git a/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp b/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp
index 743f63e..c70152c 100644
--- a/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp
@@ -27,6 +27,7 @@
#include "ProfilerCompilation.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
#include "ProfilerDatabase.h"
#include <wtf/StringPrintStream.h>
diff --git a/Source/JavaScriptCore/profiler/ProfilerCompiledBytecode.cpp b/Source/JavaScriptCore/profiler/ProfilerCompiledBytecode.cpp
index 01902f1..b8f5a85 100644
--- a/Source/JavaScriptCore/profiler/ProfilerCompiledBytecode.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerCompiledBytecode.cpp
@@ -27,6 +27,7 @@
#include "ProfilerCompiledBytecode.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
namespace JSC { namespace Profiler {
diff --git a/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp b/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp
index 0d07894..c4a334d 100644
--- a/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp
@@ -28,6 +28,7 @@
#include "CodeBlock.h"
#include "JSONObject.h"
+#include "Operations.h"
namespace JSC { namespace Profiler {
diff --git a/Source/JavaScriptCore/profiler/ProfilerOSRExit.cpp b/Source/JavaScriptCore/profiler/ProfilerOSRExit.cpp
index da0398d..5fe13f7 100644
--- a/Source/JavaScriptCore/profiler/ProfilerOSRExit.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerOSRExit.cpp
@@ -27,6 +27,7 @@
#include "ProfilerOSRExit.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
namespace JSC { namespace Profiler {
diff --git a/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp b/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp
index da0849c..d54f7a2 100644
--- a/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp
@@ -29,6 +29,7 @@
#include "JSGlobalObject.h"
#include "JSScope.h"
#include "JSString.h"
+#include "Operations.h"
#include <wtf/StringPrintStream.h>
namespace JSC { namespace Profiler {
diff --git a/Source/JavaScriptCore/profiler/ProfilerOrigin.cpp b/Source/JavaScriptCore/profiler/ProfilerOrigin.cpp
index 449869a..ffbcf28 100644
--- a/Source/JavaScriptCore/profiler/ProfilerOrigin.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerOrigin.cpp
@@ -27,6 +27,7 @@
#include "ProfilerOrigin.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
#include "ProfilerBytecodes.h"
#include "ProfilerDatabase.h"
diff --git a/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp b/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp
index 66d9e02..018ceeb 100644
--- a/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp
@@ -28,6 +28,7 @@
#include "CodeOrigin.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
#include "ProfilerDatabase.h"
namespace JSC { namespace Profiler {
diff --git a/Source/JavaScriptCore/profiler/ProfilerProfiledBytecodes.cpp b/Source/JavaScriptCore/profiler/ProfilerProfiledBytecodes.cpp
index ac9f650..d072e4f 100644
--- a/Source/JavaScriptCore/profiler/ProfilerProfiledBytecodes.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerProfiledBytecodes.cpp
@@ -27,6 +27,7 @@
#include "ProfilerProfiledBytecodes.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
namespace JSC { namespace Profiler {
diff --git a/Source/JavaScriptCore/runtime/ArgList.cpp b/Source/JavaScriptCore/runtime/ArgList.cpp
index 301abd5..194e515 100644
--- a/Source/JavaScriptCore/runtime/ArgList.cpp
+++ b/Source/JavaScriptCore/runtime/ArgList.cpp
@@ -24,7 +24,7 @@
#include "HeapRootVisitor.h"
#include "JSValue.h"
#include "JSObject.h"
-
+#include "Operations.h"
using std::min;
diff --git a/Source/JavaScriptCore/runtime/Arguments.cpp b/Source/JavaScriptCore/runtime/Arguments.cpp
index ba73b2c..1b7c7e0 100644
--- a/Source/JavaScriptCore/runtime/Arguments.cpp
+++ b/Source/JavaScriptCore/runtime/Arguments.cpp
@@ -28,6 +28,7 @@
#include "JSActivation.h"
#include "JSFunction.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
using namespace std;
diff --git a/Source/JavaScriptCore/runtime/ArrayConstructor.cpp b/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
index a3fce45..9aa8c1a 100644
--- a/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
@@ -32,6 +32,7 @@
#include "JSArray.h"
#include "JSFunction.h"
#include "Lookup.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/BooleanConstructor.cpp b/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
index 0485350..d638a92 100644
--- a/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
@@ -23,6 +23,7 @@
#include "BooleanPrototype.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/BooleanObject.cpp b/Source/JavaScriptCore/runtime/BooleanObject.cpp
index 3559938..100047d 100644
--- a/Source/JavaScriptCore/runtime/BooleanObject.cpp
+++ b/Source/JavaScriptCore/runtime/BooleanObject.cpp
@@ -22,6 +22,7 @@
#include "BooleanObject.h"
#include "JSScope.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/BooleanPrototype.cpp b/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
index 94507f9..5bf48a5 100644
--- a/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
@@ -26,6 +26,7 @@
#include "JSFunction.h"
#include "JSString.h"
#include "ObjectPrototype.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/CallData.cpp b/Source/JavaScriptCore/runtime/CallData.cpp
index ff71fa0..8e1d194 100644
--- a/Source/JavaScriptCore/runtime/CallData.cpp
+++ b/Source/JavaScriptCore/runtime/CallData.cpp
@@ -29,6 +29,7 @@
#include "Executable.h"
#include "Interpreter.h"
#include "JSFunction.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/CodeCache.cpp b/Source/JavaScriptCore/runtime/CodeCache.cpp
index e25e3e2..f125175 100644
--- a/Source/JavaScriptCore/runtime/CodeCache.cpp
+++ b/Source/JavaScriptCore/runtime/CodeCache.cpp
@@ -29,6 +29,7 @@
#include "BytecodeGenerator.h"
#include "CodeSpecializationKind.h"
+#include "Operations.h"
#include "Parser.h"
#include "StrongInlines.h"
#include "UnlinkedCodeBlock.h"
diff --git a/Source/JavaScriptCore/runtime/Completion.cpp b/Source/JavaScriptCore/runtime/Completion.cpp
index 3de8d48..e354549 100644
--- a/Source/JavaScriptCore/runtime/Completion.cpp
+++ b/Source/JavaScriptCore/runtime/Completion.cpp
@@ -25,11 +25,12 @@
#include "CallFrame.h"
#include "CodeProfiling.h"
+#include "Debugger.h"
+#include "Interpreter.h"
#include "JSGlobalObject.h"
#include "JSLock.h"
-#include "Interpreter.h"
+#include "Operations.h"
#include "Parser.h"
-#include "Debugger.h"
#include <wtf/WTFThreadData.h>
#include <stdio.h>
diff --git a/Source/JavaScriptCore/runtime/ConstructData.cpp b/Source/JavaScriptCore/runtime/ConstructData.cpp
index 5da2a91..3dc4618 100644
--- a/Source/JavaScriptCore/runtime/ConstructData.cpp
+++ b/Source/JavaScriptCore/runtime/ConstructData.cpp
@@ -30,6 +30,7 @@
#include "Interpreter.h"
#include "JSFunction.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/DateConstructor.cpp b/Source/JavaScriptCore/runtime/DateConstructor.cpp
index 9a162e9..6c8ae887 100644
--- a/Source/JavaScriptCore/runtime/DateConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/DateConstructor.cpp
@@ -30,6 +30,7 @@
#include "JSGlobalObject.h"
#include "JSString.h"
#include "JSStringBuilder.h"
+#include "JSValueInlines.h"
#include "ObjectPrototype.h"
#include <math.h>
#include <time.h>
diff --git a/Source/JavaScriptCore/runtime/DateInstance.cpp b/Source/JavaScriptCore/runtime/DateInstance.cpp
index 47a19df..bde416e 100644
--- a/Source/JavaScriptCore/runtime/DateInstance.cpp
+++ b/Source/JavaScriptCore/runtime/DateInstance.cpp
@@ -24,7 +24,7 @@
#include "JSDateMath.h"
#include "JSGlobalObject.h"
-
+#include "JSValueInlines.h"
#include <math.h>
#include <wtf/MathExtras.h>
diff --git a/Source/JavaScriptCore/runtime/DatePrototype.cpp b/Source/JavaScriptCore/runtime/DatePrototype.cpp
index 75da466..52d77e9 100644
--- a/Source/JavaScriptCore/runtime/DatePrototype.cpp
+++ b/Source/JavaScriptCore/runtime/DatePrototype.cpp
@@ -31,6 +31,7 @@
#include "JSGlobalObject.h"
#include "JSString.h"
#include "JSStringBuilder.h"
+#include "JSValueInlines.h"
#include "Lookup.h"
#include "ObjectPrototype.h"
diff --git a/Source/JavaScriptCore/runtime/Error.cpp b/Source/JavaScriptCore/runtime/Error.cpp
index 68ae12d..6855844 100644
--- a/Source/JavaScriptCore/runtime/Error.cpp
+++ b/Source/JavaScriptCore/runtime/Error.cpp
@@ -34,6 +34,7 @@
#include "JSObject.h"
#include "JSString.h"
#include "NativeErrorConstructor.h"
+#include "Operations.h"
#include "SourceCode.h"
#include <wtf/text/StringBuilder.h>
diff --git a/Source/JavaScriptCore/runtime/ErrorConstructor.cpp b/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
index f2578a4..0023196 100644
--- a/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
@@ -24,6 +24,7 @@
#include "ErrorPrototype.h"
#include "JSGlobalObject.h"
#include "JSString.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/ErrorInstance.cpp b/Source/JavaScriptCore/runtime/ErrorInstance.cpp
index 9c0fe3e..f2f1d58 100644
--- a/Source/JavaScriptCore/runtime/ErrorInstance.cpp
+++ b/Source/JavaScriptCore/runtime/ErrorInstance.cpp
@@ -22,6 +22,7 @@
#include "ErrorInstance.h"
#include "JSScope.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/ErrorPrototype.cpp b/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
index a30efdc..62a4d8c 100644
--- a/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
@@ -26,6 +26,7 @@
#include "JSString.h"
#include "JSStringBuilder.h"
#include "ObjectPrototype.h"
+#include "Operations.h"
#include "StringRecursionChecker.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp b/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
index a4368a2..0dd4f07 100644
--- a/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
+++ b/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
@@ -37,6 +37,7 @@
#include "JSNotAnObject.h"
#include "Interpreter.h"
#include "Nodes.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/Executable.cpp b/Source/JavaScriptCore/runtime/Executable.cpp
index 52c9c39..99b770d 100644
--- a/Source/JavaScriptCore/runtime/Executable.cpp
+++ b/Source/JavaScriptCore/runtime/Executable.cpp
@@ -33,6 +33,7 @@
#include "ExecutionHarness.h"
#include "JIT.h"
#include "JITDriver.h"
+#include "Operations.h"
#include "Parser.h"
#include <wtf/Vector.h>
#include <wtf/text/StringBuilder.h>
diff --git a/Source/JavaScriptCore/runtime/FunctionConstructor.cpp b/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
index bf74c0a..ad95a2c 100644
--- a/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
@@ -29,6 +29,7 @@
#include "JSString.h"
#include "Lexer.h"
#include "Nodes.h"
+#include "Operations.h"
#include "Parser.h"
#include <wtf/text/StringBuilder.h>
diff --git a/Source/JavaScriptCore/runtime/FunctionPrototype.cpp b/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
index 8e4390b..58b81c3 100644
--- a/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
@@ -29,6 +29,7 @@
#include "JSStringBuilder.h"
#include "Interpreter.h"
#include "Lexer.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/GetterSetter.cpp b/Source/JavaScriptCore/runtime/GetterSetter.cpp
index 8ed5825..b465114 100644
--- a/Source/JavaScriptCore/runtime/GetterSetter.cpp
+++ b/Source/JavaScriptCore/runtime/GetterSetter.cpp
@@ -24,6 +24,7 @@
#include "GetterSetter.h"
#include "JSObject.h"
+#include "Operations.h"
#include <wtf/Assertions.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/Identifier.cpp b/Source/JavaScriptCore/runtime/Identifier.cpp
index 583c12b..b8350f7 100644
--- a/Source/JavaScriptCore/runtime/Identifier.cpp
+++ b/Source/JavaScriptCore/runtime/Identifier.cpp
@@ -25,6 +25,7 @@
#include "JSObject.h"
#include "JSScope.h"
#include "NumericStrings.h"
+#include "Operations.h"
#include <new>
#include <string.h>
#include <wtf/Assertions.h>
diff --git a/Source/JavaScriptCore/runtime/InternalFunction.cpp b/Source/JavaScriptCore/runtime/InternalFunction.cpp
index afb5e63..5b9e099 100644
--- a/Source/JavaScriptCore/runtime/InternalFunction.cpp
+++ b/Source/JavaScriptCore/runtime/InternalFunction.cpp
@@ -26,6 +26,7 @@
#include "FunctionPrototype.h"
#include "JSGlobalObject.h"
#include "JSString.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/JSActivation.cpp b/Source/JavaScriptCore/runtime/JSActivation.cpp
index 46e4609..6f7ca67 100644
--- a/Source/JavaScriptCore/runtime/JSActivation.cpp
+++ b/Source/JavaScriptCore/runtime/JSActivation.cpp
@@ -32,6 +32,7 @@
#include "Arguments.h"
#include "Interpreter.h"
#include "JSFunction.h"
+#include "Operations.h"
using namespace std;
diff --git a/Source/JavaScriptCore/runtime/JSBoundFunction.cpp b/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
index bb1af9d..0aafe1f 100644
--- a/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
+++ b/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
@@ -28,6 +28,7 @@
#include "GetterSetter.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/JSCell.cpp b/Source/JavaScriptCore/runtime/JSCell.cpp
index f6f4d71..71bb3c4 100644
--- a/Source/JavaScriptCore/runtime/JSCell.cpp
+++ b/Source/JavaScriptCore/runtime/JSCell.cpp
@@ -27,6 +27,7 @@
#include "JSString.h"
#include "JSObject.h"
#include "NumberObject.h"
+#include "Operations.h"
#include <wtf/MathExtras.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/JSCell.h b/Source/JavaScriptCore/runtime/JSCell.h
index b28fedd..9f9356e 100644
--- a/Source/JavaScriptCore/runtime/JSCell.h
+++ b/Source/JavaScriptCore/runtime/JSCell.h
@@ -24,11 +24,9 @@
#define JSCell_h
#include "CallData.h"
-#include "CallFrame.h"
#include "ConstructData.h"
#include "Heap.h"
#include "JSLock.h"
-#include "JSValueInlines.h"
#include "SlotVisitor.h"
#include "TypedArrayDescriptor.h"
#include "WriteBarrier.h"
@@ -38,6 +36,7 @@
namespace JSC {
class CopyVisitor;
+class ExecState;
class JSDestructibleObject;
class JSGlobalObject;
class LLIntOffsetsExtractor;
@@ -165,174 +164,6 @@
WriteBarrier<Structure> m_structure;
};
-inline JSCell::JSCell(CreatingEarlyCellTag)
-{
-}
-
-inline void JSCell::finishCreation(JSGlobalData& globalData)
-{
-#if ENABLE(GC_VALIDATION)
- ASSERT(globalData.isInitializingObject());
- globalData.setInitializingObjectClass(0);
-#else
- UNUSED_PARAM(globalData);
-#endif
- ASSERT(m_structure);
-}
-
-inline Structure* JSCell::structure() const
-{
- return m_structure.get();
-}
-
-inline void JSCell::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
- MARK_LOG_PARENT(visitor, cell);
-
- visitor.append(&cell->m_structure);
-}
-
-// --- JSValue inlines ----------------------------
-
-inline bool JSValue::isString() const
-{
- return isCell() && asCell()->isString();
-}
-
-inline bool JSValue::isPrimitive() const
-{
- return !isCell() || asCell()->isString();
-}
-
-inline bool JSValue::isGetterSetter() const
-{
- return isCell() && asCell()->isGetterSetter();
-}
-
-inline bool JSValue::isObject() const
-{
- return isCell() && asCell()->isObject();
-}
-
-inline bool JSValue::getString(ExecState* exec, String& s) const
-{
- return isCell() && asCell()->getString(exec, s);
-}
-
-inline String JSValue::getString(ExecState* exec) const
-{
- return isCell() ? asCell()->getString(exec) : String();
-}
-
-template <typename Base> String HandleConverter<Base, Unknown>::getString(ExecState* exec) const
-{
- return jsValue().getString(exec);
-}
-
-inline JSObject* JSValue::getObject() const
-{
- return isCell() ? asCell()->getObject() : 0;
-}
-
-ALWAYS_INLINE bool JSValue::getUInt32(uint32_t& v) const
-{
- if (isInt32()) {
- int32_t i = asInt32();
- v = static_cast<uint32_t>(i);
- return i >= 0;
- }
- if (isDouble()) {
- double d = asDouble();
- v = static_cast<uint32_t>(d);
- return v == d;
- }
- return false;
-}
-
-inline JSValue JSValue::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredType) const
-{
- return isCell() ? asCell()->toPrimitive(exec, preferredType) : asValue();
-}
-
-inline bool JSValue::getPrimitiveNumber(ExecState* exec, double& number, JSValue& value)
-{
- if (isInt32()) {
- number = asInt32();
- value = *this;
- return true;
- }
- if (isDouble()) {
- number = asDouble();
- value = *this;
- return true;
- }
- if (isCell())
- return asCell()->getPrimitiveNumber(exec, number, value);
- if (isTrue()) {
- number = 1.0;
- value = *this;
- return true;
- }
- if (isFalse() || isNull()) {
- number = 0.0;
- value = *this;
- return true;
- }
- ASSERT(isUndefined());
- number = QNaN;
- value = *this;
- return true;
-}
-
-ALWAYS_INLINE double JSValue::toNumber(ExecState* exec) const
-{
- if (isInt32())
- return asInt32();
- if (isDouble())
- return asDouble();
- return toNumberSlowCase(exec);
-}
-
-inline JSObject* JSValue::toObject(ExecState* exec) const
-{
- return isCell() ? asCell()->toObject(exec, exec->lexicalGlobalObject()) : toObjectSlowCase(exec, exec->lexicalGlobalObject());
-}
-
-inline JSObject* JSValue::toObject(ExecState* exec, JSGlobalObject* globalObject) const
-{
- return isCell() ? asCell()->toObject(exec, globalObject) : toObjectSlowCase(exec, globalObject);
-}
-
-template<typename T>
-void* allocateCell(Heap& heap, size_t size)
-{
- ASSERT(size >= sizeof(T));
-#if ENABLE(GC_VALIDATION)
- ASSERT(!heap.globalData()->isInitializingObject());
- heap.globalData()->setInitializingObjectClass(&T::s_info);
-#endif
- JSCell* result = 0;
- if (T::needsDestruction && T::hasImmortalStructure)
- result = static_cast<JSCell*>(heap.allocateWithImmortalStructureDestructor(size));
- else if (T::needsDestruction && !T::hasImmortalStructure)
- result = static_cast<JSCell*>(heap.allocateWithNormalDestructor(size));
- else
- result = static_cast<JSCell*>(heap.allocateWithoutDestructor(size));
- result->clearStructure();
- return result;
-}
-
-template<typename T>
-void* allocateCell(Heap& heap)
-{
- return allocateCell<T>(heap, sizeof(T));
-}
-
-inline bool isZapped(const JSCell* cell)
-{
- return cell->isZapped();
-}
-
template<typename To, typename From>
inline To jsCast(From* from)
{
diff --git a/Source/JavaScriptCore/runtime/JSCellInlines.h b/Source/JavaScriptCore/runtime/JSCellInlines.h
new file mode 100644
index 0000000..2614e55a
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/JSCellInlines.h
@@ -0,0 +1,181 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "CallFrame.h"
+#include "JSCell.h"
+
+namespace JSC {
+
+inline JSCell::JSCell(CreatingEarlyCellTag)
+{
+}
+
+inline JSCell::JSCell(JSGlobalData& globalData, Structure* structure)
+ : m_structure(globalData, this, structure)
+{
+}
+
+inline void JSCell::finishCreation(JSGlobalData& globalData)
+{
+#if ENABLE(GC_VALIDATION)
+ ASSERT(globalData.isInitializingObject());
+ globalData.setInitializingObjectClass(0);
+#else
+ UNUSED_PARAM(globalData);
+#endif
+ ASSERT(m_structure);
+}
+
+inline void JSCell::finishCreation(JSGlobalData& globalData, Structure* structure, CreatingEarlyCellTag)
+{
+#if ENABLE(GC_VALIDATION)
+ ASSERT(globalData.isInitializingObject());
+ globalData.setInitializingObjectClass(0);
+ if (structure)
+#endif
+ m_structure.setEarlyValue(globalData, this, structure);
+ // Very first set of allocations won't have a real structure.
+ ASSERT(m_structure || !globalData.structureStructure);
+}
+
+inline Structure* JSCell::structure() const
+{
+ return m_structure.get();
+}
+
+inline void JSCell::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+ MARK_LOG_PARENT(visitor, cell);
+
+ visitor.append(&cell->m_structure);
+}
+
+template<typename T>
+void* allocateCell(Heap& heap, size_t size)
+{
+ ASSERT(size >= sizeof(T));
+#if ENABLE(GC_VALIDATION)
+ ASSERT(!heap.globalData()->isInitializingObject());
+ heap.globalData()->setInitializingObjectClass(&T::s_info);
+#endif
+ JSCell* result = 0;
+ if (T::needsDestruction && T::hasImmortalStructure)
+ result = static_cast<JSCell*>(heap.allocateWithImmortalStructureDestructor(size));
+ else if (T::needsDestruction && !T::hasImmortalStructure)
+ result = static_cast<JSCell*>(heap.allocateWithNormalDestructor(size));
+ else
+ result = static_cast<JSCell*>(heap.allocateWithoutDestructor(size));
+ result->clearStructure();
+ return result;
+}
+
+template<typename T>
+void* allocateCell(Heap& heap)
+{
+ return allocateCell<T>(heap, sizeof(T));
+}
+
+inline bool isZapped(const JSCell* cell)
+{
+ return cell->isZapped();
+}
+
+inline bool JSCell::isObject() const
+{
+ return m_structure->isObject();
+}
+
+inline bool JSCell::isString() const
+{
+ return m_structure->typeInfo().type() == StringType;
+}
+
+inline bool JSCell::isGetterSetter() const
+{
+ return m_structure->typeInfo().type() == GetterSetterType;
+}
+
+inline bool JSCell::isProxy() const
+{
+ return structure()->typeInfo().type() == ProxyType;
+}
+
+inline bool JSCell::isAPIValueWrapper() const
+{
+ return m_structure->typeInfo().type() == APIValueWrapperType;
+}
+
+inline void JSCell::setStructure(JSGlobalData& globalData, Structure* structure)
+{
+ ASSERT(structure->typeInfo().overridesVisitChildren() == this->structure()->typeInfo().overridesVisitChildren());
+ ASSERT(structure->classInfo() == m_structure->classInfo());
+ ASSERT(!m_structure
+ || m_structure->transitionWatchpointSetHasBeenInvalidated()
+ || m_structure.get() == structure);
+ m_structure.set(globalData, this, structure);
+}
+
+inline const MethodTable* JSCell::methodTable() const
+{
+ return &classInfo()->methodTable;
+}
+
+inline bool JSCell::inherits(const ClassInfo* info) const
+{
+ return classInfo()->isSubClassOf(info);
+}
+
+ALWAYS_INLINE bool JSCell::fastGetOwnPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
+{
+ if (!structure()->typeInfo().overridesGetOwnPropertySlot())
+ return asObject(this)->inlineGetOwnPropertySlot(exec, propertyName, slot);
+ return methodTable()->getOwnPropertySlot(this, exec, propertyName, slot);
+}
+
+// Fast call to get a property where we may not yet have converted the string to an
+// identifier. The first time we perform a property access with a given string, try
+// performing the property map lookup without forming an identifier. We detect this
+// case by checking whether the hash has yet been set for this string.
+ALWAYS_INLINE JSValue JSCell::fastGetOwnProperty(ExecState* exec, const String& name)
+{
+ if (!structure()->typeInfo().overridesGetOwnPropertySlot() && !structure()->hasGetterSetterProperties()) {
+ PropertyOffset offset = name.impl()->hasHash()
+ ? structure()->get(exec->globalData(), Identifier(exec, name))
+ : structure()->get(exec->globalData(), name);
+ if (offset != invalidOffset)
+ return asObject(this)->locationForOffset(offset)->get();
+ }
+ return JSValue();
+}
+
+inline bool JSCell::toBoolean(ExecState* exec) const
+{
+ if (isString())
+ return static_cast<const JSString*>(this)->toBoolean();
+ return !structure()->masqueradesAsUndefined(exec->lexicalGlobalObject());
+}
+
+} // namespace JSC
+
diff --git a/Source/JavaScriptCore/runtime/JSDateMath.cpp b/Source/JavaScriptCore/runtime/JSDateMath.cpp
index cd3948f..4e658bc 100644
--- a/Source/JavaScriptCore/runtime/JSDateMath.cpp
+++ b/Source/JavaScriptCore/runtime/JSDateMath.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
* Copyright (C) 2007-2009 Torch Mobile, Inc.
* Copyright (C) 2010 &yet, LLC. (nate@andyet.net)
@@ -74,6 +74,7 @@
#include "JSObject.h"
#include "JSScope.h"
+#include "Operations.h"
#include <algorithm>
#include <limits.h>
diff --git a/Source/JavaScriptCore/runtime/JSFunction.cpp b/Source/JavaScriptCore/runtime/JSFunction.cpp
index 810abdd..01d7003 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.cpp
+++ b/Source/JavaScriptCore/runtime/JSFunction.cpp
@@ -36,6 +36,7 @@
#include "JSNotAnObject.h"
#include "Interpreter.h"
#include "ObjectPrototype.h"
+#include "Operations.h"
#include "Parser.h"
#include "PropertyNameArray.h"
diff --git a/Source/JavaScriptCore/runtime/JSFunction.h b/Source/JavaScriptCore/runtime/JSFunction.h
index 322ee58..b36e0b7 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.h
+++ b/Source/JavaScriptCore/runtime/JSFunction.h
@@ -191,11 +191,6 @@
InlineWatchpointSet m_inheritorIDWatchpoint;
};
- inline bool JSValue::isFunction() const
- {
- return isCell() && (asCell()->inherits(&JSFunction::s_info) || asCell()->inherits(&InternalFunction::s_info));
- }
-
} // namespace JSC
#endif // JSFunction_h
diff --git a/Source/JavaScriptCore/runtime/JSGlobalData.h b/Source/JavaScriptCore/runtime/JSGlobalData.h
index 261557a..9e507f7 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalData.h
+++ b/Source/JavaScriptCore/runtime/JSGlobalData.h
@@ -34,7 +34,7 @@
#include "ExecutableAllocator.h"
#include "Heap.h"
#include "Intrinsic.h"
-#include "JITStubs.h"
+#include "JITThunks.h"
#include "JITThunks.h"
#include "JSLock.h"
#include "JSValue.h"
@@ -45,6 +45,7 @@
#include "SmallStrings.h"
#include "Strong.h"
#include "Terminator.h"
+#include "ThunkGenerators.h"
#include "TimeoutChecker.h"
#include "TypedArrayDescriptor.h"
#include "WeakRandom.h"
@@ -67,6 +68,7 @@
class CodeBlock;
class CodeCache;
class CommonIdentifiers;
+ class ExecState;
class HandleStack;
class IdentifierTable;
class Interpreter;
@@ -189,7 +191,7 @@
GlobalDataType globalDataType;
ClientData* clientData;
- CallFrame* topCallFrame;
+ ExecState* topCallFrame;
const HashTable* arrayConstructorTable;
const HashTable* arrayPrototypeTable;
@@ -309,7 +311,7 @@
ReturnAddressPtr exceptionLocation;
JSValue hostCallReturnValue;
- CallFrame* callFrameForThrow;
+ ExecState* callFrameForThrow;
void* targetMachinePCForThrow;
Instruction* targetInterpreterPCForThrow;
#if ENABLE(DFG_JIT)
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
index 7775544..c8b10f4 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -57,6 +57,7 @@
#include "JSLock.h"
#include "JSNameScope.h"
#include "JSONObject.h"
+#include "JSValueInlines.h"
#include "JSWithScope.h"
#include "LegacyProfiler.h"
#include "Lookup.h"
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
index 1010ad2..bcfb04f 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
@@ -34,6 +34,7 @@
#include "Lexer.h"
#include "LiteralParser.h"
#include "Nodes.h"
+#include "Operations.h"
#include "Parser.h"
#include <wtf/dtoa.h>
#include <stdio.h>
diff --git a/Source/JavaScriptCore/runtime/JSLock.cpp b/Source/JavaScriptCore/runtime/JSLock.cpp
index 5e3d12c..971833e 100644
--- a/Source/JavaScriptCore/runtime/JSLock.cpp
+++ b/Source/JavaScriptCore/runtime/JSLock.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2008, 2012 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -25,7 +25,7 @@
#include "CallFrame.h"
#include "JSGlobalObject.h"
#include "JSObject.h"
-
+#include "Operations.h"
#if USE(PTHREADS)
#include <pthread.h>
diff --git a/Source/JavaScriptCore/runtime/JSNameScope.cpp b/Source/JavaScriptCore/runtime/JSNameScope.cpp
index 335631f..0ee191a 100644
--- a/Source/JavaScriptCore/runtime/JSNameScope.cpp
+++ b/Source/JavaScriptCore/runtime/JSNameScope.cpp
@@ -27,6 +27,7 @@
#include "JSNameScope.h"
#include "Error.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/JSNotAnObject.cpp b/Source/JavaScriptCore/runtime/JSNotAnObject.cpp
index 53592ba..29c8e5c 100644
--- a/Source/JavaScriptCore/runtime/JSNotAnObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSNotAnObject.cpp
@@ -30,6 +30,7 @@
#include "config.h"
#include "JSNotAnObject.h"
+#include "Operations.h"
#include <wtf/UnusedParam.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/JSONObject.cpp b/Source/JavaScriptCore/runtime/JSONObject.cpp
index e051ec7..0b501334 100644
--- a/Source/JavaScriptCore/runtime/JSONObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSONObject.cpp
@@ -35,6 +35,7 @@
#include "Local.h"
#include "LocalScope.h"
#include "Lookup.h"
+#include "Operations.h"
#include "PropertyNameArray.h"
#include <wtf/MathExtras.h>
#include <wtf/text/StringBuilder.h>
diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h
index 5af8b0b..83dd696 100644
--- a/Source/JavaScriptCore/runtime/JSObject.h
+++ b/Source/JavaScriptCore/runtime/JSObject.h
@@ -1152,27 +1152,6 @@
return structure()->storedPrototype();
}
-inline const MethodTable* JSCell::methodTable() const
-{
- return &classInfo()->methodTable;
-}
-
-inline bool JSCell::inherits(const ClassInfo* info) const
-{
- return classInfo()->isSubClassOf(info);
-}
-
-// this method is here to be after the inline declaration of JSCell::inherits
-inline bool JSValue::inherits(const ClassInfo* classInfo) const
-{
- return isCell() && asCell()->inherits(classInfo);
-}
-
-inline JSObject* JSValue::toThisObject(ExecState* exec) const
-{
- return isCell() ? asCell()->methodTable()->toThisObject(asCell(), exec) : toThisObjectSlowCase(exec);
-}
-
ALWAYS_INLINE bool JSObject::inlineGetOwnPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
PropertyOffset offset = structure()->get(exec->globalData(), propertyName);
@@ -1196,29 +1175,6 @@
return jsCast<JSObject*>(cell)->inlineGetOwnPropertySlot(exec, propertyName, slot);
}
-ALWAYS_INLINE bool JSCell::fastGetOwnPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
-{
- if (!structure()->typeInfo().overridesGetOwnPropertySlot())
- return asObject(this)->inlineGetOwnPropertySlot(exec, propertyName, slot);
- return methodTable()->getOwnPropertySlot(this, exec, propertyName, slot);
-}
-
-// Fast call to get a property where we may not yet have converted the string to an
-// identifier. The first time we perform a property access with a given string, try
-// performing the property map lookup without forming an identifier. We detect this
-// case by checking whether the hash has yet been set for this string.
-ALWAYS_INLINE JSValue JSCell::fastGetOwnProperty(ExecState* exec, const String& name)
-{
- if (!structure()->typeInfo().overridesGetOwnPropertySlot() && !structure()->hasGetterSetterProperties()) {
- PropertyOffset offset = name.impl()->hasHash()
- ? structure()->get(exec->globalData(), Identifier(exec, name))
- : structure()->get(exec->globalData(), name);
- if (offset != invalidOffset)
- return asObject(this)->locationForOffset(offset)->get();
- }
- return JSValue();
-}
-
// It may seem crazy to inline a function this large but it makes a big difference
// since this is function very hot in variable lookup
ALWAYS_INLINE bool JSObject::getPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
@@ -1444,74 +1400,6 @@
return methodTable()->defaultValue(this, exec, preferredType);
}
-inline JSValue JSValue::get(ExecState* exec, PropertyName propertyName) const
-{
- PropertySlot slot(asValue());
- return get(exec, propertyName, slot);
-}
-
-inline JSValue JSValue::get(ExecState* exec, PropertyName propertyName, PropertySlot& slot) const
-{
- if (UNLIKELY(!isCell())) {
- JSObject* prototype = synthesizePrototype(exec);
- if (!prototype->getPropertySlot(exec, propertyName, slot))
- return jsUndefined();
- return slot.getValue(exec, propertyName);
- }
- JSCell* cell = asCell();
- while (true) {
- if (cell->fastGetOwnPropertySlot(exec, propertyName, slot))
- return slot.getValue(exec, propertyName);
- JSValue prototype = asObject(cell)->prototype();
- if (!prototype.isObject())
- return jsUndefined();
- cell = asObject(prototype);
- }
-}
-
-inline JSValue JSValue::get(ExecState* exec, unsigned propertyName) const
-{
- PropertySlot slot(asValue());
- return get(exec, propertyName, slot);
-}
-
-inline JSValue JSValue::get(ExecState* exec, unsigned propertyName, PropertySlot& slot) const
-{
- if (UNLIKELY(!isCell())) {
- JSObject* prototype = synthesizePrototype(exec);
- if (!prototype->getPropertySlot(exec, propertyName, slot))
- return jsUndefined();
- return slot.getValue(exec, propertyName);
- }
- JSCell* cell = const_cast<JSCell*>(asCell());
- while (true) {
- if (cell->methodTable()->getOwnPropertySlotByIndex(cell, exec, propertyName, slot))
- return slot.getValue(exec, propertyName);
- JSValue prototype = asObject(cell)->prototype();
- if (!prototype.isObject())
- return jsUndefined();
- cell = prototype.asCell();
- }
-}
-
-inline void JSValue::put(ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
-{
- if (UNLIKELY(!isCell())) {
- putToPrimitive(exec, propertyName, value, slot);
- return;
- }
- asCell()->methodTable()->put(asCell(), exec, propertyName, value, slot);
-}
-
-inline void JSValue::putByIndex(ExecState* exec, unsigned propertyName, JSValue value, bool shouldThrow)
-{
- if (UNLIKELY(!isCell())) {
- putToPrimitiveByIndex(exec, propertyName, value, shouldThrow);
- return;
- }
- asCell()->methodTable()->putByIndex(asCell(), exec, propertyName, value, shouldThrow);
-}
-
ALWAYS_INLINE JSObject* Register::function() const
{
if (!jsValue())
diff --git a/Source/JavaScriptCore/runtime/JSProxy.cpp b/Source/JavaScriptCore/runtime/JSProxy.cpp
index 7108dcf..86300ba 100644
--- a/Source/JavaScriptCore/runtime/JSProxy.cpp
+++ b/Source/JavaScriptCore/runtime/JSProxy.cpp
@@ -27,6 +27,7 @@
#include "JSProxy.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/JSScope.cpp b/Source/JavaScriptCore/runtime/JSScope.cpp
index 685009b..b9c7b2a 100644
--- a/Source/JavaScriptCore/runtime/JSScope.cpp
+++ b/Source/JavaScriptCore/runtime/JSScope.cpp
@@ -30,6 +30,7 @@
#include "JSGlobalObject.h"
#include "JSNameScope.h"
#include "JSWithScope.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp b/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp
index c65d2b1..01c0704 100644
--- a/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp
@@ -29,6 +29,8 @@
#include "config.h"
#include "JSSegmentedVariableObject.h"
+#include "Operations.h"
+
namespace JSC {
int JSSegmentedVariableObject::findRegisterIndex(void* registerAddress)
diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h
index c4ea552..1f9693b 100644
--- a/Source/JavaScriptCore/runtime/JSString.h
+++ b/Source/JavaScriptCore/runtime/JSString.h
@@ -491,13 +491,6 @@
inline bool isJSString(JSValue v) { return v.isCell() && v.asCell()->classInfo() == &JSString::s_info; }
- inline bool JSCell::toBoolean(ExecState* exec) const
- {
- if (isString())
- return static_cast<const JSString*>(this)->toBoolean();
- return !structure()->masqueradesAsUndefined(exec->lexicalGlobalObject());
- }
-
// --- JSValue inlines ----------------------------
inline bool JSValue::toBoolean(ExecState* exec) const
diff --git a/Source/JavaScriptCore/runtime/JSStringJoiner.cpp b/Source/JavaScriptCore/runtime/JSStringJoiner.cpp
index cbf9ba4..5b1f28d 100644
--- a/Source/JavaScriptCore/runtime/JSStringJoiner.cpp
+++ b/Source/JavaScriptCore/runtime/JSStringJoiner.cpp
@@ -29,9 +29,9 @@
#include "ExceptionHelpers.h"
#include "JSScope.h"
#include "JSString.h"
+#include "Operations.h"
#include <wtf/text/StringImpl.h>
-
namespace JSC {
// The destination is 16bits, at least one string is 16 bits.
diff --git a/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp b/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp
index 7dcde47..b641c58 100644
--- a/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp
@@ -32,6 +32,7 @@
#include "JSActivation.h"
#include "JSGlobalObject.h"
#include "JSNameScope.h"
+#include "Operations.h"
#include "PropertyNameArray.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/JSValue.cpp b/Source/JavaScriptCore/runtime/JSValue.cpp
index 0874971..846ddbc 100644
--- a/Source/JavaScriptCore/runtime/JSValue.cpp
+++ b/Source/JavaScriptCore/runtime/JSValue.cpp
@@ -31,6 +31,7 @@
#include "JSGlobalObject.h"
#include "JSFunction.h"
#include "JSNotAnObject.h"
+#include "JSValueInlines.h"
#include "NumberObject.h"
#include <wtf/MathExtras.h>
#include <wtf/StringExtras.h>
diff --git a/Source/JavaScriptCore/runtime/JSValueInlines.h b/Source/JavaScriptCore/runtime/JSValueInlines.h
index c5a42f6..afae5d1 100644
--- a/Source/JavaScriptCore/runtime/JSValueInlines.h
+++ b/Source/JavaScriptCore/runtime/JSValueInlines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,471 +26,773 @@
#ifndef JSValueInlines_h
#define JSValueInlines_h
+#include "InternalFunction.h"
+#include "JSCellInlines.h"
+#include "JSFunction.h"
#include "JSValue.h"
namespace JSC {
- ALWAYS_INLINE int32_t JSValue::toInt32(ExecState* exec) const
- {
- if (isInt32())
- return asInt32();
- return JSC::toInt32(toNumber(exec));
- }
-
- inline uint32_t JSValue::toUInt32(ExecState* exec) const
- {
- // See comment on JSC::toUInt32, above.
- return toInt32(exec);
- }
-
- inline bool JSValue::isUInt32() const
- {
- return isInt32() && asInt32() >= 0;
- }
-
- inline uint32_t JSValue::asUInt32() const
- {
- ASSERT(isUInt32());
+ALWAYS_INLINE int32_t JSValue::toInt32(ExecState* exec) const
+{
+ if (isInt32())
return asInt32();
- }
+ return JSC::toInt32(toNumber(exec));
+}
- inline double JSValue::asNumber() const
- {
- ASSERT(isNumber());
- return isInt32() ? asInt32() : asDouble();
- }
+inline uint32_t JSValue::toUInt32(ExecState* exec) const
+{
+ // See comment on JSC::toUInt32, above.
+ return toInt32(exec);
+}
- inline JSValue jsNaN()
- {
- return JSValue(QNaN);
- }
+inline bool JSValue::isUInt32() const
+{
+ return isInt32() && asInt32() >= 0;
+}
- inline JSValue::JSValue(char i)
- {
- *this = JSValue(static_cast<int32_t>(i));
- }
+inline uint32_t JSValue::asUInt32() const
+{
+ ASSERT(isUInt32());
+ return asInt32();
+}
- inline JSValue::JSValue(unsigned char i)
- {
- *this = JSValue(static_cast<int32_t>(i));
- }
+inline double JSValue::asNumber() const
+{
+ ASSERT(isNumber());
+ return isInt32() ? asInt32() : asDouble();
+}
- inline JSValue::JSValue(short i)
- {
- *this = JSValue(static_cast<int32_t>(i));
- }
+inline JSValue jsNaN()
+{
+ return JSValue(QNaN);
+}
- inline JSValue::JSValue(unsigned short i)
- {
- *this = JSValue(static_cast<int32_t>(i));
- }
+inline JSValue::JSValue(char i)
+{
+ *this = JSValue(static_cast<int32_t>(i));
+}
- inline JSValue::JSValue(unsigned i)
- {
- if (static_cast<int32_t>(i) < 0) {
- *this = JSValue(EncodeAsDouble, static_cast<double>(i));
- return;
- }
- *this = JSValue(static_cast<int32_t>(i));
- }
+inline JSValue::JSValue(unsigned char i)
+{
+ *this = JSValue(static_cast<int32_t>(i));
+}
- inline JSValue::JSValue(long i)
- {
- if (static_cast<int32_t>(i) != i) {
- *this = JSValue(EncodeAsDouble, static_cast<double>(i));
- return;
- }
- *this = JSValue(static_cast<int32_t>(i));
- }
+inline JSValue::JSValue(short i)
+{
+ *this = JSValue(static_cast<int32_t>(i));
+}
- inline JSValue::JSValue(unsigned long i)
- {
- if (static_cast<uint32_t>(i) != i) {
- *this = JSValue(EncodeAsDouble, static_cast<double>(i));
- return;
- }
- *this = JSValue(static_cast<uint32_t>(i));
- }
+inline JSValue::JSValue(unsigned short i)
+{
+ *this = JSValue(static_cast<int32_t>(i));
+}
- inline JSValue::JSValue(long long i)
- {
- if (static_cast<int32_t>(i) != i) {
- *this = JSValue(EncodeAsDouble, static_cast<double>(i));
- return;
- }
- *this = JSValue(static_cast<int32_t>(i));
+inline JSValue::JSValue(unsigned i)
+{
+ if (static_cast<int32_t>(i) < 0) {
+ *this = JSValue(EncodeAsDouble, static_cast<double>(i));
+ return;
}
+ *this = JSValue(static_cast<int32_t>(i));
+}
- inline JSValue::JSValue(unsigned long long i)
- {
- if (static_cast<uint32_t>(i) != i) {
- *this = JSValue(EncodeAsDouble, static_cast<double>(i));
- return;
- }
- *this = JSValue(static_cast<uint32_t>(i));
+inline JSValue::JSValue(long i)
+{
+ if (static_cast<int32_t>(i) != i) {
+ *this = JSValue(EncodeAsDouble, static_cast<double>(i));
+ return;
}
+ *this = JSValue(static_cast<int32_t>(i));
+}
- inline JSValue::JSValue(double d)
- {
- const int32_t asInt32 = static_cast<int32_t>(d);
- if (asInt32 != d || (!asInt32 && signbit(d))) { // true for -0.0
- *this = JSValue(EncodeAsDouble, d);
- return;
- }
- *this = JSValue(static_cast<int32_t>(d));
+inline JSValue::JSValue(unsigned long i)
+{
+ if (static_cast<uint32_t>(i) != i) {
+ *this = JSValue(EncodeAsDouble, static_cast<double>(i));
+ return;
}
+ *this = JSValue(static_cast<uint32_t>(i));
+}
- inline EncodedJSValue JSValue::encode(JSValue value)
- {
- return value.u.asInt64;
+inline JSValue::JSValue(long long i)
+{
+ if (static_cast<int32_t>(i) != i) {
+ *this = JSValue(EncodeAsDouble, static_cast<double>(i));
+ return;
}
+ *this = JSValue(static_cast<int32_t>(i));
+}
- inline JSValue JSValue::decode(EncodedJSValue encodedJSValue)
- {
- JSValue v;
- v.u.asInt64 = encodedJSValue;
- return v;
+inline JSValue::JSValue(unsigned long long i)
+{
+ if (static_cast<uint32_t>(i) != i) {
+ *this = JSValue(EncodeAsDouble, static_cast<double>(i));
+ return;
}
+ *this = JSValue(static_cast<uint32_t>(i));
+}
+
+inline JSValue::JSValue(double d)
+{
+ const int32_t asInt32 = static_cast<int32_t>(d);
+ if (asInt32 != d || (!asInt32 && signbit(d))) { // true for -0.0
+ *this = JSValue(EncodeAsDouble, d);
+ return;
+ }
+ *this = JSValue(static_cast<int32_t>(d));
+}
+
+inline EncodedJSValue JSValue::encode(JSValue value)
+{
+ return value.u.asInt64;
+}
+
+inline JSValue JSValue::decode(EncodedJSValue encodedJSValue)
+{
+ JSValue v;
+ v.u.asInt64 = encodedJSValue;
+ return v;
+}
#if USE(JSVALUE32_64)
- inline JSValue::JSValue()
- {
+inline JSValue::JSValue()
+{
+ u.asBits.tag = EmptyValueTag;
+ u.asBits.payload = 0;
+}
+
+inline JSValue::JSValue(JSNullTag)
+{
+ u.asBits.tag = NullTag;
+ u.asBits.payload = 0;
+}
+
+inline JSValue::JSValue(JSUndefinedTag)
+{
+ u.asBits.tag = UndefinedTag;
+ u.asBits.payload = 0;
+}
+
+inline JSValue::JSValue(JSTrueTag)
+{
+ u.asBits.tag = BooleanTag;
+ u.asBits.payload = 1;
+}
+
+inline JSValue::JSValue(JSFalseTag)
+{
+ u.asBits.tag = BooleanTag;
+ u.asBits.payload = 0;
+}
+
+inline JSValue::JSValue(HashTableDeletedValueTag)
+{
+ u.asBits.tag = DeletedValueTag;
+ u.asBits.payload = 0;
+}
+
+inline JSValue::JSValue(JSCell* ptr)
+{
+ if (ptr)
+ u.asBits.tag = CellTag;
+ else
u.asBits.tag = EmptyValueTag;
- u.asBits.payload = 0;
- }
+ u.asBits.payload = reinterpret_cast<int32_t>(ptr);
+}
- inline JSValue::JSValue(JSNullTag)
- {
- u.asBits.tag = NullTag;
- u.asBits.payload = 0;
- }
+inline JSValue::JSValue(const JSCell* ptr)
+{
+ if (ptr)
+ u.asBits.tag = CellTag;
+ else
+ u.asBits.tag = EmptyValueTag;
+ u.asBits.payload = reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr));
+}
+
+inline JSValue::operator bool() const
+{
+ ASSERT(tag() != DeletedValueTag);
+ return tag() != EmptyValueTag;
+}
+
+inline bool JSValue::operator==(const JSValue& other) const
+{
+ return u.asInt64 == other.u.asInt64;
+}
+
+inline bool JSValue::operator!=(const JSValue& other) const
+{
+ return u.asInt64 != other.u.asInt64;
+}
+
+inline bool JSValue::isEmpty() const
+{
+ return tag() == EmptyValueTag;
+}
+
+inline bool JSValue::isUndefined() const
+{
+ return tag() == UndefinedTag;
+}
+
+inline bool JSValue::isNull() const
+{
+ return tag() == NullTag;
+}
+
+inline bool JSValue::isUndefinedOrNull() const
+{
+ return isUndefined() || isNull();
+}
+
+inline bool JSValue::isCell() const
+{
+ return tag() == CellTag;
+}
+
+inline bool JSValue::isInt32() const
+{
+ return tag() == Int32Tag;
+}
+
+inline bool JSValue::isDouble() const
+{
+ return tag() < LowestTag;
+}
+
+inline bool JSValue::isTrue() const
+{
+ return tag() == BooleanTag && payload();
+}
+
+inline bool JSValue::isFalse() const
+{
+ return tag() == BooleanTag && !payload();
+}
+
+inline uint32_t JSValue::tag() const
+{
+ return u.asBits.tag;
+}
- inline JSValue::JSValue(JSUndefinedTag)
- {
- u.asBits.tag = UndefinedTag;
- u.asBits.payload = 0;
- }
+inline int32_t JSValue::payload() const
+{
+ return u.asBits.payload;
+}
- inline JSValue::JSValue(JSTrueTag)
- {
- u.asBits.tag = BooleanTag;
- u.asBits.payload = 1;
- }
+inline int32_t JSValue::asInt32() const
+{
+ ASSERT(isInt32());
+ return u.asBits.payload;
+}
- inline JSValue::JSValue(JSFalseTag)
- {
- u.asBits.tag = BooleanTag;
- u.asBits.payload = 0;
- }
-
- inline JSValue::JSValue(HashTableDeletedValueTag)
- {
- u.asBits.tag = DeletedValueTag;
- u.asBits.payload = 0;
- }
-
- inline JSValue::JSValue(JSCell* ptr)
- {
- if (ptr)
- u.asBits.tag = CellTag;
- else
- u.asBits.tag = EmptyValueTag;
- u.asBits.payload = reinterpret_cast<int32_t>(ptr);
- }
-
- inline JSValue::JSValue(const JSCell* ptr)
- {
- if (ptr)
- u.asBits.tag = CellTag;
- else
- u.asBits.tag = EmptyValueTag;
- u.asBits.payload = reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr));
- }
-
- inline JSValue::operator bool() const
- {
- ASSERT(tag() != DeletedValueTag);
- return tag() != EmptyValueTag;
- }
-
- inline bool JSValue::operator==(const JSValue& other) const
- {
- return u.asInt64 == other.u.asInt64;
- }
-
- inline bool JSValue::operator!=(const JSValue& other) const
- {
- return u.asInt64 != other.u.asInt64;
- }
-
- inline bool JSValue::isEmpty() const
- {
- return tag() == EmptyValueTag;
- }
-
- inline bool JSValue::isUndefined() const
- {
- return tag() == UndefinedTag;
- }
-
- inline bool JSValue::isNull() const
- {
- return tag() == NullTag;
- }
-
- inline bool JSValue::isUndefinedOrNull() const
- {
- return isUndefined() || isNull();
- }
-
- inline bool JSValue::isCell() const
- {
- return tag() == CellTag;
- }
-
- inline bool JSValue::isInt32() const
- {
- return tag() == Int32Tag;
- }
-
- inline bool JSValue::isDouble() const
- {
- return tag() < LowestTag;
- }
-
- inline bool JSValue::isTrue() const
- {
- return tag() == BooleanTag && payload();
- }
-
- inline bool JSValue::isFalse() const
- {
- return tag() == BooleanTag && !payload();
- }
-
- inline uint32_t JSValue::tag() const
- {
- return u.asBits.tag;
- }
+inline double JSValue::asDouble() const
+{
+ ASSERT(isDouble());
+ return u.asDouble;
+}
- inline int32_t JSValue::payload() const
- {
- return u.asBits.payload;
- }
-
- inline int32_t JSValue::asInt32() const
- {
- ASSERT(isInt32());
- return u.asBits.payload;
- }
-
- inline double JSValue::asDouble() const
- {
- ASSERT(isDouble());
- return u.asDouble;
- }
-
- ALWAYS_INLINE JSCell* JSValue::asCell() const
- {
- ASSERT(isCell());
- return reinterpret_cast<JSCell*>(u.asBits.payload);
- }
+ALWAYS_INLINE JSCell* JSValue::asCell() const
+{
+ ASSERT(isCell());
+ return reinterpret_cast<JSCell*>(u.asBits.payload);
+}
- ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, double d)
- {
- u.asDouble = d;
- }
+ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, double d)
+{
+ u.asDouble = d;
+}
- inline JSValue::JSValue(int i)
- {
- u.asBits.tag = Int32Tag;
- u.asBits.payload = i;
- }
+inline JSValue::JSValue(int i)
+{
+ u.asBits.tag = Int32Tag;
+ u.asBits.payload = i;
+}
#if ENABLE(LLINT_C_LOOP)
- inline JSValue::JSValue(int32_t tag, int32_t payload)
- {
- u.asBits.tag = tag;
- u.asBits.payload = payload;
- }
+inline JSValue::JSValue(int32_t tag, int32_t payload)
+{
+ u.asBits.tag = tag;
+ u.asBits.payload = payload;
+}
#endif
- inline bool JSValue::isNumber() const
- {
- return isInt32() || isDouble();
- }
+inline bool JSValue::isNumber() const
+{
+ return isInt32() || isDouble();
+}
- inline bool JSValue::isBoolean() const
- {
- return isTrue() || isFalse();
- }
+inline bool JSValue::isBoolean() const
+{
+ return isTrue() || isFalse();
+}
- inline bool JSValue::asBoolean() const
- {
- ASSERT(isBoolean());
- return payload();
- }
+inline bool JSValue::asBoolean() const
+{
+ ASSERT(isBoolean());
+ return payload();
+}
#else // !USE(JSVALUE32_64) i.e. USE(JSVALUE64)
- // 0x0 can never occur naturally because it has a tag of 00, indicating a pointer value, but a payload of 0x0, which is in the (invalid) zero page.
- inline JSValue::JSValue()
- {
- u.asInt64 = ValueEmpty;
- }
+// 0x0 can never occur naturally because it has a tag of 00, indicating a pointer value, but a payload of 0x0, which is in the (invalid) zero page.
+inline JSValue::JSValue()
+{
+ u.asInt64 = ValueEmpty;
+}
- // 0x4 can never occur naturally because it has a tag of 00, indicating a pointer value, but a payload of 0x4, which is in the (invalid) zero page.
- inline JSValue::JSValue(HashTableDeletedValueTag)
- {
- u.asInt64 = ValueDeleted;
- }
+// 0x4 can never occur naturally because it has a tag of 00, indicating a pointer value, but a payload of 0x4, which is in the (invalid) zero page.
+inline JSValue::JSValue(HashTableDeletedValueTag)
+{
+ u.asInt64 = ValueDeleted;
+}
- inline JSValue::JSValue(JSCell* ptr)
- {
- u.asInt64 = reinterpret_cast<uintptr_t>(ptr);
- }
+inline JSValue::JSValue(JSCell* ptr)
+{
+ u.asInt64 = reinterpret_cast<uintptr_t>(ptr);
+}
- inline JSValue::JSValue(const JSCell* ptr)
- {
- u.asInt64 = reinterpret_cast<uintptr_t>(const_cast<JSCell*>(ptr));
- }
+inline JSValue::JSValue(const JSCell* ptr)
+{
+ u.asInt64 = reinterpret_cast<uintptr_t>(const_cast<JSCell*>(ptr));
+}
- inline JSValue::operator bool() const
- {
- return u.asInt64;
- }
+inline JSValue::operator bool() const
+{
+ return u.asInt64;
+}
- inline bool JSValue::operator==(const JSValue& other) const
- {
- return u.asInt64 == other.u.asInt64;
- }
+inline bool JSValue::operator==(const JSValue& other) const
+{
+ return u.asInt64 == other.u.asInt64;
+}
- inline bool JSValue::operator!=(const JSValue& other) const
- {
- return u.asInt64 != other.u.asInt64;
- }
+inline bool JSValue::operator!=(const JSValue& other) const
+{
+ return u.asInt64 != other.u.asInt64;
+}
- inline bool JSValue::isEmpty() const
- {
- return u.asInt64 == ValueEmpty;
- }
+inline bool JSValue::isEmpty() const
+{
+ return u.asInt64 == ValueEmpty;
+}
- inline bool JSValue::isUndefined() const
- {
- return asValue() == JSValue(JSUndefined);
- }
+inline bool JSValue::isUndefined() const
+{
+ return asValue() == JSValue(JSUndefined);
+}
- inline bool JSValue::isNull() const
- {
- return asValue() == JSValue(JSNull);
- }
+inline bool JSValue::isNull() const
+{
+ return asValue() == JSValue(JSNull);
+}
- inline bool JSValue::isTrue() const
- {
- return asValue() == JSValue(JSTrue);
- }
+inline bool JSValue::isTrue() const
+{
+ return asValue() == JSValue(JSTrue);
+}
- inline bool JSValue::isFalse() const
- {
- return asValue() == JSValue(JSFalse);
- }
+inline bool JSValue::isFalse() const
+{
+ return asValue() == JSValue(JSFalse);
+}
- inline bool JSValue::asBoolean() const
- {
- ASSERT(isBoolean());
- return asValue() == JSValue(JSTrue);
- }
+inline bool JSValue::asBoolean() const
+{
+ ASSERT(isBoolean());
+ return asValue() == JSValue(JSTrue);
+}
- inline int32_t JSValue::asInt32() const
- {
- ASSERT(isInt32());
- return static_cast<int32_t>(u.asInt64);
- }
+inline int32_t JSValue::asInt32() const
+{
+ ASSERT(isInt32());
+ return static_cast<int32_t>(u.asInt64);
+}
- inline bool JSValue::isDouble() const
- {
- return isNumber() && !isInt32();
- }
+inline bool JSValue::isDouble() const
+{
+ return isNumber() && !isInt32();
+}
- inline JSValue::JSValue(JSNullTag)
- {
- u.asInt64 = ValueNull;
- }
+inline JSValue::JSValue(JSNullTag)
+{
+ u.asInt64 = ValueNull;
+}
- inline JSValue::JSValue(JSUndefinedTag)
- {
- u.asInt64 = ValueUndefined;
- }
+inline JSValue::JSValue(JSUndefinedTag)
+{
+ u.asInt64 = ValueUndefined;
+}
- inline JSValue::JSValue(JSTrueTag)
- {
- u.asInt64 = ValueTrue;
- }
+inline JSValue::JSValue(JSTrueTag)
+{
+ u.asInt64 = ValueTrue;
+}
- inline JSValue::JSValue(JSFalseTag)
- {
- u.asInt64 = ValueFalse;
- }
+inline JSValue::JSValue(JSFalseTag)
+{
+ u.asInt64 = ValueFalse;
+}
- inline bool JSValue::isUndefinedOrNull() const
- {
- // Undefined and null share the same value, bar the 'undefined' bit in the extended tag.
- return (u.asInt64 & ~TagBitUndefined) == ValueNull;
- }
+inline bool JSValue::isUndefinedOrNull() const
+{
+ // Undefined and null share the same value, bar the 'undefined' bit in the extended tag.
+ return (u.asInt64 & ~TagBitUndefined) == ValueNull;
+}
- inline bool JSValue::isBoolean() const
- {
- return (u.asInt64 & ~1) == ValueFalse;
- }
+inline bool JSValue::isBoolean() const
+{
+ return (u.asInt64 & ~1) == ValueFalse;
+}
- inline bool JSValue::isCell() const
- {
- return !(u.asInt64 & TagMask);
- }
+inline bool JSValue::isCell() const
+{
+ return !(u.asInt64 & TagMask);
+}
- inline bool JSValue::isInt32() const
- {
- return (u.asInt64 & TagTypeNumber) == TagTypeNumber;
- }
+inline bool JSValue::isInt32() const
+{
+ return (u.asInt64 & TagTypeNumber) == TagTypeNumber;
+}
- inline int64_t reinterpretDoubleToInt64(double value)
- {
- return bitwise_cast<int64_t>(value);
- }
- inline double reinterpretInt64ToDouble(int64_t value)
- {
- return bitwise_cast<double>(value);
- }
+inline int64_t reinterpretDoubleToInt64(double value)
+{
+ return bitwise_cast<int64_t>(value);
+}
+inline double reinterpretInt64ToDouble(int64_t value)
+{
+ return bitwise_cast<double>(value);
+}
- ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, double d)
- {
- u.asInt64 = reinterpretDoubleToInt64(d) + DoubleEncodeOffset;
- }
+ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, double d)
+{
+ u.asInt64 = reinterpretDoubleToInt64(d) + DoubleEncodeOffset;
+}
- inline JSValue::JSValue(int i)
- {
- u.asInt64 = TagTypeNumber | static_cast<uint32_t>(i);
- }
+inline JSValue::JSValue(int i)
+{
+ u.asInt64 = TagTypeNumber | static_cast<uint32_t>(i);
+}
- inline double JSValue::asDouble() const
- {
- ASSERT(isDouble());
- return reinterpretInt64ToDouble(u.asInt64 - DoubleEncodeOffset);
- }
+inline double JSValue::asDouble() const
+{
+ ASSERT(isDouble());
+ return reinterpretInt64ToDouble(u.asInt64 - DoubleEncodeOffset);
+}
- inline bool JSValue::isNumber() const
- {
- return u.asInt64 & TagTypeNumber;
- }
+inline bool JSValue::isNumber() const
+{
+ return u.asInt64 & TagTypeNumber;
+}
- ALWAYS_INLINE JSCell* JSValue::asCell() const
- {
- ASSERT(isCell());
- return u.ptr;
- }
+ALWAYS_INLINE JSCell* JSValue::asCell() const
+{
+ ASSERT(isCell());
+ return u.ptr;
+}
#endif // USE(JSVALUE64)
+inline bool JSValue::isString() const
+{
+ return isCell() && asCell()->isString();
+}
+
+inline bool JSValue::isPrimitive() const
+{
+ return !isCell() || asCell()->isString();
+}
+
+inline bool JSValue::isGetterSetter() const
+{
+ return isCell() && asCell()->isGetterSetter();
+}
+
+inline bool JSValue::isObject() const
+{
+ return isCell() && asCell()->isObject();
+}
+
+inline bool JSValue::getString(ExecState* exec, String& s) const
+{
+ return isCell() && asCell()->getString(exec, s);
+}
+
+inline String JSValue::getString(ExecState* exec) const
+{
+ return isCell() ? asCell()->getString(exec) : String();
+}
+
+template <typename Base> String HandleConverter<Base, Unknown>::getString(ExecState* exec) const
+{
+ return jsValue().getString(exec);
+}
+
+inline JSObject* JSValue::getObject() const
+{
+ return isCell() ? asCell()->getObject() : 0;
+}
+
+ALWAYS_INLINE bool JSValue::getUInt32(uint32_t& v) const
+{
+ if (isInt32()) {
+ int32_t i = asInt32();
+ v = static_cast<uint32_t>(i);
+ return i >= 0;
+ }
+ if (isDouble()) {
+ double d = asDouble();
+ v = static_cast<uint32_t>(d);
+ return v == d;
+ }
+ return false;
+}
+
+inline JSValue JSValue::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredType) const
+{
+ return isCell() ? asCell()->toPrimitive(exec, preferredType) : asValue();
+}
+
+inline bool JSValue::getPrimitiveNumber(ExecState* exec, double& number, JSValue& value)
+{
+ if (isInt32()) {
+ number = asInt32();
+ value = *this;
+ return true;
+ }
+ if (isDouble()) {
+ number = asDouble();
+ value = *this;
+ return true;
+ }
+ if (isCell())
+ return asCell()->getPrimitiveNumber(exec, number, value);
+ if (isTrue()) {
+ number = 1.0;
+ value = *this;
+ return true;
+ }
+ if (isFalse() || isNull()) {
+ number = 0.0;
+ value = *this;
+ return true;
+ }
+ ASSERT(isUndefined());
+ number = QNaN;
+ value = *this;
+ return true;
+}
+
+ALWAYS_INLINE double JSValue::toNumber(ExecState* exec) const
+{
+ if (isInt32())
+ return asInt32();
+ if (isDouble())
+ return asDouble();
+ return toNumberSlowCase(exec);
+}
+
+inline JSObject* JSValue::toObject(ExecState* exec) const
+{
+ return isCell() ? asCell()->toObject(exec, exec->lexicalGlobalObject()) : toObjectSlowCase(exec, exec->lexicalGlobalObject());
+}
+
+inline JSObject* JSValue::toObject(ExecState* exec, JSGlobalObject* globalObject) const
+{
+ return isCell() ? asCell()->toObject(exec, globalObject) : toObjectSlowCase(exec, globalObject);
+}
+
+inline bool JSValue::isFunction() const
+{
+ return isCell() && (asCell()->inherits(&JSFunction::s_info) || asCell()->inherits(&InternalFunction::s_info));
+}
+
+// this method is here to be after the inline declaration of JSCell::inherits
+inline bool JSValue::inherits(const ClassInfo* classInfo) const
+{
+ return isCell() && asCell()->inherits(classInfo);
+}
+
+inline JSObject* JSValue::toThisObject(ExecState* exec) const
+{
+ return isCell() ? asCell()->methodTable()->toThisObject(asCell(), exec) : toThisObjectSlowCase(exec);
+}
+
+inline JSValue JSValue::get(ExecState* exec, PropertyName propertyName) const
+{
+ PropertySlot slot(asValue());
+ return get(exec, propertyName, slot);
+}
+
+inline JSValue JSValue::get(ExecState* exec, PropertyName propertyName, PropertySlot& slot) const
+{
+ if (UNLIKELY(!isCell())) {
+ JSObject* prototype = synthesizePrototype(exec);
+ if (!prototype->getPropertySlot(exec, propertyName, slot))
+ return jsUndefined();
+ return slot.getValue(exec, propertyName);
+ }
+ JSCell* cell = asCell();
+ while (true) {
+ if (cell->fastGetOwnPropertySlot(exec, propertyName, slot))
+ return slot.getValue(exec, propertyName);
+ JSValue prototype = asObject(cell)->prototype();
+ if (!prototype.isObject())
+ return jsUndefined();
+ cell = asObject(prototype);
+ }
+}
+
+inline JSValue JSValue::get(ExecState* exec, unsigned propertyName) const
+{
+ PropertySlot slot(asValue());
+ return get(exec, propertyName, slot);
+}
+
+inline JSValue JSValue::get(ExecState* exec, unsigned propertyName, PropertySlot& slot) const
+{
+ if (UNLIKELY(!isCell())) {
+ JSObject* prototype = synthesizePrototype(exec);
+ if (!prototype->getPropertySlot(exec, propertyName, slot))
+ return jsUndefined();
+ return slot.getValue(exec, propertyName);
+ }
+ JSCell* cell = const_cast<JSCell*>(asCell());
+ while (true) {
+ if (cell->methodTable()->getOwnPropertySlotByIndex(cell, exec, propertyName, slot))
+ return slot.getValue(exec, propertyName);
+ JSValue prototype = asObject(cell)->prototype();
+ if (!prototype.isObject())
+ return jsUndefined();
+ cell = prototype.asCell();
+ }
+}
+
+inline void JSValue::put(ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
+{
+ if (UNLIKELY(!isCell())) {
+ putToPrimitive(exec, propertyName, value, slot);
+ return;
+ }
+ asCell()->methodTable()->put(asCell(), exec, propertyName, value, slot);
+}
+
+inline void JSValue::putByIndex(ExecState* exec, unsigned propertyName, JSValue value, bool shouldThrow)
+{
+ if (UNLIKELY(!isCell())) {
+ putToPrimitiveByIndex(exec, propertyName, value, shouldThrow);
+ return;
+ }
+ asCell()->methodTable()->putByIndex(asCell(), exec, propertyName, value, shouldThrow);
+}
+
+inline JSValue JSValue::structureOrUndefined() const
+{
+ if (isCell())
+ return JSValue(asCell()->structure());
+ return jsUndefined();
+}
+
+// ECMA 11.9.3
+inline bool JSValue::equal(ExecState* exec, JSValue v1, JSValue v2)
+{
+ if (v1.isInt32() && v2.isInt32())
+ return v1 == v2;
+
+ return equalSlowCase(exec, v1, v2);
+}
+
+ALWAYS_INLINE bool JSValue::equalSlowCaseInline(ExecState* exec, JSValue v1, JSValue v2)
+{
+ do {
+ if (v1.isNumber() && v2.isNumber())
+ return v1.asNumber() == v2.asNumber();
+
+ bool s1 = v1.isString();
+ bool s2 = v2.isString();
+ if (s1 && s2)
+ return asString(v1)->value(exec) == asString(v2)->value(exec);
+
+ if (v1.isUndefinedOrNull()) {
+ if (v2.isUndefinedOrNull())
+ return true;
+ if (!v2.isCell())
+ return false;
+ return v2.asCell()->structure()->masqueradesAsUndefined(exec->lexicalGlobalObject());
+ }
+
+ if (v2.isUndefinedOrNull()) {
+ if (!v1.isCell())
+ return false;
+ return v1.asCell()->structure()->masqueradesAsUndefined(exec->lexicalGlobalObject());
+ }
+
+ if (v1.isObject()) {
+ if (v2.isObject())
+ return v1 == v2;
+ JSValue p1 = v1.toPrimitive(exec);
+ if (exec->hadException())
+ return false;
+ v1 = p1;
+ if (v1.isInt32() && v2.isInt32())
+ return v1 == v2;
+ continue;
+ }
+
+ if (v2.isObject()) {
+ JSValue p2 = v2.toPrimitive(exec);
+ if (exec->hadException())
+ return false;
+ v2 = p2;
+ if (v1.isInt32() && v2.isInt32())
+ return v1 == v2;
+ continue;
+ }
+
+ if (s1 || s2) {
+ double d1 = v1.toNumber(exec);
+ double d2 = v2.toNumber(exec);
+ return d1 == d2;
+ }
+
+ if (v1.isBoolean()) {
+ if (v2.isNumber())
+ return static_cast<double>(v1.asBoolean()) == v2.asNumber();
+ } else if (v2.isBoolean()) {
+ if (v1.isNumber())
+ return v1.asNumber() == static_cast<double>(v2.asBoolean());
+ }
+
+ return v1 == v2;
+ } while (true);
+}
+
+// ECMA 11.9.3
+ALWAYS_INLINE bool JSValue::strictEqualSlowCaseInline(ExecState* exec, JSValue v1, JSValue v2)
+{
+ ASSERT(v1.isCell() && v2.isCell());
+
+ if (v1.asCell()->isString() && v2.asCell()->isString())
+ return asString(v1)->value(exec) == asString(v2)->value(exec);
+
+ return v1 == v2;
+}
+
+inline bool JSValue::strictEqual(ExecState* exec, JSValue v1, JSValue v2)
+{
+ if (v1.isInt32() && v2.isInt32())
+ return v1 == v2;
+
+ if (v1.isNumber() && v2.isNumber())
+ return v1.asNumber() == v2.asNumber();
+
+ if (!v1.isCell() || !v2.isCell())
+ return v1 == v2;
+
+ return strictEqualSlowCaseInline(exec, v1, v2);
+}
+
} // namespace JSC
#endif // JSValueInlines_h
diff --git a/Source/JavaScriptCore/runtime/JSVariableObject.cpp b/Source/JavaScriptCore/runtime/JSVariableObject.cpp
index 9b03a2c..fc262f5 100644
--- a/Source/JavaScriptCore/runtime/JSVariableObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSVariableObject.cpp
@@ -29,6 +29,8 @@
#include "config.h"
#include "JSVariableObject.h"
+#include "Operations.h"
+
namespace JSC {
const ClassInfo JSVariableObject::s_info = { "VariableObject", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSVariableObject) };
diff --git a/Source/JavaScriptCore/runtime/JSWithScope.cpp b/Source/JavaScriptCore/runtime/JSWithScope.cpp
index 7d74e63..c0c6c1f 100644
--- a/Source/JavaScriptCore/runtime/JSWithScope.cpp
+++ b/Source/JavaScriptCore/runtime/JSWithScope.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "JSWithScope.h"
+#include "Operations.h"
+
namespace JSC {
const ClassInfo JSWithScope::s_info = { "WithScope", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSWithScope) };
diff --git a/Source/JavaScriptCore/runtime/JSWrapperObject.cpp b/Source/JavaScriptCore/runtime/JSWrapperObject.cpp
index ff80c1e..01961a9 100644
--- a/Source/JavaScriptCore/runtime/JSWrapperObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSWrapperObject.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006 Maks Orlovich
- * Copyright (C) 2006, 2009 Apple, Inc.
+ * Copyright (C) 2006, 2009, 2012 Apple, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -22,6 +22,8 @@
#include "config.h"
#include "JSWrapperObject.h"
+#include "Operations.h"
+
namespace JSC {
ASSERT_HAS_TRIVIAL_DESTRUCTOR(JSWrapperObject);
diff --git a/Source/JavaScriptCore/runtime/LiteralParser.cpp b/Source/JavaScriptCore/runtime/LiteralParser.cpp
index bf27327..fb767ab 100644
--- a/Source/JavaScriptCore/runtime/LiteralParser.cpp
+++ b/Source/JavaScriptCore/runtime/LiteralParser.cpp
@@ -32,6 +32,7 @@
#include "JSArray.h"
#include "JSString.h"
#include "Lexer.h"
+#include "Operations.h"
#include "StrongInlines.h"
#include <wtf/ASCIICType.h>
#include <wtf/dtoa.h>
diff --git a/Source/JavaScriptCore/runtime/Lookup.cpp b/Source/JavaScriptCore/runtime/Lookup.cpp
index e3bc7ad..067c5c0 100644
--- a/Source/JavaScriptCore/runtime/Lookup.cpp
+++ b/Source/JavaScriptCore/runtime/Lookup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2012 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,7 @@
#include "Executable.h"
#include "JSFunction.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/NameConstructor.cpp b/Source/JavaScriptCore/runtime/NameConstructor.cpp
index b5facc7..387fcc1 100644
--- a/Source/JavaScriptCore/runtime/NameConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/NameConstructor.cpp
@@ -28,6 +28,7 @@
#include "JSGlobalObject.h"
#include "NamePrototype.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/NameInstance.cpp b/Source/JavaScriptCore/runtime/NameInstance.cpp
index f257243..9d79ac2 100644
--- a/Source/JavaScriptCore/runtime/NameInstance.cpp
+++ b/Source/JavaScriptCore/runtime/NameInstance.cpp
@@ -27,6 +27,7 @@
#include "NameInstance.h"
#include "JSScope.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/NamePrototype.cpp b/Source/JavaScriptCore/runtime/NamePrototype.cpp
index f14e585..5ebfef1 100644
--- a/Source/JavaScriptCore/runtime/NamePrototype.cpp
+++ b/Source/JavaScriptCore/runtime/NamePrototype.cpp
@@ -27,6 +27,7 @@
#include "NamePrototype.h"
#include "Error.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp b/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
index 1f17308..929cc8c 100644
--- a/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
@@ -25,6 +25,7 @@
#include "JSFunction.h"
#include "JSString.h"
#include "NativeErrorPrototype.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp b/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
index 296a86a..47eacf5 100644
--- a/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
@@ -24,6 +24,7 @@
#include "JSGlobalObject.h"
#include "JSString.h"
#include "NativeErrorConstructor.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/NumberConstructor.cpp b/Source/JavaScriptCore/runtime/NumberConstructor.cpp
index daa643d..090a345 100644
--- a/Source/JavaScriptCore/runtime/NumberConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/NumberConstructor.cpp
@@ -25,6 +25,7 @@
#include "Lookup.h"
#include "NumberObject.h"
#include "NumberPrototype.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/NumberObject.cpp b/Source/JavaScriptCore/runtime/NumberObject.cpp
index b87753d..83bf16c 100644
--- a/Source/JavaScriptCore/runtime/NumberObject.cpp
+++ b/Source/JavaScriptCore/runtime/NumberObject.cpp
@@ -24,6 +24,7 @@
#include "JSGlobalObject.h"
#include "NumberPrototype.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/ObjectConstructor.cpp b/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
index 7e74a91..1eb809b 100644
--- a/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
@@ -30,6 +30,7 @@
#include "JSGlobalObject.h"
#include "Lookup.h"
#include "ObjectPrototype.h"
+#include "Operations.h"
#include "PropertyDescriptor.h"
#include "PropertyNameArray.h"
diff --git a/Source/JavaScriptCore/runtime/ObjectPrototype.cpp b/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
index e94edfa..b661dbe 100644
--- a/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
@@ -25,6 +25,7 @@
#include "JSFunction.h"
#include "JSString.h"
#include "JSStringBuilder.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/Operations.h b/Source/JavaScriptCore/runtime/Operations.h
index 4ff0741..a901d3e 100644
--- a/Source/JavaScriptCore/runtime/Operations.h
+++ b/Source/JavaScriptCore/runtime/Operations.h
@@ -113,105 +113,6 @@
return ropeBuilder.release();
}
- // ECMA 11.9.3
- inline bool JSValue::equal(ExecState* exec, JSValue v1, JSValue v2)
- {
- if (v1.isInt32() && v2.isInt32())
- return v1 == v2;
-
- return equalSlowCase(exec, v1, v2);
- }
-
- ALWAYS_INLINE bool JSValue::equalSlowCaseInline(ExecState* exec, JSValue v1, JSValue v2)
- {
- do {
- if (v1.isNumber() && v2.isNumber())
- return v1.asNumber() == v2.asNumber();
-
- bool s1 = v1.isString();
- bool s2 = v2.isString();
- if (s1 && s2)
- return asString(v1)->value(exec) == asString(v2)->value(exec);
-
- if (v1.isUndefinedOrNull()) {
- if (v2.isUndefinedOrNull())
- return true;
- if (!v2.isCell())
- return false;
- return v2.asCell()->structure()->masqueradesAsUndefined(exec->lexicalGlobalObject());
- }
-
- if (v2.isUndefinedOrNull()) {
- if (!v1.isCell())
- return false;
- return v1.asCell()->structure()->masqueradesAsUndefined(exec->lexicalGlobalObject());
- }
-
- if (v1.isObject()) {
- if (v2.isObject())
- return v1 == v2;
- JSValue p1 = v1.toPrimitive(exec);
- if (exec->hadException())
- return false;
- v1 = p1;
- if (v1.isInt32() && v2.isInt32())
- return v1 == v2;
- continue;
- }
-
- if (v2.isObject()) {
- JSValue p2 = v2.toPrimitive(exec);
- if (exec->hadException())
- return false;
- v2 = p2;
- if (v1.isInt32() && v2.isInt32())
- return v1 == v2;
- continue;
- }
-
- if (s1 || s2) {
- double d1 = v1.toNumber(exec);
- double d2 = v2.toNumber(exec);
- return d1 == d2;
- }
-
- if (v1.isBoolean()) {
- if (v2.isNumber())
- return static_cast<double>(v1.asBoolean()) == v2.asNumber();
- } else if (v2.isBoolean()) {
- if (v1.isNumber())
- return v1.asNumber() == static_cast<double>(v2.asBoolean());
- }
-
- return v1 == v2;
- } while (true);
- }
-
- // ECMA 11.9.3
- ALWAYS_INLINE bool JSValue::strictEqualSlowCaseInline(ExecState* exec, JSValue v1, JSValue v2)
- {
- ASSERT(v1.isCell() && v2.isCell());
-
- if (v1.asCell()->isString() && v2.asCell()->isString())
- return asString(v1)->value(exec) == asString(v2)->value(exec);
-
- return v1 == v2;
- }
-
- inline bool JSValue::strictEqual(ExecState* exec, JSValue v1, JSValue v2)
- {
- if (v1.isInt32() && v2.isInt32())
- return v1 == v2;
-
- if (v1.isNumber() && v2.isNumber())
- return v1.asNumber() == v2.asNumber();
-
- if (!v1.isCell() || !v2.isCell())
- return v1 == v2;
-
- return strictEqualSlowCaseInline(exec, v1, v2);
- }
-
// See ES5 11.8.1/11.8.2/11.8.5 for definition of leftFirst, this value ensures correct
// evaluation ordering for argument conversions for '<' and '>'. For '<' pass the value
// true, for leftFirst, for '>' pass the value false (and reverse operand order).
diff --git a/Source/JavaScriptCore/runtime/PropertySlot.cpp b/Source/JavaScriptCore/runtime/PropertySlot.cpp
index 8ac8741..291ea48 100644
--- a/Source/JavaScriptCore/runtime/PropertySlot.cpp
+++ b/Source/JavaScriptCore/runtime/PropertySlot.cpp
@@ -23,6 +23,7 @@
#include "JSFunction.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/RegExp.cpp b/Source/JavaScriptCore/runtime/RegExp.cpp
index 3229f52..d5d4eab 100644
--- a/Source/JavaScriptCore/runtime/RegExp.cpp
+++ b/Source/JavaScriptCore/runtime/RegExp.cpp
@@ -24,16 +24,16 @@
#include "RegExp.h"
#include "Lexer.h"
+#include "Operations.h"
#include "RegExpCache.h"
-#include "yarr/Yarr.h"
-#include "yarr/YarrJIT.h"
+#include "Yarr.h"
+#include "YarrJIT.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wtf/Assertions.h>
#include <wtf/OwnArrayPtr.h>
-
#define REGEXP_FUNC_TEST_DATA_GEN 0
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/RegExpCache.cpp b/Source/JavaScriptCore/runtime/RegExpCache.cpp
index 8acafba..14ce7ec 100644
--- a/Source/JavaScriptCore/runtime/RegExpCache.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpCache.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2010 University of Szeged
* Copyright (C) 2010 Renata Hodovan (hodovan@inf.u-szeged.hu)
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,8 +27,9 @@
*/
#include "config.h"
-
#include "RegExpCache.h"
+
+#include "Operations.h"
#include "RegExpObject.h"
#include "StrongInlines.h"
diff --git a/Source/JavaScriptCore/runtime/RegExpCachedResult.cpp b/Source/JavaScriptCore/runtime/RegExpCachedResult.cpp
index 47cff15..10abaae 100644
--- a/Source/JavaScriptCore/runtime/RegExpCachedResult.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpCachedResult.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "RegExpCachedResult.h"
+#include "Operations.h"
#include "RegExpMatchesArray.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/RegExpConstructor.cpp b/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
index cc6ceb1..73c2577 100644
--- a/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
@@ -23,6 +23,7 @@
#include "RegExpConstructor.h"
#include "Error.h"
+#include "Operations.h"
#include "RegExpMatchesArray.h"
#include "RegExpPrototype.h"
diff --git a/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp b/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
index 19f3b81..568b440 100644
--- a/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
@@ -27,6 +27,7 @@
#include "RegExpMatchesArray.h"
#include "ButterflyInlines.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/RegExpObject.cpp b/Source/JavaScriptCore/runtime/RegExpObject.cpp
index 00dd1ed..31e4c54 100644
--- a/Source/JavaScriptCore/runtime/RegExpObject.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpObject.cpp
@@ -30,6 +30,7 @@
#include "JSString.h"
#include "Lexer.h"
#include "Lookup.h"
+#include "Operations.h"
#include "RegExpConstructor.h"
#include "RegExpMatchesArray.h"
#include "RegExpPrototype.h"
diff --git a/Source/JavaScriptCore/runtime/RegExpPrototype.cpp b/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
index e4bf2cf..a14b375 100644
--- a/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
@@ -30,6 +30,7 @@
#include "JSStringBuilder.h"
#include "JSValue.h"
#include "ObjectPrototype.h"
+#include "Operations.h"
#include "RegExpObject.h"
#include "RegExp.h"
#include "RegExpCache.h"
diff --git a/Source/JavaScriptCore/runtime/SmallStrings.cpp b/Source/JavaScriptCore/runtime/SmallStrings.cpp
index 6552d7c..56a23b4 100644
--- a/Source/JavaScriptCore/runtime/SmallStrings.cpp
+++ b/Source/JavaScriptCore/runtime/SmallStrings.cpp
@@ -29,6 +29,7 @@
#include "HeapRootVisitor.h"
#include "JSGlobalObject.h"
#include "JSString.h"
+#include "Operations.h"
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/text/StringImpl.h>
diff --git a/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp b/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
index 7f21e2c..94e407f 100644
--- a/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
+++ b/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
@@ -29,6 +29,7 @@
#include "ClassInfo.h"
#include "GetterSetter.h"
#include "JSObject.h"
+#include "Operations.h"
#include "PropertySlot.h"
#include "Reject.h"
#include "SlotVisitor.h"
diff --git a/Source/JavaScriptCore/runtime/StrictEvalActivation.cpp b/Source/JavaScriptCore/runtime/StrictEvalActivation.cpp
index b1f28c8..88da424 100644
--- a/Source/JavaScriptCore/runtime/StrictEvalActivation.cpp
+++ b/Source/JavaScriptCore/runtime/StrictEvalActivation.cpp
@@ -27,6 +27,7 @@
#include "StrictEvalActivation.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/StringConstructor.cpp b/Source/JavaScriptCore/runtime/StringConstructor.cpp
index 7f36a84..2741345 100644
--- a/Source/JavaScriptCore/runtime/StringConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/StringConstructor.cpp
@@ -25,6 +25,7 @@
#include "JITCode.h"
#include "JSFunction.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
#include "StringPrototype.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/StringObject.cpp b/Source/JavaScriptCore/runtime/StringObject.cpp
index ab7d6cb..f41ac24 100644
--- a/Source/JavaScriptCore/runtime/StringObject.cpp
+++ b/Source/JavaScriptCore/runtime/StringObject.cpp
@@ -23,6 +23,7 @@
#include "Error.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
#include "PropertyNameArray.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/StringRecursionChecker.cpp b/Source/JavaScriptCore/runtime/StringRecursionChecker.cpp
index 22b7367..8835a5c 100644
--- a/Source/JavaScriptCore/runtime/StringRecursionChecker.cpp
+++ b/Source/JavaScriptCore/runtime/StringRecursionChecker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,7 @@
#include "Error.h"
#include "ExceptionHelpers.h"
+#include "Operations.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/Structure.h b/Source/JavaScriptCore/runtime/Structure.h
index b06e772..9f6d210 100644
--- a/Source/JavaScriptCore/runtime/Structure.h
+++ b/Source/JavaScriptCore/runtime/Structure.h
@@ -506,48 +506,6 @@
return typeInfo().masqueradesAsUndefined() && globalObject() == lexicalGlobalObject;
}
- inline JSValue JSValue::structureOrUndefined() const
- {
- if (isCell())
- return JSValue(asCell()->structure());
- return jsUndefined();
- }
-
- inline bool JSCell::isObject() const
- {
- return m_structure->isObject();
- }
-
- inline bool JSCell::isString() const
- {
- return m_structure->typeInfo().type() == StringType;
- }
-
- inline bool JSCell::isGetterSetter() const
- {
- return m_structure->typeInfo().type() == GetterSetterType;
- }
-
- inline bool JSCell::isProxy() const
- {
- return structure()->typeInfo().type() == ProxyType;
- }
-
- inline bool JSCell::isAPIValueWrapper() const
- {
- return m_structure->typeInfo().type() == APIValueWrapperType;
- }
-
- inline void JSCell::setStructure(JSGlobalData& globalData, Structure* structure)
- {
- ASSERT(structure->typeInfo().overridesVisitChildren() == this->structure()->typeInfo().overridesVisitChildren());
- ASSERT(structure->classInfo() == m_structure->classInfo());
- ASSERT(!m_structure
- || m_structure->transitionWatchpointSetHasBeenInvalidated()
- || m_structure.get() == structure);
- m_structure.set(globalData, this, structure);
- }
-
ALWAYS_INLINE void SlotVisitor::internalAppend(JSCell* cell)
{
ASSERT(!m_isCheckingForDefaultMarkViolation);
@@ -586,23 +544,6 @@
return false;
}
- inline JSCell::JSCell(JSGlobalData& globalData, Structure* structure)
- : m_structure(globalData, this, structure)
- {
- }
-
- inline void JSCell::finishCreation(JSGlobalData& globalData, Structure* structure, CreatingEarlyCellTag)
- {
-#if ENABLE(GC_VALIDATION)
- ASSERT(globalData.isInitializingObject());
- globalData.setInitializingObjectClass(0);
- if (structure)
-#endif
- m_structure.setEarlyValue(globalData, this, structure);
- // Very first set of allocations won't have a real structure.
- ASSERT(m_structure || !globalData.structureStructure);
- }
-
} // namespace JSC
#endif // Structure_h
diff --git a/Source/JavaScriptCore/runtime/StructureChain.cpp b/Source/JavaScriptCore/runtime/StructureChain.cpp
index a1c9734..93f0c8d 100644
--- a/Source/JavaScriptCore/runtime/StructureChain.cpp
+++ b/Source/JavaScriptCore/runtime/StructureChain.cpp
@@ -27,6 +27,7 @@
#include "StructureChain.h"
#include "JSObject.h"
+#include "Operations.h"
#include "Structure.h"
#include <wtf/RefPtr.h>
diff --git a/Source/JavaScriptCore/runtime/TimeoutChecker.cpp b/Source/JavaScriptCore/runtime/TimeoutChecker.cpp
index 56d6d4b..83bc595 100644
--- a/Source/JavaScriptCore/runtime/TimeoutChecker.cpp
+++ b/Source/JavaScriptCore/runtime/TimeoutChecker.cpp
@@ -32,6 +32,7 @@
#include "CallFrame.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
#if OS(DARWIN)
#include <mach/mach.h>
diff --git a/Source/JavaScriptCore/testRegExp.cpp b/Source/JavaScriptCore/testRegExp.cpp
index 527c935..e735da1 100644
--- a/Source/JavaScriptCore/testRegExp.cpp
+++ b/Source/JavaScriptCore/testRegExp.cpp
@@ -24,6 +24,7 @@
#include <wtf/CurrentTime.h>
#include "InitializeThreading.h"
#include "JSGlobalObject.h"
+#include "Operations.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>