The JITThunks class should be in its own file, and doing so should not break the...
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Jan 2013 04:47:03 +0000 (04:47 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Jan 2013 04:47:03 +0000 (04:47 +0000)
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: https://svn.webkit.org/repository/webkit/trunk@139541 268f45cc-cd09-0410-ab3c-d52691b4dbfc

188 files changed:
Source/JavaScriptCore/API/JSBase.cpp
Source/JavaScriptCore/API/JSCallbackConstructor.cpp
Source/JavaScriptCore/API/JSCallbackFunction.cpp
Source/JavaScriptCore/API/JSCallbackObject.cpp
Source/JavaScriptCore/API/JSClassRef.cpp
Source/JavaScriptCore/API/JSContextRef.cpp
Source/JavaScriptCore/API/JSObjectRef.cpp
Source/JavaScriptCore/API/JSScriptRef.cpp
Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JSCTypedArrayStubs.h
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/bytecode/ArrayAllocationProfile.cpp
Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeOrigin.cpp
Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp
Source/JavaScriptCore/bytecode/ResolveGlobalStatus.cpp
Source/JavaScriptCore/bytecode/SpeculatedType.cpp
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/debugger/Debugger.cpp
Source/JavaScriptCore/debugger/DebuggerActivation.cpp
Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
Source/JavaScriptCore/dfg/DFGArrayMode.cpp
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
Source/JavaScriptCore/dfg/DFGDriver.cpp
Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
Source/JavaScriptCore/dfg/DFGGraph.cpp
Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
Source/JavaScriptCore/dfg/DFGOSREntry.cpp
Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp
Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp
Source/JavaScriptCore/heap/CopiedBlock.h
Source/JavaScriptCore/heap/CopiedSpace.cpp
Source/JavaScriptCore/heap/HandleSet.cpp
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/HeapStatistics.cpp
Source/JavaScriptCore/heap/MarkedBlock.cpp
Source/JavaScriptCore/heap/SlotVisitor.cpp
Source/JavaScriptCore/heap/WeakBlock.cpp
Source/JavaScriptCore/interpreter/CallFrame.cpp
Source/JavaScriptCore/interpreter/CallFrame.h
Source/JavaScriptCore/jit/ClosureCallStubRoutine.cpp
Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp
Source/JavaScriptCore/jit/JIT.cpp
Source/JavaScriptCore/jit/JITArithmetic.cpp
Source/JavaScriptCore/jit/JITArithmetic32_64.cpp
Source/JavaScriptCore/jit/JITCall.cpp
Source/JavaScriptCore/jit/JITCall32_64.cpp
Source/JavaScriptCore/jit/JITCode.h
Source/JavaScriptCore/jit/JITExceptions.cpp
Source/JavaScriptCore/jit/JITStubs.h
Source/JavaScriptCore/jit/JITThunks.h
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/llint/LLIntExceptions.cpp
Source/JavaScriptCore/profiler/LegacyProfiler.cpp
Source/JavaScriptCore/profiler/ProfileGenerator.cpp
Source/JavaScriptCore/profiler/ProfilerBytecode.cpp
Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp
Source/JavaScriptCore/profiler/ProfilerCompilation.cpp
Source/JavaScriptCore/profiler/ProfilerCompiledBytecode.cpp
Source/JavaScriptCore/profiler/ProfilerDatabase.cpp
Source/JavaScriptCore/profiler/ProfilerOSRExit.cpp
Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp
Source/JavaScriptCore/profiler/ProfilerOrigin.cpp
Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp
Source/JavaScriptCore/profiler/ProfilerProfiledBytecodes.cpp
Source/JavaScriptCore/runtime/ArgList.cpp
Source/JavaScriptCore/runtime/Arguments.cpp
Source/JavaScriptCore/runtime/ArrayConstructor.cpp
Source/JavaScriptCore/runtime/BooleanConstructor.cpp
Source/JavaScriptCore/runtime/BooleanObject.cpp
Source/JavaScriptCore/runtime/BooleanPrototype.cpp
Source/JavaScriptCore/runtime/CallData.cpp
Source/JavaScriptCore/runtime/CodeCache.cpp
Source/JavaScriptCore/runtime/Completion.cpp
Source/JavaScriptCore/runtime/ConstructData.cpp
Source/JavaScriptCore/runtime/DateConstructor.cpp
Source/JavaScriptCore/runtime/DateInstance.cpp
Source/JavaScriptCore/runtime/DatePrototype.cpp
Source/JavaScriptCore/runtime/Error.cpp
Source/JavaScriptCore/runtime/ErrorConstructor.cpp
Source/JavaScriptCore/runtime/ErrorInstance.cpp
Source/JavaScriptCore/runtime/ErrorPrototype.cpp
Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
Source/JavaScriptCore/runtime/Executable.cpp
Source/JavaScriptCore/runtime/FunctionConstructor.cpp
Source/JavaScriptCore/runtime/FunctionPrototype.cpp
Source/JavaScriptCore/runtime/GetterSetter.cpp
Source/JavaScriptCore/runtime/Identifier.cpp
Source/JavaScriptCore/runtime/InternalFunction.cpp
Source/JavaScriptCore/runtime/JSActivation.cpp
Source/JavaScriptCore/runtime/JSBoundFunction.cpp
Source/JavaScriptCore/runtime/JSCell.cpp
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSCellInlines.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/JSDateMath.cpp
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSFunction.h
Source/JavaScriptCore/runtime/JSGlobalData.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
Source/JavaScriptCore/runtime/JSLock.cpp
Source/JavaScriptCore/runtime/JSNameScope.cpp
Source/JavaScriptCore/runtime/JSNotAnObject.cpp
Source/JavaScriptCore/runtime/JSONObject.cpp
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/JSProxy.cpp
Source/JavaScriptCore/runtime/JSScope.cpp
Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp
Source/JavaScriptCore/runtime/JSString.h
Source/JavaScriptCore/runtime/JSStringJoiner.cpp
Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp
Source/JavaScriptCore/runtime/JSValue.cpp
Source/JavaScriptCore/runtime/JSValueInlines.h
Source/JavaScriptCore/runtime/JSVariableObject.cpp
Source/JavaScriptCore/runtime/JSWithScope.cpp
Source/JavaScriptCore/runtime/JSWrapperObject.cpp
Source/JavaScriptCore/runtime/LiteralParser.cpp
Source/JavaScriptCore/runtime/Lookup.cpp
Source/JavaScriptCore/runtime/NameConstructor.cpp
Source/JavaScriptCore/runtime/NameInstance.cpp
Source/JavaScriptCore/runtime/NamePrototype.cpp
Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
Source/JavaScriptCore/runtime/NumberConstructor.cpp
Source/JavaScriptCore/runtime/NumberObject.cpp
Source/JavaScriptCore/runtime/ObjectConstructor.cpp
Source/JavaScriptCore/runtime/ObjectPrototype.cpp
Source/JavaScriptCore/runtime/Operations.h
Source/JavaScriptCore/runtime/PropertySlot.cpp
Source/JavaScriptCore/runtime/RegExp.cpp
Source/JavaScriptCore/runtime/RegExpCache.cpp
Source/JavaScriptCore/runtime/RegExpCachedResult.cpp
Source/JavaScriptCore/runtime/RegExpConstructor.cpp
Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
Source/JavaScriptCore/runtime/RegExpObject.cpp
Source/JavaScriptCore/runtime/RegExpPrototype.cpp
Source/JavaScriptCore/runtime/SmallStrings.cpp
Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
Source/JavaScriptCore/runtime/StrictEvalActivation.cpp
Source/JavaScriptCore/runtime/StringConstructor.cpp
Source/JavaScriptCore/runtime/StringObject.cpp
Source/JavaScriptCore/runtime/StringRecursionChecker.cpp
Source/JavaScriptCore/runtime/Structure.h
Source/JavaScriptCore/runtime/StructureChain.cpp
Source/JavaScriptCore/runtime/TimeoutChecker.cpp
Source/JavaScriptCore/testRegExp.cpp
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/BindingState.h
Source/WebCore/bindings/js/JSArrayBufferViewHelper.h
Source/WebCore/bindings/js/JSCustomXPathNSResolver.h
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSDOMGlobalObject.h
Source/WebCore/bindings/js/JSDictionary.h
Source/WebCore/bindings/js/JSMessagePortCustom.h
Source/WebCore/bindings/js/JSNodeFilterCondition.h
Source/WebCore/bindings/js/ScriptValue.h
Source/WebCore/bindings/js/ScriptWrappable.h
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/bridge/c/c_utility.h
Source/WebCore/bridge/jsc/BridgeJSC.h
Source/WebCore/dom/Node.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLImageLoader.cpp
Source/WebCore/plugins/efl/PluginViewEfl.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebKit/efl/ewk/EWebKit.h
Source/WebKit/efl/ewk/ewk_main.cpp
Source/WebKit2/Shared/APIObject.cpp
Source/WebKit2/Shared/linux/WebMemorySamplerLinux.cpp
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp

index 677c681..d9886f2 100644 (file)
 
 #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;
index c43182e..ed5c567 100644 (file)
 
 #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 {
index aada87b..e4d0bed 100644 (file)
 #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 {
index 76866fe..e8c2975 100644 (file)
@@ -28,6 +28,7 @@
 #include "JSCallbackObject.h"
 
 #include "Heap.h"
+#include "Operations.h"
 #include <wtf/text/StringHash.h>
 
 namespace JSC {
index f30b02a..4f41347 100644 (file)
 #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>
 
index 162c825..3ce6da9 100644 (file)
@@ -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>
 
index c62efc6..d27f867 100644 (file)
@@ -49,6 +49,7 @@
 #include "JSString.h"
 #include "JSValueRef.h"
 #include "ObjectPrototype.h"
+#include "Operations.h"
 #include "PropertyNameArray.h"
 #include "RegExpConstructor.h"
 
index 9789860..1d65c33 100644 (file)
@@ -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"
index bdfce08..9d1e834 100644 (file)
@@ -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>
 
index 19970b3..c990f49 100644 (file)
@@ -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
index 91481fa..fdc3ead 100644 (file)
@@ -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>
index 332e497..f3fba42 100644 (file)
                                RelativePath="..\..\jit\JITStubs.h"
                                >
                        </File>
-                       <File
                                RelativePath="..\..\jit\JITThunks.cpp"
                                >
                        </File>
index cead0bf..2149910 100644 (file)
                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, ); }; };
                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>"; };
                                86FA9E90142BBB2E001773B7 /* JSBoundFunction.h */,
                                BC7F8FBA0E19D1EF008632C0 /* JSCell.cpp */,
                                BC1167D80E19BCC9008066DD /* JSCell.h */,
+                               0F97496F1687ADE200A4FF6A /* JSCellInlines.h */,
                                9788FC221471AD0C0068CE2D /* JSDateMath.cpp */,
                                9788FC231471AD0C0068CE2D /* JSDateMath.h */,
                                C2A7F687160432D400F76B98 /* JSDestructibleObject.h */,
                                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;
                };
index aa682da..6d9afda 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "ArrayAllocationProfile.h"
 
+#include "Operations.h"
+
 namespace JSC {
 
 void ArrayAllocationProfile::updateIndexingType()
index c90f9c7..1c1143e 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CodeBlock.h"
 #include "LLIntCallLinkInfo.h"
+#include "Operations.h"
 #include <wtf/CommaPrinter.h>
 
 namespace JSC {
index f54d7e2..1102a5b 100644 (file)
@@ -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"
index 52b8e30..6e8acd2 100644 (file)
@@ -29,6 +29,7 @@
 #include "CallFrame.h"
 #include "CodeBlock.h"
 #include "Executable.h"
+#include "Operations.h"
 
 namespace JSC {
 
index d17c173..b10be90 100644 (file)
@@ -30,6 +30,7 @@
 #include "JSScope.h"
 #include "LLIntData.h"
 #include "LowLevelInterpreter.h"
+#include "Operations.h"
 
 namespace JSC {
 
index f923e4a..97b8f3b 100644 (file)
@@ -28,6 +28,8 @@
 
 #if ENABLE(VALUE_PROFILER)
 
+#include "Operations.h"
+
 namespace JSC {
 
 CompressedLazyOperandValueProfileHolder::CompressedLazyOperandValueProfileHolder() { }
index 7814f8c..0cee38d 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CodeBlock.h"
 #include "JSValue.h"
+#include "Operations.h"
 #include "Structure.h"
 
 namespace JSC {
index a07ca2b..7b78592 100644 (file)
@@ -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>
index 0be6737..5ceaac7 100644 (file)
@@ -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"
index 5072416..81456fc 100644 (file)
@@ -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>
index 7eda52d..2bfa256 100644 (file)
@@ -26,6 +26,7 @@
 #include "Interpreter.h"
 #include "JSFunction.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 #include "Parser.h"
 #include "Protect.h"
 
index e234680..2c173f7 100644 (file)
@@ -27,6 +27,7 @@
 #include "DebuggerActivation.h"
 
 #include "JSActivation.h"
+#include "Operations.h"
 
 namespace JSC {
 
index e924ad3..d898b17 100644 (file)
@@ -32,6 +32,7 @@
 #include "JSFunction.h"
 #include "CodeBlock.h"
 #include "Interpreter.h"
+#include "Operations.h"
 #include "Parser.h"
 
 namespace JSC {
index cef9e3d..7d635ac 100644 (file)
@@ -35,6 +35,7 @@
 #include "DFGPhase.h"
 #include "DFGValidate.h"
 #include "DFGVariableAccessDataDump.h"
+#include "Operations.h"
 #include <wtf/HashSet.h>
 #include <wtf/HashMap.h>
 
index a8323ba..b23b042 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "DFGAbstractValue.h"
 #include "DFGGraph.h"
+#include "Operations.h"
 
 namespace JSC { namespace DFG {
 
index ebf9569..3e31c3d 100644 (file)
@@ -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>
index 9fb8c5b..baeaafd 100644 (file)
@@ -34,6 +34,7 @@
 #include "DFGInsertionSet.h"
 #include "DFGPhase.h"
 #include "GetByIdStatus.h"
+#include "Operations.h"
 #include "PutByIdStatus.h"
 
 namespace JSC { namespace DFG {
index 42b5b79..3a67a42 100644 (file)
@@ -44,6 +44,7 @@
 #include "DFGStructureCheckHoistingPhase.h"
 #include "DFGValidate.h"
 #include "DFGVirtualRegisterAllocationPhase.h"
+#include "Operations.h"
 #include "Options.h"
 
 namespace JSC { namespace DFG {
index 629ccf3..8228e81 100644 (file)
@@ -31,6 +31,7 @@
 #include "DFGGraph.h"
 #include "DFGInsertionSet.h"
 #include "DFGPhase.h"
+#include "Operations.h"
 
 namespace JSC { namespace DFG {
 
index f67fce4..a86b78f 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CodeBlock.h"
 #include "DFGVariableAccessDataDump.h"
+#include "Operations.h"
 
 #if ENABLE(DFG_JIT)
 
index 5c4e8cc..2842599 100644 (file)
@@ -36,6 +36,7 @@
 #include "DFGSpeculativeJIT.h"
 #include "DFGThunks.h"
 #include "JSGlobalData.h"
+#include "JSValueInlines.h"
 #include "LinkBuffer.h"
 
 namespace JSC { namespace DFG {
index a991228..b30f1f0 100644 (file)
@@ -32,6 +32,7 @@
 #include "CodeBlock.h"
 #include "DFGNode.h"
 #include "JIT.h"
+#include "Operations.h"
 
 namespace JSC { namespace DFG {
 
index 81f8a48..ca96ce9 100644 (file)
@@ -31,6 +31,7 @@
 #include "CallFrame.h"
 #include "DFGCommon.h"
 #include "LinkBuffer.h"
+#include "Operations.h"
 #include "RepatchBuffer.h"
 #include <wtf/StringPrintStream.h>
 
index d1a6881..4dfb090 100644 (file)
@@ -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 {
index e768fe8..e4d3fbf 100644 (file)
@@ -29,6 +29,7 @@
 #if ENABLE(DFG_JIT) && USE(JSVALUE64)
 
 #include "DFGOperations.h"
+#include "Operations.h"
 #include <wtf/DataLog.h>
 
 namespace JSC { namespace DFG {
index 64f788c..ae0992e 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "DFGGraph.h"
 #include "DFGPhase.h"
+#include "Operations.h"
 
 namespace JSC { namespace DFG {
 
index bd3fda2..fcacecf 100644 (file)
@@ -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 @@ void SpeculativeJIT::clearGenerationInfo()
     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()) {
index 5ea1076..63e3520 100644 (file)
@@ -332,275 +332,10 @@ public:
     // 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)
index 05ca69a..5d755b3 100644 (file)
@@ -34,6 +34,7 @@
 #include "DFGSlowPathGenerator.h"
 #include "JSActivation.h"
 #include "ObjectPrototype.h"
+#include "Operations.h"
 
 namespace JSC { namespace DFG {
 
index dffbd08..869ad32 100644 (file)
@@ -32,6 +32,7 @@
 #include "ArrayPrototype.h"
 #include "DFGCallArrayAllocatorSlowPathGenerator.h"
 #include "DFGSlowPathGenerator.h"
+#include "JSValueInlines.h"
 #include "ObjectPrototype.h"
 
 namespace JSC { namespace DFG {
index d3a239e..a70f56a 100644 (file)
@@ -33,6 +33,7 @@
 #include "DFGInsertionSet.h"
 #include "DFGPhase.h"
 #include "DFGVariableAccessDataDump.h"
+#include "Operations.h"
 #include <wtf/HashMap.h>
 
 namespace JSC { namespace DFG {
index d8652af..72b881f 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "CodeBlock.h"
 #include "DFGValueSource.h"
+#include "Operations.h"
 #include <wtf/DataLog.h>
 
 namespace JSC { namespace DFG {
index cc60a01..bd5784b 100644 (file)
@@ -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>
index b235de1..f7afbdd 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CopiedSpaceInlines.h"
 #include "GCActivityCallback.h"
+#include "Operations.h"
 #include "Options.h"
 
 namespace JSC {
index a6ccf29..dad0a7b 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "HeapRootVisitor.h"
 #include "JSObject.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 6cf7050..83b9de7 100644 (file)
@@ -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"
index 2b98fe7..55e3e9d 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "Heap.h"
 #include "JSObject.h"
+#include "Operations.h"
 #include "Options.h"
 #include <stdlib.h>
 #if OS(UNIX)
index 9a036f8..0b7f719 100644 (file)
@@ -29,7 +29,7 @@
 #include "IncrementalSweeper.h"
 #include "JSCell.h"
 #include "JSDestructibleObject.h"
-
+#include "Operations.h"
 
 namespace JSC {
 
index 3ff4b48..81c31e2 100644 (file)
@@ -11,6 +11,7 @@
 #include "JSGlobalData.h"
 #include "JSObject.h"
 #include "JSString.h"
+#include "Operations.h"
 #include <wtf/StackStats.h>
 
 namespace JSC {
index 5f01f34..9570905 100644 (file)
@@ -29,7 +29,7 @@
 #include "Heap.h"
 #include "HeapRootVisitor.h"
 #include "JSObject.h"
-
+#include "Operations.h"
 #include "Structure.h"
 
 namespace JSC {
index da506c3..3afe610 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CodeBlock.h"
 #include "Interpreter.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 2b0ea3a..120d085 100644 (file)
@@ -27,6 +27,7 @@
 #include "JSGlobalData.h"
 #include "JSStack.h"
 #include "MacroAssemblerCodeRef.h"
+#include "Register.h"
 
 namespace JSC  {
 
index 73704aa..7cf84f5 100644 (file)
@@ -31,6 +31,7 @@
 #include "Executable.h"
 #include "Heap.h"
 #include "JSGlobalData.h"
+#include "Operations.h"
 #include "SlotVisitor.h"
 #include "Structure.h"
 
index 521e497..ce21a2f 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "Heap.h"
 #include "JSGlobalData.h"
+#include "Operations.h"
 #include "SlotVisitor.h"
 #include "Structure.h"
 
index 1188d3a..ec636fb 100644 (file)
@@ -43,6 +43,7 @@ JSC::MacroAssemblerX86Common::SSE2CheckState JSC::MacroAssemblerX86Common::s_sse
 #include "JSArray.h"
 #include "JSFunction.h"
 #include "LinkBuffer.h"
+#include "Operations.h"
 #include "RepatchBuffer.h"
 #include "ResultType.h"
 #include "SamplingTool.h"
index bcb3dd7..9077d02 100644 (file)
@@ -35,6 +35,7 @@
 #include "JSArray.h"
 #include "JSFunction.h"
 #include "Interpreter.h"
+#include "Operations.h"
 #include "ResultType.h"
 #include "SamplingTool.h"
 
index 960d060..7f75dba 100644 (file)
@@ -36,6 +36,7 @@
 #include "JSArray.h"
 #include "JSFunction.h"
 #include "Interpreter.h"
+#include "Operations.h"
 #include "ResultType.h"
 #include "SamplingTool.h"
 
index c616f55..cdd7528 100644 (file)
@@ -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"
index a29f650..90395b2 100644 (file)
@@ -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"
index 89bbbcb..78ae8ae 100644 (file)
@@ -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
index aeb8694..c48e09a 100644 (file)
@@ -31,6 +31,7 @@
 #include "Interpreter.h"
 #include "JSGlobalData.h"
 #include "JSValue.h"
+#include "Operations.h"
 
 #if ENABLE(JIT) || ENABLE(LLINT)
 
index 4920811..f7a30d4 100644 (file)
@@ -36,8 +36,6 @@
 #include "MacroAssemblerCodeRef.h"
 #include "Register.h"
 #include "ResolveOperation.h"
-#include "ThunkGenerators.h"
-#include <wtf/HashMap.h>
 
 namespace JSC {
 
index 0f73809..10f74ea 100644 (file)
 #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 {
 
index dea9fd4..e243a78 100644 (file)
@@ -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>
index 17c15aa..0192070 100644 (file)
@@ -34,6 +34,7 @@
 #include "JITExceptions.h"
 #include "LLIntCommon.h"
 #include "LowLevelInterpreter.h"
+#include "Operations.h"
 
 namespace JSC { namespace LLInt {
 
index 0b66d48..22d4a42 100644 (file)
@@ -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"
index c3b1d25..d240aff 100644 (file)
@@ -33,6 +33,7 @@
 #include "JSFunction.h"
 #include "Interpreter.h"
 #include "LegacyProfiler.h"
+#include "Operations.h"
 #include "Profile.h"
 #include "Tracing.h"
 
index 2bc99b9..3755a27 100644 (file)
@@ -27,6 +27,7 @@
 #include "ProfilerBytecode.h"
 
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 namespace JSC { namespace Profiler {
 
index 49205b8..afd567b 100644 (file)
@@ -29,6 +29,7 @@
 #include "CodeBlock.h"
 #include "JSGlobalObject.h"
 #include "Operands.h"
+#include "Operations.h"
 #include <wtf/StringPrintStream.h>
 
 namespace JSC { namespace Profiler {
index d3156e3..481f4de 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CodeBlock.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 #include <wtf/StringPrintStream.h>
 
 namespace JSC { namespace Profiler {
index 743f63e..c70152c 100644 (file)
@@ -27,6 +27,7 @@
 #include "ProfilerCompilation.h"
 
 #include "JSGlobalObject.h"
+#include "Operations.h"
 #include "ProfilerDatabase.h"
 #include <wtf/StringPrintStream.h>
 
index 01902f1..b8f5a85 100644 (file)
@@ -27,6 +27,7 @@
 #include "ProfilerCompiledBytecode.h"
 
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 namespace JSC { namespace Profiler {
 
index 0d07894..c4a334d 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CodeBlock.h"
 #include "JSONObject.h"
+#include "Operations.h"
 
 namespace JSC { namespace Profiler {
 
index da0398d..5fe13f7 100644 (file)
@@ -27,6 +27,7 @@
 #include "ProfilerOSRExit.h"
 
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 namespace JSC { namespace Profiler {
 
index da0849c..d54f7a2 100644 (file)
@@ -29,6 +29,7 @@
 #include "JSGlobalObject.h"
 #include "JSScope.h"
 #include "JSString.h"
+#include "Operations.h"
 #include <wtf/StringPrintStream.h>
 
 namespace JSC { namespace Profiler {
index 449869a..ffbcf28 100644 (file)
@@ -27,6 +27,7 @@
 #include "ProfilerOrigin.h"
 
 #include "JSGlobalObject.h"
+#include "Operations.h"
 #include "ProfilerBytecodes.h"
 #include "ProfilerDatabase.h"
 
index 66d9e02..018ceeb 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CodeOrigin.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 #include "ProfilerDatabase.h"
 
 namespace JSC { namespace Profiler {
index ac9f650..d072e4f 100644 (file)
@@ -27,6 +27,7 @@
 #include "ProfilerProfiledBytecodes.h"
 
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 namespace JSC { namespace Profiler {
 
index 301abd5..194e515 100644 (file)
@@ -24,7 +24,7 @@
 #include "HeapRootVisitor.h"
 #include "JSValue.h"
 #include "JSObject.h"
-
+#include "Operations.h"
 
 using std::min;
 
index ba73b2c..1b7c7e0 100644 (file)
@@ -28,6 +28,7 @@
 #include "JSActivation.h"
 #include "JSFunction.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 using namespace std;
 
index a3fce45..9aa8c1a 100644 (file)
@@ -32,6 +32,7 @@
 #include "JSArray.h"
 #include "JSFunction.h"
 #include "Lookup.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 0485350..d638a92 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "BooleanPrototype.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 3559938..100047d 100644 (file)
@@ -22,6 +22,7 @@
 #include "BooleanObject.h"
 
 #include "JSScope.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 94507f9..5bf48a5 100644 (file)
@@ -26,6 +26,7 @@
 #include "JSFunction.h"
 #include "JSString.h"
 #include "ObjectPrototype.h"
+#include "Operations.h"
 
 namespace JSC {
 
index ff71fa0..8e1d194 100644 (file)
@@ -29,6 +29,7 @@
 #include "Executable.h"
 #include "Interpreter.h"
 #include "JSFunction.h"
+#include "Operations.h"
 
 namespace JSC {
 
index e25e3e2..f125175 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "BytecodeGenerator.h"
 #include "CodeSpecializationKind.h"
+#include "Operations.h"
 #include "Parser.h"
 #include "StrongInlines.h"
 #include "UnlinkedCodeBlock.h"
index 3de8d48..e354549 100644 (file)
 
 #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>
 
index 5da2a91..3dc4618 100644 (file)
@@ -30,6 +30,7 @@
 #include "Interpreter.h"
 #include "JSFunction.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 9a162e9..6c8ae88 100644 (file)
@@ -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>
index 47a19df..bde416e 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "JSDateMath.h"
 #include "JSGlobalObject.h"
-
+#include "JSValueInlines.h"
 #include <math.h>
 #include <wtf/MathExtras.h>
 
index 75da466..52d77e9 100644 (file)
@@ -31,6 +31,7 @@
 #include "JSGlobalObject.h"
 #include "JSString.h"
 #include "JSStringBuilder.h"
+#include "JSValueInlines.h"
 #include "Lookup.h"
 #include "ObjectPrototype.h"
 
index 68ae12d..6855844 100644 (file)
@@ -34,6 +34,7 @@
 #include "JSObject.h"
 #include "JSString.h"
 #include "NativeErrorConstructor.h"
+#include "Operations.h"
 #include "SourceCode.h"
 
 #include <wtf/text/StringBuilder.h>
index f2578a4..0023196 100644 (file)
@@ -24,6 +24,7 @@
 #include "ErrorPrototype.h"
 #include "JSGlobalObject.h"
 #include "JSString.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 9c0fe3e..f2f1d58 100644 (file)
@@ -22,6 +22,7 @@
 #include "ErrorInstance.h"
 
 #include "JSScope.h"
+#include "Operations.h"
 
 namespace JSC {
 
index a30efdc..62a4d8c 100644 (file)
@@ -26,6 +26,7 @@
 #include "JSString.h"
 #include "JSStringBuilder.h"
 #include "ObjectPrototype.h"
+#include "Operations.h"
 #include "StringRecursionChecker.h"
 
 namespace JSC {
index a4368a2..0dd4f07 100644 (file)
@@ -37,6 +37,7 @@
 #include "JSNotAnObject.h"
 #include "Interpreter.h"
 #include "Nodes.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 52c9c39..99b770d 100644 (file)
@@ -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>
index bf74c0a..ad95a2c 100644 (file)
@@ -29,6 +29,7 @@
 #include "JSString.h"
 #include "Lexer.h"
 #include "Nodes.h"
+#include "Operations.h"
 #include "Parser.h"
 #include <wtf/text/StringBuilder.h>
 
index 8e4390b..58b81c3 100644 (file)
@@ -29,6 +29,7 @@
 #include "JSStringBuilder.h"
 #include "Interpreter.h"
 #include "Lexer.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 8ed5825..b465114 100644 (file)
@@ -24,6 +24,7 @@
 #include "GetterSetter.h"
 
 #include "JSObject.h"
+#include "Operations.h"
 #include <wtf/Assertions.h>
 
 namespace JSC {
index 583c12b..b8350f7 100644 (file)
@@ -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>
index afb5e63..5b9e099 100644 (file)
@@ -26,6 +26,7 @@
 #include "FunctionPrototype.h"
 #include "JSGlobalObject.h"
 #include "JSString.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 46e4609..6f7ca67 100644 (file)
@@ -32,6 +32,7 @@
 #include "Arguments.h"
 #include "Interpreter.h"
 #include "JSFunction.h"
+#include "Operations.h"
 
 using namespace std;
 
index bb1af9d..0aafe1f 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "GetterSetter.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 namespace JSC {
 
index f6f4d71..71bb3c4 100644 (file)
@@ -27,6 +27,7 @@
 #include "JSString.h"
 #include "JSObject.h"
 #include "NumberObject.h"
+#include "Operations.h"
 #include <wtf/MathExtras.h>
 
 namespace JSC {
index b28fedd..9f9356e 100644 (file)
 #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 @@ private:
     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 (file)
index 0000000..2614e55
--- /dev/null
@@ -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
+
index cd3948f..4e658bc 100644 (file)
@@ -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>
index 810abdd..01d7003 100644 (file)
@@ -36,6 +36,7 @@
 #include "JSNotAnObject.h"
 #include "Interpreter.h"
 #include "ObjectPrototype.h"
+#include "Operations.h"
 #include "Parser.h"
 #include "PropertyNameArray.h"
 
index 322ee58..b36e0b7 100644 (file)
@@ -191,11 +191,6 @@ namespace JSC {
         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
index 261557a..9e507f7 100644 (file)
@@ -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 @@ namespace JSC {
     class CodeBlock;
     class CodeCache;
     class CommonIdentifiers;
+    class ExecState;
     class HandleStack;
     class IdentifierTable;
     class Interpreter;
@@ -189,7 +191,7 @@ namespace JSC {
 
         GlobalDataType globalDataType;
         ClientData* clientData;
-        CallFrame* topCallFrame;
+        ExecState* topCallFrame;
 
         const HashTable* arrayConstructorTable;
         const HashTable* arrayPrototypeTable;
@@ -309,7 +311,7 @@ namespace JSC {
 
         ReturnAddressPtr exceptionLocation;
         JSValue hostCallReturnValue;
-        CallFrame* callFrameForThrow;
+        ExecState* callFrameForThrow;
         void* targetMachinePCForThrow;
         Instruction* targetInterpreterPCForThrow;
 #if ENABLE(DFG_JIT)
index 7775544..c8b10f4 100644 (file)
@@ -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"
index 1010ad2..bcfb04f 100644 (file)
@@ -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>
index 5e3d12c..971833e 100644 (file)
@@ -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>
index 335631f..0ee191a 100644 (file)
@@ -27,6 +27,7 @@
 #include "JSNameScope.h"
 
 #include "Error.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 53592ba..29c8e5c 100644 (file)
@@ -30,6 +30,7 @@
 #include "config.h"
 #include "JSNotAnObject.h"
 
+#include "Operations.h"
 #include <wtf/UnusedParam.h>
 
 namespace JSC {
index e051ec7..0b50133 100644 (file)
@@ -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>
index 5af8b0b..83dd696 100644 (file)
@@ -1152,27 +1152,6 @@ inline JSValue JSObject::prototype() const
     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 @@ ALWAYS_INLINE bool JSObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, P
     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 @@ inline JSValue JSObject::toPrimitive(ExecState* exec, PreferredPrimitiveType pre
     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())
index 7108dcf..86300ba 100644 (file)
@@ -27,6 +27,7 @@
 #include "JSProxy.h"
 
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 685009b..b9c7b2a 100644 (file)
@@ -30,6 +30,7 @@
 #include "JSGlobalObject.h"
 #include "JSNameScope.h"
 #include "JSWithScope.h"
+#include "Operations.h"
 
 namespace JSC {
 
index c65d2b1..01c0704 100644 (file)
@@ -29,6 +29,8 @@
 #include "config.h"
 #include "JSSegmentedVariableObject.h"
 
+#include "Operations.h"
+
 namespace JSC {
 
 int JSSegmentedVariableObject::findRegisterIndex(void* registerAddress)
index c4ea552..1f9693b 100644 (file)
@@ -491,13 +491,6 @@ namespace JSC {
 
     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
index cbf9ba4..5b1f28d 100644 (file)
@@ -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.
index 7dcde47..b641c58 100644 (file)
@@ -32,6 +32,7 @@
 #include "JSActivation.h"
 #include "JSGlobalObject.h"
 #include "JSNameScope.h"
+#include "Operations.h"
 #include "PropertyNameArray.h"
 
 namespace JSC {
index 0874971..846ddbc 100644 (file)
@@ -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>
index c5a42f6..afae5d1 100644 (file)
@@ -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
 #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();
-    }
-
-    inline double JSValue::asNumber() const
-    {
-        ASSERT(isNumber());
-        return isInt32() ? asInt32() : asDouble();
-    }
-
-    inline JSValue jsNaN()
-    {
-        return JSValue(QNaN);
-    }
-
-    inline JSValue::JSValue(char i)
-    {
-        *this = JSValue(static_cast<int32_t>(i));
-    }
-
-    inline JSValue::JSValue(unsigned char i)
-    {
-        *this = JSValue(static_cast<int32_t>(i));
-    }
-
-    inline JSValue::JSValue(short i)
-    {
-        *this = JSValue(static_cast<int32_t>(i));
-    }
-
-    inline JSValue::JSValue(unsigned short 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(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 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 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 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;
-    }
+    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());
+    return asInt32();
+}
+
+inline double JSValue::asNumber() const
+{
+    ASSERT(isNumber());
+    return isInt32() ? asInt32() : asDouble();
+}
+
+inline JSValue jsNaN()
+{
+    return JSValue(QNaN);
+}
+
+inline JSValue::JSValue(char i)
+{
+    *this = JSValue(static_cast<int32_t>(i));
+}
+
+inline JSValue::JSValue(unsigned char i)
+{
+    *this = JSValue(static_cast<int32_t>(i));
+}
+
+inline JSValue::JSValue(short i)
+{
+    *this = JSValue(static_cast<int32_t>(i));
+}
+
+inline JSValue::JSValue(unsigned short 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(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 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 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 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()
-    {
-        u.asBits.tag = EmptyValueTag;
-        u.asBits.payload = 0;
-    }
-
-    inline JSValue::JSValue(JSNullTag)
-    {
-        u.asBits.tag = NullTag;
-        u.asBits.payload = 0;
-    }
+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(JSUndefinedTag)
+{
+    u.asBits.tag = UndefinedTag;
+    u.asBits.payload = 0;
+}
     
-    inline JSValue::JSValue(JSTrueTag)
-    {
-        u.asBits.tag = BooleanTag;
-        u.asBits.payload = 1;
-    }
+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 = 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 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 int32_t JSValue::payload() const
-    {
-        return u.asBits.payload;
-    }
+inline int32_t JSValue::payload() const
+{
+    return u.asBits.payload;
+}
     
-    inline int32_t JSValue::asInt32() const
-    {
-        ASSERT(isInt32());
-        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;
-    }
+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 JSValue::JSValue(EncodeAsDoubleTag, double d)
-    {
-        u.asDouble = d;
-    }
-
-    inline JSValue::JSValue(int i)
-    {
-        u.asBits.tag = Int32Tag;
-        u.asBits.payload = i;
-    }
+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;
+}
+
+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;
-    }
-
-    // 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(const JSCell* ptr)
-    {
-        u.asInt64 = reinterpret_cast<uintptr_t>(const_cast<JSCell*>(ptr));
-    }
-
-    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::isEmpty() const
-    {
-        return u.asInt64 == ValueEmpty;
-    }
-
-    inline bool JSValue::isUndefined() const
-    {
-        return asValue() == JSValue(JSUndefined);
-    }
-
-    inline bool JSValue::isNull() const
-    {
-        return asValue() == JSValue(JSNull);
-    }
-
-    inline bool JSValue::isTrue() const
-    {
-        return asValue() == JSValue(JSTrue);
-    }
-
-    inline bool JSValue::isFalse() const
-    {
-        return asValue() == JSValue(JSFalse);
-    }
-
-    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);
-    }
+// 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;
+}
+
+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::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::isEmpty() const
+{
+    return u.asInt64 == ValueEmpty;
+}
+
+inline bool JSValue::isUndefined() const
+{
+    return asValue() == JSValue(JSUndefined);
+}
+
+inline bool JSValue::isNull() const
+{
+    return asValue() == JSValue(JSNull);
+}
+
+inline bool JSValue::isTrue() const
+{
+    return asValue() == JSValue(JSTrue);
+}
+
+inline bool JSValue::isFalse() const
+{
+    return asValue() == JSValue(JSFalse);
+}
+
+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 bool JSValue::isDouble() const
+{
+    return isNumber() && !isInt32();
+}
+
+inline JSValue::JSValue(JSNullTag)
+{
+    u.asInt64 = ValueNull;
+}
+    
+inline JSValue::JSValue(JSUndefinedTag)
+{
+    u.asInt64 = ValueUndefined;
+}
+
+inline JSValue::JSValue(JSTrueTag)
+{
+    u.asInt64 = ValueTrue;
+}
+
+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::isBoolean() const
+{
+    return (u.asInt64 & ~1) == ValueFalse;
+}
+
+inline bool JSValue::isCell() const
+{
+    return !(u.asInt64 & TagMask);
+}
+
+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);
+}
+
+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 double JSValue::asDouble() const
+{
+    ASSERT(isDouble());
+    return reinterpretInt64ToDouble(u.asInt64 - DoubleEncodeOffset);
+}
+
+inline bool JSValue::isNumber() const
+{
+    return u.asInt64 & TagTypeNumber;
+}
+
+ALWAYS_INLINE JSCell* JSValue::asCell() const
+{
+    ASSERT(isCell());
+    return u.ptr;
+}
 
-    inline bool JSValue::isDouble() const
-    {
-        return isNumber() && !isInt32();
-    }
+#endif // USE(JSVALUE64)
 
-    inline JSValue::JSValue(JSNullTag)
-    {
-        u.asInt64 = ValueNull;
-    }
-    
-    inline JSValue::JSValue(JSUndefinedTag)
-    {
-        u.asInt64 = ValueUndefined;
-    }
+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());
+        }
 
-    inline JSValue::JSValue(JSTrueTag)
-    {
-        u.asInt64 = ValueTrue;
-    }
+        if (v2.isUndefinedOrNull()) {
+            if (!v1.isCell())
+                return false;
+            return v1.asCell()->structure()->masqueradesAsUndefined(exec->lexicalGlobalObject());
+        }
 
-    inline JSValue::JSValue(JSFalseTag)
-    {
-        u.asInt64 = ValueFalse;
-    }
+        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;
+        }
 
-    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;
-    }
+        if (v2.isObject()) {
+            JSValue p2 = v2.toPrimitive(exec);
+            if (exec->hadException())
+                return false;
+            v2 = p2;
+            if (v1.isInt32() && v2.isInt32())
+                return v1 == v2;
+            continue;
+        }
 
-    inline bool JSValue::isBoolean() const
-    {
-        return (u.asInt64 & ~1) == ValueFalse;
-    }
+        if (s1 || s2) {
+            double d1 = v1.toNumber(exec);
+            double d2 = v2.toNumber(exec);
+            return d1 == d2;
+        }
 
-    inline bool JSValue::isCell() const
-    {
-        return !(u.asInt64 & TagMask);
-    }
+        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());
+        }
 
-    inline bool JSValue::isInt32() const
-    {
-        return (u.asInt64 & TagTypeNumber) == TagTypeNumber;
-    }
+        return v1 == v2;
+    } while (true);
+}
 
-    inline int64_t reinterpretDoubleToInt64(double value)
-    {
-        return bitwise_cast<int64_t>(value);
-    }
-    inline double reinterpretInt64ToDouble(int64_t value)
-    {
-        return bitwise_cast<double>(value);
-    }
+// ECMA 11.9.3
+ALWAYS_INLINE bool JSValue::strictEqualSlowCaseInline(ExecState* exec, JSValue v1, JSValue v2)
+{
+    ASSERT(v1.isCell() && v2.isCell());
 
-    ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, double d)
-    {
-        u.asInt64 = reinterpretDoubleToInt64(d) + DoubleEncodeOffset;
-    }
+    if (v1.asCell()->isString() && v2.asCell()->isString())
+        return asString(v1)->value(exec) == asString(v2)->value(exec);
 
-    inline JSValue::JSValue(int i)
-    {
-        u.asInt64 = TagTypeNumber | static_cast<uint32_t>(i);
-    }
+    return v1 == v2;
+}
 
-    inline double JSValue::asDouble() const
-    {
-        ASSERT(isDouble());
-        return reinterpretInt64ToDouble(u.asInt64 - DoubleEncodeOffset);
-    }
+inline bool JSValue::strictEqual(ExecState* exec, JSValue v1, JSValue v2)
+{
+    if (v1.isInt32() && v2.isInt32())
+        return v1 == v2;
 
-    inline bool JSValue::isNumber() const
-    {
-        return u.asInt64 & TagTypeNumber;
-    }
+    if (v1.isNumber() && v2.isNumber())
+        return v1.asNumber() == v2.asNumber();
 
-    ALWAYS_INLINE JSCell* JSValue::asCell() const
-    {
-        ASSERT(isCell());
-        return u.ptr;
-    }
+    if (!v1.isCell() || !v2.isCell())
+        return v1 == v2;
 
-#endif // USE(JSVALUE64)
+    return strictEqualSlowCaseInline(exec, v1, v2);
+}
 
 } // namespace JSC
 
index 9b03a2c..fc262f5 100644 (file)
@@ -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) };
index 7d74e63..c0c6c1f 100644 (file)
@@ -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) };
index ff80c1e..01961a9 100644 (file)
@@ -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);
index bf27327..fb767ab 100644 (file)
@@ -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>
index e3bc7ad..067c5c0 100644 (file)
@@ -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 {
 
index b5facc7..387fcc1 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "JSGlobalObject.h"
 #include "NamePrototype.h"
+#include "Operations.h"
 
 namespace JSC {
 
index f257243..9d79ac2 100644 (file)
@@ -27,6 +27,7 @@
 #include "NameInstance.h"
 
 #include "JSScope.h"
+#include "Operations.h"
 
 namespace JSC {
 
index f14e585..5ebfef1 100644 (file)
@@ -27,6 +27,7 @@
 #include "NamePrototype.h"
 
 #include "Error.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 1f17308..929cc8c 100644 (file)
@@ -25,6 +25,7 @@
 #include "JSFunction.h"
 #include "JSString.h"
 #include "NativeErrorPrototype.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 296a86a..47eacf5 100644 (file)
@@ -24,6 +24,7 @@
 #include "JSGlobalObject.h"
 #include "JSString.h"
 #include "NativeErrorConstructor.h"
+#include "Operations.h"
 
 namespace JSC {
 
index daa643d..090a345 100644 (file)
@@ -25,6 +25,7 @@
 #include "Lookup.h"
 #include "NumberObject.h"
 #include "NumberPrototype.h"
+#include "Operations.h"
 
 namespace JSC {
 
index b87753d..83bf16c 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "JSGlobalObject.h"
 #include "NumberPrototype.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 7e74a91..1eb809b 100644 (file)
@@ -30,6 +30,7 @@
 #include "JSGlobalObject.h"
 #include "Lookup.h"
 #include "ObjectPrototype.h"
+#include "Operations.h"
 #include "PropertyDescriptor.h"
 #include "PropertyNameArray.h"
 
index e94edfa..b661dbe 100644 (file)
@@ -25,6 +25,7 @@
 #include "JSFunction.h"
 #include "JSString.h"
 #include "JSStringBuilder.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 4ff0741..a901d3e 100644 (file)
@@ -113,105 +113,6 @@ namespace JSC {
         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).
index 8ac8741..291ea48 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "JSFunction.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 3229f52..d5d4eab 100644 (file)
 #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 {
index 8acafba..14ce7ec 100644 (file)
@@ -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"
 
index 47cff15..10abaae 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "RegExpCachedResult.h"
 
+#include "Operations.h"
 #include "RegExpMatchesArray.h"
 
 namespace JSC {
index cc6ceb1..73c2577 100644 (file)
@@ -23,6 +23,7 @@
 #include "RegExpConstructor.h"
 
 #include "Error.h"
+#include "Operations.h"
 #include "RegExpMatchesArray.h"
 #include "RegExpPrototype.h"
 
index 19f3b81..568b440 100644 (file)
@@ -27,6 +27,7 @@
 #include "RegExpMatchesArray.h"
 
 #include "ButterflyInlines.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 00dd1ed..31e4c54 100644 (file)
@@ -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"
index e4bf2cf..a14b375 100644 (file)
@@ -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"
index 6552d7c..56a23b4 100644 (file)
@@ -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>
index 7f21e2c..94e407f 100644 (file)
@@ -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"
index b1f28c8..88da424 100644 (file)
@@ -27,6 +27,7 @@
 #include "StrictEvalActivation.h"
 
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 namespace JSC {
 
index 7f36a84..2741345 100644 (file)
@@ -25,6 +25,7 @@
 #include "JITCode.h"
 #include "JSFunction.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 #include "StringPrototype.h"
 
 namespace JSC {
index ab7d6cb..f41ac24 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "Error.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 #include "PropertyNameArray.h"
 
 namespace JSC {
index 22b7367..8835a5c 100644 (file)
@@ -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 {
 
index b06e772..9f6d210 100644 (file)
@@ -506,48 +506,6 @@ namespace JSC {
         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 @@ namespace JSC {
         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
index a1c9734..93f0c8d 100644 (file)
@@ -27,6 +27,7 @@
 #include "StructureChain.h"
 
 #include "JSObject.h"
+#include "Operations.h"
 #include "Structure.h"
 #include <wtf/RefPtr.h>
 
index 56d6d4b..83bc595 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "CallFrame.h"
 #include "JSGlobalObject.h"
+#include "Operations.h"
 
 #if OS(DARWIN)
 #include <mach/mach.h>
index 527c935..e735da1 100644 (file)
@@ -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>
index fd2a716..d9bc10d 100644 (file)
@@ -1,3 +1,35 @@
+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.
+
+        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:
+
 2013-01-11  Emil A Eklund  <eae@chromium.org>
 
         offsetWidth/height incorrect for images when zoomed
index 0dbabff..e79c6a2 100644 (file)
@@ -32,6 +32,7 @@
 #define BindingState_h
 
 #include <runtime/JSObject.h>
+#include <runtime/Operations.h>
 
 namespace WebCore {
 
index ba212df..3d79a1d 100644 (file)
@@ -35,6 +35,7 @@
 #include <runtime/Error.h>
 #include <runtime/JSObject.h>
 #include <runtime/JSValue.h>
+#include <runtime/Operations.h>
 #include <wtf/ArrayBufferView.h>
 #include <wtf/TypedArrayBase.h>
 
index 753f419..538d3ac 100644 (file)
@@ -30,6 +30,7 @@
 #include <heap/Strong.h>
 #include <heap/StrongInlines.h>
 #include <runtime/JSValue.h>
+#include <runtime/Operations.h>
 #include <wtf/Forward.h>
 #include <wtf/RefPtr.h>
 
index 2b111be..d2f4939 100644 (file)
@@ -43,6 +43,7 @@
 #include <runtime/JSArray.h>
 #include <runtime/Lookup.h>
 #include <runtime/ObjectPrototype.h>
+#include <runtime/Operations.h>
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/Vector.h>
index 9341dd0..d77f62d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 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
@@ -29,7 +29,7 @@
 
 #include "PlatformExportMacros.h"
 #include <runtime/JSGlobalObject.h>
-
+#include <runtime/Operations.h>
 
 namespace WebCore {
 
index 2e5875a..3fc0b86 100644 (file)
@@ -30,6 +30,7 @@
 #include <heap/Strong.h>
 #include <heap/StrongInlines.h>
 #include <interpreter/CallFrame.h>
+#include <runtime/Operations.h>
 #include <wtf/Forward.h>
 
 namespace WebCore {
index e76e76d..5feee9c 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "MessagePort.h"
 #include <runtime/JSValue.h>
+#include <runtime/Operations.h>
 #include <wtf/Forward.h>
 
 namespace WebCore {
index fef8684..7c571a2 100644 (file)
@@ -23,6 +23,7 @@
 #include "NodeFilterCondition.h"
 #include <heap/Weak.h>
 #include <runtime/JSValue.h>
+#include <runtime/Operations.h>
 #include <wtf/PassRefPtr.h>
 
 namespace WebCore {
index 0c324ca..2b35220 100644 (file)
@@ -36,6 +36,7 @@
 #include <heap/Strong.h>
 #include <heap/StrongInlines.h>
 #include <runtime/JSValue.h>
+#include <runtime/Operations.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
index 43f4eec..4df3b3d 100644 (file)
@@ -34,6 +34,7 @@
 #include "JSDOMWrapper.h"
 #include "WebCoreMemoryInstrumentation.h"
 #include <heap/Weak.h>
+#include <runtime/Operations.h>
 
 namespace WebCore {
 
index 6273fd1..02ba199 100644 (file)
@@ -60,6 +60,7 @@
 #include <runtime/DateInstance.h>
 #include <runtime/Error.h>
 #include <runtime/ExceptionHelpers.h>
+#include <runtime/Operations.h>
 #include <runtime/PropertyNameArray.h>
 #include <runtime/RegExp.h>
 #include <runtime/RegExpObject.h>
index 43cb16c..4468f34 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "npruntime_internal.h"
 #include <runtime/JSValue.h>
+#include <runtime/Operations.h>
 #include <wtf/Forward.h>
 
 namespace JSC {
index 39e6c98..ad74f6c 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "Bridge.h"
 #include <runtime/JSString.h>
+#include <runtime/Operations.h>
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
index 3da5e88..f9db2f8 100644 (file)
 
 #if USE(JSC)
 #include <runtime/JSGlobalData.h>
+#include <runtime/Operations.h>
 #endif
 
 #if ENABLE(MICRODATA)
index fc40414..cf4f6c1 100644 (file)
@@ -52,6 +52,7 @@
 
 #if USE(JSC)
 #include <runtime/JSLock.h>
+#include <runtime/Operations.h>
 #endif
 
 #if ENABLE(WEBGL)    
index 96f570d..573bd8c 100644 (file)
@@ -34,6 +34,7 @@
 #if USE(JSC)
 #include "JSDOMWindowBase.h"
 #include <runtime/JSLock.h>
+#include <runtime/Operations.h>
 #endif
 
 namespace WebCore {
index 4e1368f..877a074 100644 (file)
@@ -41,6 +41,7 @@
 #include "PluginPackage.h"
 #include "npruntime_impl.h"
 #include "runtime/JSLock.h"
+#include "runtime/Operations.h"
 #include <Ecore_Evas.h>
 #include <Ecore_X.h>
 #include <Evas.h>
index f88176d..1bef500 100644 (file)
@@ -73,6 +73,7 @@
 #include "JSDOMWindow.h"
 #include <heap/Strong.h>
 #include <runtime/JSLock.h>
+#include <runtime/Operations.h>
 #endif
 
 namespace WebCore {
index 7c91c3c..8633f76 100644 (file)
@@ -47,6 +47,6 @@
 #include "ewk_web_database.h"
 #include "ewk_window_features.h"
 
-#include <Evas.h>
+#include <Evas.h> 
 
 #endif // EWebKit_h
index ef6027f..3caa425 100644 (file)
@@ -37,6 +37,7 @@
 #include "ewk_settings.h"
 #include "ewk_settings_private.h"
 #include "runtime/InitializeThreading.h"
+#include "runtime/Operations.h"
 #include <Ecore.h>
 #include <Ecore_Evas.h>
 #include <Edje.h>
index d0b88d2..2fcee9e 100644 (file)
@@ -32,6 +32,7 @@
 #include "APIObject.h"
 
 #include <runtime/InitializeThreading.h>
+#include <runtime/Operations.h>
 #include <wtf/MainThread.h>
 
 namespace WebKit {
index 599e4ce..a7d3ccb 100644 (file)
@@ -32,6 +32,7 @@
 #include <JavaScriptCore/MemoryStatistics.h>
 #include <WebCore/JSDOMWindow.h>
 #include <runtime/JSLock.h>
+#include <runtime/Operations.h>
 #include <string.h>
 #include <sys/sysinfo.h>
 #include <wtf/CurrentTime.h>
index 2cb8c2a..ec25e38 100644 (file)
@@ -61,6 +61,7 @@
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/RunLoop.h>
 #include <runtime/InitializeThreading.h>
+#include <runtime/Operations.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/MainThread.h>
 
index a522a9e..25903a8 100644 (file)
 #include <WebCore/markup.h>
 #include <runtime/JSLock.h>
 #include <runtime/JSValue.h>
+#include <runtime/Operations.h>
 
 #if ENABLE(MHTML)
 #include <WebCore/MHTMLArchive.h>
index 622de51..5f48650 100644 (file)
@@ -39,6 +39,7 @@
 #include <WebKit2/WebProcess.h>
 #include <libsoup/soup-cache.h>
 #include <runtime/InitializeThreading.h>
+#include <runtime/Operations.h>
 #include <unistd.h>
 #include <wtf/MainThread.h>
 #include <wtf/text/CString.h>