From cd44dc59cdfc39534aef4d417e9f3c412e3be139 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 3 Feb 2012 09:55:33 +0100 Subject: Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560) --- Source/JavaScriptCore/API/JSObjectRef.cpp | 2 +- Source/JavaScriptCore/API/JSValueRef.cpp | 2 +- Source/JavaScriptCore/API/OpaqueJSString.h | 2 +- Source/JavaScriptCore/CMakeLists.txt | 11 +- Source/JavaScriptCore/ChangeLog | 3308 ++++++++++++++++++++ Source/JavaScriptCore/Configurations/Base.xcconfig | 11 +- .../Configurations/FeatureDefines.xcconfig | 4 +- .../Configurations/JavaScriptCore.xcconfig | 5 +- .../JavaScriptCore/Configurations/Version.xcconfig | 2 +- Source/JavaScriptCore/GNUmakefile.am | 1 + Source/JavaScriptCore/GNUmakefile.list.am | 33 +- Source/JavaScriptCore/JavaScriptCore.exp | 28 +- .../JavaScriptCore.gyp/JavaScriptCore.gyp | 45 +- Source/JavaScriptCore/JavaScriptCore.gypi | 9 +- Source/JavaScriptCore/JavaScriptCore.order | 3 +- Source/JavaScriptCore/JavaScriptCore.pri | 1 + Source/JavaScriptCore/JavaScriptCore.pro | 20 +- .../JavaScriptCore/JavaScriptCore.def | 22 +- .../JavaScriptCore/JavaScriptCore.vcproj | 84 +- .../JavaScriptCore/JavaScriptCoreCommon.vsprops | 2 +- .../JavaScriptCore.vcproj/WTF/WTF.vcproj | 12 + .../JavaScriptCore.xcodeproj/project.pbxproj | 134 +- Source/JavaScriptCore/Target.pri | 9 +- Source/JavaScriptCore/assembler/ARMAssembler.cpp | 4 +- Source/JavaScriptCore/assembler/ARMAssembler.h | 2 +- Source/JavaScriptCore/assembler/ARMv7Assembler.h | 5 - Source/JavaScriptCore/assembler/AssemblerBuffer.h | 4 +- .../assembler/AssemblerBufferWithConstantPool.h | 4 +- Source/JavaScriptCore/assembler/LinkBuffer.h | 21 +- Source/JavaScriptCore/assembler/MIPSAssembler.h | 4 +- .../assembler/MacroAssemblerCodeRef.h | 6 +- Source/JavaScriptCore/assembler/SH4Assembler.h | 4 +- Source/JavaScriptCore/assembler/X86Assembler.h | 8 +- Source/JavaScriptCore/bytecode/CallLinkInfo.h | 2 +- Source/JavaScriptCore/bytecode/CallLinkStatus.cpp | 47 + Source/JavaScriptCore/bytecode/CallLinkStatus.h | 66 + Source/JavaScriptCore/bytecode/CodeBlock.cpp | 76 +- Source/JavaScriptCore/bytecode/CodeBlock.h | 79 +- Source/JavaScriptCore/bytecode/CodeOrigin.h | 24 +- Source/JavaScriptCore/bytecode/GetByIdStatus.cpp | 138 + Source/JavaScriptCore/bytecode/GetByIdStatus.h | 82 + Source/JavaScriptCore/bytecode/Instruction.h | 8 + .../bytecode/MethodCallLinkStatus.cpp | 61 + .../JavaScriptCore/bytecode/MethodCallLinkStatus.h | 87 + Source/JavaScriptCore/bytecode/Opcode.h | 53 +- Source/JavaScriptCore/bytecode/PredictedType.cpp | 7 + Source/JavaScriptCore/bytecode/PredictedType.h | 61 +- Source/JavaScriptCore/bytecode/PutByIdStatus.cpp | 89 + Source/JavaScriptCore/bytecode/PutByIdStatus.h | 106 + Source/JavaScriptCore/bytecode/SamplingTool.h | 14 +- Source/JavaScriptCore/bytecode/StructureSet.h | 158 + Source/JavaScriptCore/bytecode/StructureStubInfo.h | 3 + .../bytecompiler/BytecodeGenerator.cpp | 556 ++-- .../bytecompiler/BytecodeGenerator.h | 182 +- .../JavaScriptCore/bytecompiler/NodesCodegen.cpp | 236 +- Source/JavaScriptCore/config.h | 3 + Source/JavaScriptCore/debugger/Debugger.h | 2 +- .../JavaScriptCore/debugger/DebuggerActivation.cpp | 4 +- .../JavaScriptCore/debugger/DebuggerActivation.h | 8 +- .../JavaScriptCore/debugger/DebuggerCallFrame.cpp | 5 +- Source/JavaScriptCore/debugger/DebuggerCallFrame.h | 2 +- Source/JavaScriptCore/dfg/DFGAbstractState.cpp | 44 +- Source/JavaScriptCore/dfg/DFGAbstractValue.h | 2 +- Source/JavaScriptCore/dfg/DFGAssemblyHelpers.h | 10 + Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp | 329 +- Source/JavaScriptCore/dfg/DFGCCallHelpers.h | 548 ++++ Source/JavaScriptCore/dfg/DFGDriver.cpp | 17 +- Source/JavaScriptCore/dfg/DFGDriver.h | 10 +- Source/JavaScriptCore/dfg/DFGGraph.cpp | 6 +- Source/JavaScriptCore/dfg/DFGGraph.h | 64 +- Source/JavaScriptCore/dfg/DFGJITCompiler.cpp | 9 +- Source/JavaScriptCore/dfg/DFGJITCompiler.h | 100 +- Source/JavaScriptCore/dfg/DFGNode.h | 9 + Source/JavaScriptCore/dfg/DFGOSREntry.cpp | 8 +- Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp | 2 +- .../JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp | 4 +- Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp | 4 +- Source/JavaScriptCore/dfg/DFGOperations.cpp | 233 +- Source/JavaScriptCore/dfg/DFGOperations.h | 4 +- Source/JavaScriptCore/dfg/DFGPropagator.cpp | 63 +- Source/JavaScriptCore/dfg/DFGRepatch.cpp | 120 +- Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp | 222 +- Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h | 633 +--- .../JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp | 242 +- Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp | 237 +- Source/JavaScriptCore/dfg/DFGStructureSet.h | 166 - Source/JavaScriptCore/dfg/DFGThunks.cpp | 2 +- Source/JavaScriptCore/heap/AllocationSpace.cpp | 202 -- Source/JavaScriptCore/heap/AllocationSpace.h | 132 - Source/JavaScriptCore/heap/BumpBlock.h | 53 + Source/JavaScriptCore/heap/BumpSpace.cpp | 49 + Source/JavaScriptCore/heap/BumpSpace.h | 125 + .../JavaScriptCore/heap/BumpSpaceInlineMethods.h | 400 +++ Source/JavaScriptCore/heap/ConservativeRoots.cpp | 18 +- Source/JavaScriptCore/heap/ConservativeRoots.h | 3 +- Source/JavaScriptCore/heap/HandleHeap.h | 6 +- Source/JavaScriptCore/heap/Heap.cpp | 28 +- Source/JavaScriptCore/heap/Heap.h | 85 +- Source/JavaScriptCore/heap/HeapBlock.h | 54 + Source/JavaScriptCore/heap/MachineStackMarker.cpp | 4 +- Source/JavaScriptCore/heap/MachineStackMarker.h | 2 +- Source/JavaScriptCore/heap/MarkStack.cpp | 94 +- Source/JavaScriptCore/heap/MarkStack.h | 8 +- Source/JavaScriptCore/heap/MarkedBlock.cpp | 11 +- Source/JavaScriptCore/heap/MarkedBlock.h | 13 +- Source/JavaScriptCore/heap/MarkedSpace.cpp | 189 +- Source/JavaScriptCore/heap/MarkedSpace.h | 81 +- Source/JavaScriptCore/heap/SlotVisitor.h | 11 + Source/JavaScriptCore/heap/TinyBloomFilter.h | 6 + Source/JavaScriptCore/heap/VTableSpectrum.h | 2 +- Source/JavaScriptCore/heap/WriteBarrierSupport.h | 4 +- Source/JavaScriptCore/interpreter/AbstractPC.cpp | 55 + Source/JavaScriptCore/interpreter/AbstractPC.h | 91 + Source/JavaScriptCore/interpreter/CallFrame.cpp | 100 +- Source/JavaScriptCore/interpreter/CallFrame.h | 23 +- Source/JavaScriptCore/interpreter/Interpreter.cpp | 93 +- Source/JavaScriptCore/interpreter/Interpreter.h | 16 +- Source/JavaScriptCore/jit/ExecutableAllocator.cpp | 6 +- Source/JavaScriptCore/jit/ExecutableAllocator.h | 3 +- .../jit/ExecutableAllocatorFixedVMPool.cpp | 9 +- Source/JavaScriptCore/jit/JIT.cpp | 7 +- Source/JavaScriptCore/jit/JIT.h | 10 +- Source/JavaScriptCore/jit/JITCall.cpp | 4 +- Source/JavaScriptCore/jit/JITCall32_64.cpp | 2 +- Source/JavaScriptCore/jit/JITDriver.h | 101 + Source/JavaScriptCore/jit/JITInlineMethods.h | 18 +- Source/JavaScriptCore/jit/JITOpcodes.cpp | 18 +- Source/JavaScriptCore/jit/JITOpcodes32_64.cpp | 18 +- Source/JavaScriptCore/jit/JITPropertyAccess.cpp | 48 +- .../JavaScriptCore/jit/JITPropertyAccess32_64.cpp | 57 +- Source/JavaScriptCore/jit/JITStubCall.h | 8 +- Source/JavaScriptCore/jit/JITStubs.cpp | 86 +- Source/JavaScriptCore/jit/JITStubs.h | 14 +- Source/JavaScriptCore/jit/SpecializedThunkJIT.h | 2 +- Source/JavaScriptCore/jit/ThunkGenerators.cpp | 20 +- Source/JavaScriptCore/jsc.cpp | 18 +- Source/JavaScriptCore/parser/ASTBuilder.h | 21 +- Source/JavaScriptCore/parser/Keywords.table | 4 +- Source/JavaScriptCore/parser/NodeConstructors.h | 3 +- Source/JavaScriptCore/parser/Nodes.h | 8 +- Source/JavaScriptCore/parser/Parser.cpp | 22 +- Source/JavaScriptCore/parser/Parser.h | 2 +- Source/JavaScriptCore/parser/ParserArena.h | 2 +- Source/JavaScriptCore/parser/SyntaxChecker.h | 2 +- Source/JavaScriptCore/profiler/Profile.h | 8 +- Source/JavaScriptCore/profiler/Profiler.cpp | 23 +- Source/JavaScriptCore/runtime/ArgList.h | 4 +- Source/JavaScriptCore/runtime/Arguments.cpp | 4 +- Source/JavaScriptCore/runtime/ArrayPrototype.cpp | 20 +- Source/JavaScriptCore/runtime/CallData.h | 2 +- Source/JavaScriptCore/runtime/ClassInfo.h | 4 +- Source/JavaScriptCore/runtime/CommonSlowPaths.h | 2 +- Source/JavaScriptCore/runtime/Completion.cpp | 3 + Source/JavaScriptCore/runtime/Completion.h | 4 +- Source/JavaScriptCore/runtime/ConstructData.h | 2 +- Source/JavaScriptCore/runtime/DateConstructor.cpp | 2 +- Source/JavaScriptCore/runtime/DateInstance.h | 4 +- Source/JavaScriptCore/runtime/DatePrototype.cpp | 36 +- Source/JavaScriptCore/runtime/Error.cpp | 9 +- Source/JavaScriptCore/runtime/Error.h | 18 +- Source/JavaScriptCore/runtime/ErrorInstance.h | 8 +- Source/JavaScriptCore/runtime/ErrorPrototype.cpp | 4 +- Source/JavaScriptCore/runtime/ExceptionHelpers.cpp | 8 +- Source/JavaScriptCore/runtime/ExceptionHelpers.h | 8 +- Source/JavaScriptCore/runtime/Executable.cpp | 104 +- Source/JavaScriptCore/runtime/Executable.h | 16 +- .../JavaScriptCore/runtime/FunctionConstructor.cpp | 8 +- .../JavaScriptCore/runtime/FunctionConstructor.h | 2 +- .../JavaScriptCore/runtime/FunctionPrototype.cpp | 2 +- Source/JavaScriptCore/runtime/GetterSetter.h | 4 +- Source/JavaScriptCore/runtime/Identifier.h | 16 +- .../JavaScriptCore/runtime/InitializeThreading.h | 2 +- Source/JavaScriptCore/runtime/InternalFunction.h | 6 +- Source/JavaScriptCore/runtime/JSActivation.cpp | 8 +- Source/JavaScriptCore/runtime/JSActivation.h | 2 +- Source/JavaScriptCore/runtime/JSArray.cpp | 297 +- Source/JavaScriptCore/runtime/JSArray.h | 39 +- Source/JavaScriptCore/runtime/JSBoundFunction.cpp | 4 +- Source/JavaScriptCore/runtime/JSBoundFunction.h | 2 +- Source/JavaScriptCore/runtime/JSByteArray.h | 18 +- Source/JavaScriptCore/runtime/JSCell.cpp | 9 +- Source/JavaScriptCore/runtime/JSCell.h | 22 +- Source/JavaScriptCore/runtime/JSFunction.cpp | 35 +- Source/JavaScriptCore/runtime/JSFunction.h | 16 +- Source/JavaScriptCore/runtime/JSGlobalData.cpp | 4 +- Source/JavaScriptCore/runtime/JSGlobalData.h | 34 +- Source/JavaScriptCore/runtime/JSGlobalObject.cpp | 4 +- Source/JavaScriptCore/runtime/JSGlobalObject.h | 28 +- .../runtime/JSGlobalObjectFunctions.cpp | 15 +- Source/JavaScriptCore/runtime/JSGlobalThis.h | 2 +- Source/JavaScriptCore/runtime/JSLock.h | 16 +- Source/JavaScriptCore/runtime/JSONObject.cpp | 22 +- Source/JavaScriptCore/runtime/JSObject.cpp | 153 +- Source/JavaScriptCore/runtime/JSObject.h | 140 +- .../JavaScriptCore/runtime/JSStaticScopeObject.cpp | 2 +- .../JavaScriptCore/runtime/JSStaticScopeObject.h | 2 +- Source/JavaScriptCore/runtime/JSString.cpp | 5 - Source/JavaScriptCore/runtime/JSString.h | 26 +- Source/JavaScriptCore/runtime/JSValue.cpp | 14 +- Source/JavaScriptCore/runtime/JSValue.h | 19 +- .../JavaScriptCore/runtime/JSValueInlineMethods.h | 1 + Source/JavaScriptCore/runtime/JSVariableObject.cpp | 2 +- Source/JavaScriptCore/runtime/JSVariableObject.h | 10 +- Source/JavaScriptCore/runtime/Lookup.h | 6 +- Source/JavaScriptCore/runtime/MemoryStatistics.h | 2 +- Source/JavaScriptCore/runtime/NumberPrototype.cpp | 4 +- .../JavaScriptCore/runtime/ObjectConstructor.cpp | 19 +- Source/JavaScriptCore/runtime/ObjectPrototype.cpp | 12 +- Source/JavaScriptCore/runtime/ObjectPrototype.h | 2 +- Source/JavaScriptCore/runtime/Operations.cpp | 10 +- Source/JavaScriptCore/runtime/Operations.h | 23 +- Source/JavaScriptCore/runtime/Options.cpp | 15 +- Source/JavaScriptCore/runtime/Options.h | 4 +- .../JavaScriptCore/runtime/PropertyDescriptor.cpp | 50 +- Source/JavaScriptCore/runtime/PropertyDescriptor.h | 32 +- Source/JavaScriptCore/runtime/PropertyNameArray.h | 2 +- Source/JavaScriptCore/runtime/PropertySlot.h | 2 +- Source/JavaScriptCore/runtime/RegExp.cpp | 72 +- Source/JavaScriptCore/runtime/RegExp.h | 8 +- .../JavaScriptCore/runtime/RegExpConstructor.cpp | 86 +- Source/JavaScriptCore/runtime/RegExpConstructor.h | 33 +- Source/JavaScriptCore/runtime/RegExpMatchesArray.h | 30 +- Source/JavaScriptCore/runtime/RegExpObject.cpp | 2 +- Source/JavaScriptCore/runtime/RegExpObject.h | 4 +- Source/JavaScriptCore/runtime/RegExpPrototype.cpp | 6 +- Source/JavaScriptCore/runtime/SamplingCounter.h | 4 +- Source/JavaScriptCore/runtime/SmallStrings.h | 6 +- .../JavaScriptCore/runtime/StringConstructor.cpp | 7 +- Source/JavaScriptCore/runtime/StringObject.h | 4 +- Source/JavaScriptCore/runtime/StringPrototype.cpp | 271 +- Source/JavaScriptCore/runtime/Structure.cpp | 23 +- Source/JavaScriptCore/runtime/Structure.h | 20 +- Source/JavaScriptCore/runtime/TimeoutChecker.h | 4 +- Source/JavaScriptCore/runtime/UString.h | 40 +- Source/JavaScriptCore/runtime/WriteBarrier.h | 4 +- Source/JavaScriptCore/tools/CodeProfile.cpp | 188 ++ Source/JavaScriptCore/tools/CodeProfile.h | 93 + Source/JavaScriptCore/tools/CodeProfiling.cpp | 163 + Source/JavaScriptCore/tools/CodeProfiling.h | 85 + Source/JavaScriptCore/tools/ProfileTreeNode.h | 123 + Source/JavaScriptCore/tools/TieredMMapArray.h | 117 + Source/JavaScriptCore/wtf/ASCIICType.h | 20 + Source/JavaScriptCore/wtf/Alignment.h | 2 +- Source/JavaScriptCore/wtf/ArrayBufferView.h | 7 +- Source/JavaScriptCore/wtf/Assertions.cpp | 41 +- Source/JavaScriptCore/wtf/Assertions.h | 6 + Source/JavaScriptCore/wtf/ByteArray.h | 2 +- Source/JavaScriptCore/wtf/CMakeLists.txt | 2 + Source/JavaScriptCore/wtf/CheckedBoolean.h | 61 + Source/JavaScriptCore/wtf/Compiler.h | 12 +- .../wtf/CryptographicallyRandomNumber.h | 4 +- Source/JavaScriptCore/wtf/CurrentTime.h | 4 +- Source/JavaScriptCore/wtf/DateMath.h | 16 +- Source/JavaScriptCore/wtf/DecimalNumber.h | 8 +- Source/JavaScriptCore/wtf/DoublyLinkedList.h | 19 + Source/JavaScriptCore/wtf/FastMalloc.cpp | 4 +- Source/JavaScriptCore/wtf/FastMalloc.h | 24 +- Source/JavaScriptCore/wtf/Forward.h | 2 + Source/JavaScriptCore/wtf/InlineASM.h | 2 + Source/JavaScriptCore/wtf/MD5.h | 6 +- Source/JavaScriptCore/wtf/MainThread.h | 18 +- Source/JavaScriptCore/wtf/MetaAllocator.cpp | 107 +- Source/JavaScriptCore/wtf/MetaAllocator.h | 59 +- Source/JavaScriptCore/wtf/MetaAllocatorHandle.h | 33 +- Source/JavaScriptCore/wtf/NumberOfCores.cpp | 75 + Source/JavaScriptCore/wtf/NumberOfCores.h | 30 + Source/JavaScriptCore/wtf/OSAllocator.h | 20 +- Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp | 12 +- Source/JavaScriptCore/wtf/OwnPtrCommon.h | 6 +- Source/JavaScriptCore/wtf/PageBlock.h | 2 +- Source/JavaScriptCore/wtf/ParallelJobsGeneric.cpp | 48 +- Source/JavaScriptCore/wtf/ParallelJobsGeneric.h | 3 - Source/JavaScriptCore/wtf/Platform.h | 12 +- Source/JavaScriptCore/wtf/PlatformEfl.cmake | 1 + Source/JavaScriptCore/wtf/RandomNumber.h | 2 +- Source/JavaScriptCore/wtf/RedBlackTree.h | 135 +- Source/JavaScriptCore/wtf/RefCountedLeakCounter.h | 12 +- Source/JavaScriptCore/wtf/SHA1.h | 6 +- Source/JavaScriptCore/wtf/StdLibExtras.h | 9 + Source/JavaScriptCore/wtf/Threading.cpp | 2 +- Source/JavaScriptCore/wtf/Threading.h | 16 +- Source/JavaScriptCore/wtf/ThreadingPrimitives.h | 22 +- Source/JavaScriptCore/wtf/Uint8Array.h | 2 +- Source/JavaScriptCore/wtf/Uint8ClampedArray.h | 104 + Source/JavaScriptCore/wtf/Vector.h | 2 +- Source/JavaScriptCore/wtf/WTFThreadData.h | 4 +- Source/JavaScriptCore/wtf/dtoa.h | 10 +- Source/JavaScriptCore/wtf/efl/OwnPtrEfl.cpp | 7 + Source/JavaScriptCore/wtf/gobject/GOwnPtr.cpp | 12 + Source/JavaScriptCore/wtf/gobject/GOwnPtr.h | 2 + Source/JavaScriptCore/wtf/gobject/GTypedefs.h | 2 + Source/JavaScriptCore/wtf/text/AtomicString.cpp | 48 +- Source/JavaScriptCore/wtf/text/AtomicString.h | 22 +- Source/JavaScriptCore/wtf/text/CString.h | 10 +- Source/JavaScriptCore/wtf/text/StringBuilder.cpp | 14 +- Source/JavaScriptCore/wtf/text/StringBuilder.h | 147 +- Source/JavaScriptCore/wtf/text/StringHash.h | 4 +- Source/JavaScriptCore/wtf/text/StringImpl.cpp | 184 +- Source/JavaScriptCore/wtf/text/StringImpl.h | 83 +- Source/JavaScriptCore/wtf/text/WTFString.cpp | 7 + Source/JavaScriptCore/wtf/text/WTFString.h | 14 +- Source/JavaScriptCore/wtf/unicode/CharacterNames.h | 1 + Source/JavaScriptCore/wtf/unicode/Collator.h | 8 +- Source/JavaScriptCore/wtf/unicode/UTF8.h | 4 +- Source/JavaScriptCore/wtf/wtf.pri | 42 - Source/JavaScriptCore/wtf/wtf.pro | 252 -- Source/JavaScriptCore/yarr/Yarr.h | 4 +- Source/JavaScriptCore/yarr/YarrInterpreter.cpp | 21 +- Source/JavaScriptCore/yarr/YarrJIT.cpp | 10 +- Source/JavaScriptCore/yarr/YarrPattern.h | 2 +- 310 files changed, 11757 insertions(+), 4527 deletions(-) create mode 100644 Source/JavaScriptCore/bytecode/CallLinkStatus.cpp create mode 100644 Source/JavaScriptCore/bytecode/CallLinkStatus.h create mode 100644 Source/JavaScriptCore/bytecode/GetByIdStatus.cpp create mode 100644 Source/JavaScriptCore/bytecode/GetByIdStatus.h create mode 100644 Source/JavaScriptCore/bytecode/MethodCallLinkStatus.cpp create mode 100644 Source/JavaScriptCore/bytecode/MethodCallLinkStatus.h create mode 100644 Source/JavaScriptCore/bytecode/PutByIdStatus.cpp create mode 100644 Source/JavaScriptCore/bytecode/PutByIdStatus.h create mode 100644 Source/JavaScriptCore/bytecode/StructureSet.h create mode 100644 Source/JavaScriptCore/dfg/DFGCCallHelpers.h delete mode 100644 Source/JavaScriptCore/dfg/DFGStructureSet.h delete mode 100644 Source/JavaScriptCore/heap/AllocationSpace.cpp delete mode 100644 Source/JavaScriptCore/heap/AllocationSpace.h create mode 100644 Source/JavaScriptCore/heap/BumpBlock.h create mode 100644 Source/JavaScriptCore/heap/BumpSpace.cpp create mode 100644 Source/JavaScriptCore/heap/BumpSpace.h create mode 100644 Source/JavaScriptCore/heap/BumpSpaceInlineMethods.h create mode 100644 Source/JavaScriptCore/heap/HeapBlock.h create mode 100644 Source/JavaScriptCore/interpreter/AbstractPC.cpp create mode 100644 Source/JavaScriptCore/interpreter/AbstractPC.h create mode 100644 Source/JavaScriptCore/jit/JITDriver.h create mode 100644 Source/JavaScriptCore/tools/CodeProfile.cpp create mode 100644 Source/JavaScriptCore/tools/CodeProfile.h create mode 100644 Source/JavaScriptCore/tools/CodeProfiling.cpp create mode 100644 Source/JavaScriptCore/tools/CodeProfiling.h create mode 100644 Source/JavaScriptCore/tools/ProfileTreeNode.h create mode 100644 Source/JavaScriptCore/tools/TieredMMapArray.h create mode 100644 Source/JavaScriptCore/wtf/CheckedBoolean.h create mode 100644 Source/JavaScriptCore/wtf/NumberOfCores.cpp create mode 100644 Source/JavaScriptCore/wtf/NumberOfCores.h create mode 100644 Source/JavaScriptCore/wtf/Uint8ClampedArray.h delete mode 100644 Source/JavaScriptCore/wtf/wtf.pri delete mode 100644 Source/JavaScriptCore/wtf/wtf.pro (limited to 'Source/JavaScriptCore') diff --git a/Source/JavaScriptCore/API/JSObjectRef.cpp b/Source/JavaScriptCore/API/JSObjectRef.cpp index 99b41b685..cd8d7159e 100644 --- a/Source/JavaScriptCore/API/JSObjectRef.cpp +++ b/Source/JavaScriptCore/API/JSObjectRef.cpp @@ -274,7 +274,7 @@ void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef prope JSValue jsValue = toJS(exec, value); if (attributes && !jsObject->hasProperty(exec, name)) - jsObject->methodTable()->putWithAttributes(jsObject, exec, name, jsValue, attributes); + jsObject->methodTable()->putDirectVirtual(jsObject, exec, name, jsValue, attributes); else { PutPropertySlot slot; jsObject->methodTable()->put(jsObject, exec, name, jsValue, slot); diff --git a/Source/JavaScriptCore/API/JSValueRef.cpp b/Source/JavaScriptCore/API/JSValueRef.cpp index c89e267a4..1b4e03bde 100644 --- a/Source/JavaScriptCore/API/JSValueRef.cpp +++ b/Source/JavaScriptCore/API/JSValueRef.cpp @@ -293,7 +293,7 @@ JSStringRef JSValueToStringCopy(JSContextRef ctx, JSValueRef value, JSValueRef* JSValue jsValue = toJS(exec, value); - RefPtr stringRef(OpaqueJSString::create(jsValue.toString(exec))); + RefPtr stringRef(OpaqueJSString::create(jsValue.toString(exec)->value(exec))); if (exec->hadException()) { if (exception) *exception = toRef(exec, exec->exception()); diff --git a/Source/JavaScriptCore/API/OpaqueJSString.h b/Source/JavaScriptCore/API/OpaqueJSString.h index 5c24f7510..1c63150cf 100644 --- a/Source/JavaScriptCore/API/OpaqueJSString.h +++ b/Source/JavaScriptCore/API/OpaqueJSString.h @@ -46,7 +46,7 @@ struct OpaqueJSString : public ThreadSafeRefCounted { return adoptRef(new OpaqueJSString(characters, length)); } - static PassRefPtr create(const JSC::UString&); + JS_EXPORT_PRIVATE static PassRefPtr create(const JSC::UString&); UChar* characters() { return this ? m_characters : 0; } unsigned length() { return this ? m_length : 0; } diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt index 00e0296c0..a620c5a52 100644 --- a/Source/JavaScriptCore/CMakeLists.txt +++ b/Source/JavaScriptCore/CMakeLists.txt @@ -14,6 +14,7 @@ SET(JavaScriptCore_INCLUDE_DIRECTORIES "${JAVASCRIPTCORE_DIR}/parser" "${JAVASCRIPTCORE_DIR}/profiler" "${JAVASCRIPTCORE_DIR}/runtime" + "${JAVASCRIPTCORE_DIR}/tools" "${JAVASCRIPTCORE_DIR}/yarr" "${JAVASCRIPTCORE_DIR}/wtf" "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}" @@ -35,12 +36,16 @@ SET(JavaScriptCore_SOURCES API/OpaqueJSString.cpp bytecode/CallLinkInfo.cpp + bytecode/CallLinkStatus.cpp bytecode/CodeBlock.cpp bytecode/DFGExitProfile.cpp + bytecode/GetByIdStatus.cpp bytecode/JumpTable.cpp bytecode/MethodCallLinkInfo.cpp + bytecode/MethodCallLinkStatus.cpp bytecode/Opcode.cpp bytecode/PredictedType.cpp + bytecode/PutByIdStatus.cpp bytecode/SamplingTool.cpp bytecode/StructureStubInfo.cpp bytecode/ValueProfile.cpp @@ -69,7 +74,7 @@ SET(JavaScriptCore_SOURCES dfg/DFGSpeculativeJIT64.cpp dfg/DFGThunks.cpp - heap/AllocationSpace.cpp + heap/BumpSpace.cpp heap/DFGCodeBlocks.cpp heap/Heap.cpp heap/HandleHeap.cpp @@ -84,6 +89,7 @@ SET(JavaScriptCore_SOURCES debugger/DebuggerActivation.cpp debugger/DebuggerCallFrame.cpp + interpreter/AbstractPC.cpp interpreter/CallFrame.cpp interpreter/Interpreter.cpp interpreter/RegisterFile.cpp @@ -195,6 +201,9 @@ SET(JavaScriptCore_SOURCES runtime/TimeoutChecker.cpp runtime/UString.cpp + tools/CodeProfile.cpp + tools/CodeProfiling.cpp + yarr/YarrPattern.cpp yarr/YarrInterpreter.cpp yarr/YarrJIT.cpp diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog index c8b43b41c..1f53cd789 100644 --- a/Source/JavaScriptCore/ChangeLog +++ b/Source/JavaScriptCore/ChangeLog @@ -1,3 +1,3311 @@ +2012-02-01 Michael Saboff + + Yarr crash with regexp replace + https://bugs.webkit.org/show_bug.cgi?id=67454 + + Reviewed by Gavin Barraclough. + + Properly handle the case of a back reference to an unmatched + subpattern by always matching without consuming any characters. + + * yarr/YarrInterpreter.cpp: + (JSC::Yarr::Interpreter::matchBackReference): + (JSC::Yarr::Interpreter::backtrackBackReference): + +2012-02-01 Gavin Barraclough + + calling function on catch block scope containing an eval result in wrong this value being passed + https://bugs.webkit.org/show_bug.cgi?id=77581 + + Reviewed by Oliver Hunt. + + javascript:function F(){ return 'F' in this; }; try { throw F; } catch (e) { eval(""); alert(e()); } + + * bytecompiler/NodesCodegen.cpp: + (JSC::TryNode::emitBytecode): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::execute): + * parser/ASTBuilder.h: + (JSC::ASTBuilder::createTryStatement): + * parser/NodeConstructors.h: + (JSC::TryNode::TryNode): + * parser/Nodes.h: + (TryNode): + * parser/Parser.cpp: + (JSC::::parseTryStatement): + * parser/SyntaxChecker.h: + (JSC::SyntaxChecker::createTryStatement): + * runtime/JSObject.h: + (JSObject): + (JSC::JSObject::isStaticScopeObject): + (JSC): + +2012-02-01 Oliver Hunt + + Add support for inferred function names + https://bugs.webkit.org/show_bug.cgi?id=77579 + + Reviewed by Gavin Barraclough. + + Add new "inferred" names to function expressions, getters, and setters. + This property is not exposed to JS, so is only visible in the debugger + and profiler. + + * JavaScriptCore.exp: + * bytecompiler/BytecodeGenerator.h: + (JSC::BytecodeGenerator::makeFunction): + * debugger/DebuggerCallFrame.cpp: + (JSC::DebuggerCallFrame::calculatedFunctionName): + * parser/ASTBuilder.h: + (JSC::ASTBuilder::createAssignResolve): + (JSC::ASTBuilder::createGetterOrSetterProperty): + (JSC::ASTBuilder::createProperty): + (JSC::ASTBuilder::makeAssignNode): + * parser/Nodes.h: + (JSC::FunctionBodyNode::setInferredName): + (JSC::FunctionBodyNode::inferredName): + (FunctionBodyNode): + * profiler/Profiler.cpp: + (JSC): + (JSC::Profiler::createCallIdentifier): + (JSC::createCallIdentifierFromFunctionImp): + * runtime/Executable.cpp: + (JSC::FunctionExecutable::FunctionExecutable): + (JSC::FunctionExecutable::fromGlobalCode): + * runtime/Executable.h: + (JSC::FunctionExecutable::create): + (JSC::FunctionExecutable::inferredName): + (FunctionExecutable): + * runtime/JSFunction.cpp: + (JSC::JSFunction::calculatedDisplayName): + (JSC): + (JSC::getCalculatedDisplayName): + * runtime/JSFunction.h: + (JSC): + +2012-02-01 Filip Pizlo + + DFG should fold double-to-int conversions + https://bugs.webkit.org/show_bug.cgi?id=77532 + + Reviewed by Oliver Hunt. + + Performance neutral on major benchmarks. But it makes calling V8's + Math.random() 4x faster. + + * bytecode/CodeBlock.cpp: + (JSC): + (JSC::CodeBlock::addOrFindConstant): + * bytecode/CodeBlock.h: + (JSC::CodeBlock::addConstant): + (CodeBlock): + * dfg/DFGAbstractState.cpp: + (JSC::DFG::AbstractState::execute): + * dfg/DFGByteCodeParser.cpp: + (JSC::DFG::ByteCodeParser::toInt32): + (ByteCodeParser): + (JSC::DFG::ByteCodeParser::getJSConstantForValue): + (JSC::DFG::ByteCodeParser::isInt32Constant): + * dfg/DFGGraph.h: + (JSC::DFG::Graph::addShouldSpeculateInteger): + (Graph): + (JSC::DFG::Graph::addImmediateShouldSpeculateInteger): + * dfg/DFGPropagator.cpp: + (JSC::DFG::Propagator::propagateNodePredictions): + (JSC::DFG::Propagator::doRoundOfDoubleVoting): + (JSC::DFG::Propagator::fixupNode): + * dfg/DFGSpeculativeJIT.cpp: + (JSC::DFG::SpeculativeJIT::compileAdd): + (DFG): + (JSC::DFG::SpeculativeJIT::compileArithSub): + * dfg/DFGSpeculativeJIT.h: + (JSC::DFG::SpeculativeJIT::valueOfNumberConstantAsInt32): + (SpeculativeJIT): + * dfg/DFGSpeculativeJIT32_64.cpp: + (JSC::DFG::SpeculativeJIT::compile): + * dfg/DFGSpeculativeJIT64.cpp: + (JSC::DFG::SpeculativeJIT::compile): + * runtime/JSValueInlineMethods.h: + (JSC::JSValue::asDouble): + +2012-02-01 Filip Pizlo + + DFG graph dump for GetScopedVar should show the correct prediction + https://bugs.webkit.org/show_bug.cgi?id=77530 + + Reviewed by Geoff Garen. + + GetScopedVar has a heap prediction, not a variable prediction. But it does + have a variable. Hence we need to check for heap predictions before checking + for variable predictions. + + * dfg/DFGGraph.cpp: + (JSC::DFG::Graph::dump): + +2012-02-01 Mark Hahnenberg + + Replace JSArray destructor with finalizer + https://bugs.webkit.org/show_bug.cgi?id=77488 + + Reviewed by Geoffrey Garen. + + * JavaScriptCore.exp: + * runtime/JSArray.cpp: + (JSC::JSArray::finalize): Added finalizer. + (JSC::JSArray::allocateSparseMap): Factored out code for allocating new sparse maps. + (JSC): + (JSC::JSArray::deallocateSparseMap): Factored out code for deallocating sparse maps. + (JSC::JSArray::enterDictionaryMode): Renamed enterSparseMode to enterDictionaryMode + because the old name was confusing because we could have a sparse array that never + called enterSparseMode. + (JSC::JSArray::defineOwnNumericProperty): + (JSC::JSArray::setLengthWritable): + (JSC::JSArray::putByIndexBeyondVectorLength): + (JSC::JSArray::setLength): + (JSC::JSArray::pop): + (JSC::JSArray::sort): + (JSC::JSArray::compactForSorting): + * runtime/JSArray.h: + (JSArray): + +2012-02-01 Andy Wingo + + Refactor identifier resolution in BytecodeGenerator + https://bugs.webkit.org/show_bug.cgi?id=76285 + + Reviewed by Geoffrey Garen. + + * bytecompiler/BytecodeGenerator.h: + (JSC::ResolveResult): New class, to describe the storage + location corresponding to an identifier in a program. + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::resolve): New function, replacing + findScopedProperty. + (JSC::BytecodeGenerator::resolveConstDecl): New function, + encapsulating what ConstDeclNode::emitBytecode used to do. + (JSC::BytecodeGenerator::emitGetStaticVar): + (JSC::BytecodeGenerator::emitPutStaticVar): New functions, + corresponding to the old emitGetScopedVar and emitPutScopedVar. + (JSC::BytecodeGenerator::registerFor): Remove version that took an + Identifier&; replaced by ResolveResult::local(). + (JSC::BytecodeGenerator::emitResolve): + (JSC::BytecodeGenerator::emitResolveBase): + (JSC::BytecodeGenerator::emitResolveBaseForPut): + (JSC::BytecodeGenerator::emitResolveWithBase): + (JSC::BytecodeGenerator::emitResolveWithThis): Change to accept a + "resolveResult" argument. This is more clear, and reduces the + amount of double analysis happening at compile-time. + * bytecompiler/NodesCodegen.cpp: + (JSC::ResolveNode::emitBytecode): + (JSC::EvalFunctionCallNode::emitBytecode): + (JSC::FunctionCallResolveNode::emitBytecode): + (JSC::PostfixResolveNode::emitBytecode): + (JSC::DeleteResolveNode::emitBytecode): + (JSC::TypeOfResolveNode::emitBytecode): + (JSC::PrefixResolveNode::emitBytecode): + (JSC::ReadModifyResolveNode::emitBytecode): + (JSC::AssignResolveNode::emitBytecode): + (JSC::ConstDeclNode::emitCodeSingle): + (JSC::ForInNode::emitBytecode): Refactor to use the new + ResolveResult structure. + +2012-02-01 Csaba Osztrogonác + + Implement Error.stack + https://bugs.webkit.org/show_bug.cgi?id=66994 + + Unreviewed, rolling out r106407. + + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * interpreter/AbstractPC.cpp: + (JSC::AbstractPC::AbstractPC): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::throwException): + * interpreter/Interpreter.h: + (JSC): + (Interpreter): + * jsc.cpp: + (GlobalObject::finishCreation): + * parser/Parser.h: + (JSC::::parse): + * runtime/CommonIdentifiers.h: + * runtime/Error.cpp: + (JSC::addErrorInfo): + * runtime/Error.h: + (JSC): + +2012-01-31 Hajime Morrita + + Add missing JS_PRIVATE_EXPORTs + https://bugs.webkit.org/show_bug.cgi?id=77507 + + Reviewed by Kevin Ollivier. + + * heap/MarkedSpace.h: + (MarkedSpace): + * interpreter/Interpreter.h: + (Interpreter): + * runtime/JSValue.h: + (JSValue): + * wtf/text/AtomicString.h: + (WTF::AtomicString::add): + * wtf/text/WTFString.h: + (WTF): + +2012-01-31 Geoffrey Garen + + Stop using -fomit-frame-pointer + https://bugs.webkit.org/show_bug.cgi?id=77403 + + Reviewed by Filip Pizlo. + + JavaScriptCore is too fast. I'm just the man to fix it. + + * Configurations/JavaScriptCore.xcconfig: + +2012-01-31 Michael Saboff + + StringProtoFuncToUpperCase should call StringImpl::upper similar to StringProtoToLowerCase + https://bugs.webkit.org/show_bug.cgi?id=76647 + + Reviewed by Darin Adler. + + Changed stringProtoFuncToUpperCase to call StringImpl::upper() in a manor similar + to stringProtoFuncToLowerCase(). Fixed StringImpl::upper() to handle to special + cases. One case is s-sharp (0xdf) which converts to "SS". The other case is + for characters which become 16 bit values when converted to upper case. For + those, we up convert the the source string and use the 16 bit path. + + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncToUpperCase): + * wtf/text/StringImpl.cpp: + (WTF::StringImpl::upper): + * wtf/unicode/CharacterNames.h: + (smallLetterSharpS): New constant + +2012-01-31 Oliver Hunt + + Remove unneeded sourceId property + https://bugs.webkit.org/show_bug.cgi?id=77495 + + Reviewed by Filip Pizlo. + + sourceId isn't used anymore, so we'll just remove it. + + * runtime/Error.cpp: + (JSC): + (JSC::addErrorInfo): + (JSC::hasErrorInfo): + +2012-01-31 Oliver Hunt + + Implement Error.stack + https://bugs.webkit.org/show_bug.cgi?id=66994 + + Reviewed by Gavin Barraclough. + + Original patch by Juan Carlos Montemayor Elosua: + This patch utilizes topCallFrame to create a stack trace when + an error is thrown. Users will also be able to use the stack() + command in jsc to get arrays with stack trace information. + + Modified to be correct on ToT, with a variety of correctness, + performance, and security improvements. + + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * interpreter/Interpreter.cpp: + (JSC::getCallerLine): + (JSC::getSourceURLFromCallFrame): + (JSC::getStackFrameCodeType): + (JSC::Interpreter::getStackTrace): + (JSC::Interpreter::throwException): + * interpreter/Interpreter.h: + (JSC::StackFrame::toString): + * jsc.cpp: + (GlobalObject::finishCreation): + (functionJSCStack): + * parser/Parser.h: + (JSC::Parser::parse): + * runtime/CommonIdentifiers.h: + * runtime/Error.cpp: + (JSC::addErrorInfo): + * runtime/Error.h: + +2012-01-31 Scott Graham + + [Chromium] Remove references to gyp cygwin build target + https://bugs.webkit.org/show_bug.cgi?id=77253 + + Reviewed by Julien Chaffraix. + + Target dependency is no longer required, it's done earlier in the + build process. + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + +2012-01-31 Michael Saboff + + ASSERT(m_jumpsToLink.isEmpty()) failing in ARMv7Assembler dtor + https://bugs.webkit.org/show_bug.cgi?id=77443 + + Reviewed by Gavin Barraclough. + + Removed failing ASSERT() and thus destructor. The ASSERT isn't needed. + We are hitting it in the YARR JIT case where we bail out and go to the + interpreter with a partially JIT'ed function. Since we haven't linked + the JIT'ed code, there is likely to be some unresolved jumps in the vector + when the ARMv7Assembler destructor is called. For the case where we + complete the JIT process, we clear the vector at the end of + LinkBuffer::linkCode (LinkBuffer.h:292). + + * assembler/ARMv7Assembler.h: + (ARMv7Assembler): + +2012-01-31 Anders Carlsson + + Vector::operator== shouldn't require T to have operator!= + https://bugs.webkit.org/show_bug.cgi?id=77448 + + Reviewed by Andreas Kling. + + Change VectorComparer::compare to use !(a == b) instead of a != b since + it makes more sense for Vector::operator== to use the element's operator==. + + * wtf/Vector.h: + +2012-01-30 Oliver Hunt + + get_by_val_arguments is broken in the interpreter + https://bugs.webkit.org/show_bug.cgi?id=77389 + + Reviewed by Gavin Barraclough. + + When get_by_val had wad a value profile added, the same slot was not added to + get_by_val_arguments. This broke the interpreter as the interpreter falls + back on its regular get_by_val implementation. + + No tests are added as the interpreter is fairly broken in its + current state (multiple tests fail due to this bug). + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::dump): + * bytecode/Opcode.h: + (JSC): + (): + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitGetArgumentByVal): + +2012-01-30 Oliver Hunt + + Unexpected syntax error + https://bugs.webkit.org/show_bug.cgi?id=77340 + + Reviewed by Gavin Barraclough. + + Function calls and new expressions have the same semantics for + assignment, so should simply share their lhs handling. + + * parser/Parser.cpp: + (JSC::::parseMemberExpression): + +2012-01-30 Gavin Barraclough + + Unreviewed ARMv7 build fix. + + * tools/CodeProfiling.cpp: + (JSC): + (JSC::setProfileTimer): + (JSC::CodeProfiling::begin): + (JSC::CodeProfiling::end): + +2012-01-30 David Levin + + Using OS(WIN) or OS(MAC) should cause a build error. + https://bugs.webkit.org/show_bug.cgi?id=77162 + + Reviewed by Darin Adler. + + * wtf/Platform.h: Expand them into something that will + cause a compile error. + +2012-01-30 Yong Li + + [BlackBerry] OS(QNX) also has TM_GMTOFF, TM_ZONE, and TIMEGM + https://bugs.webkit.org/show_bug.cgi?id=77360 + + Reviewed by Rob Buis. + + Turn on HAVE(TM_GMTOFF), HAVE(TM_ZONE), and HAVE(TIMEGM) + for OS(QNX). + + * wtf/Platform.h: + +2012-01-30 Gavin Barraclough + + Speculative Windows build fix. + + * assembler/MacroAssemblerCodeRef.h: + (FunctionPtr): + +2012-01-30 Gavin Barraclough + + https://bugs.webkit.org/show_bug.cgi?id=77163 + MacroAssemblerCodeRef.h uses OS(WIN) instead of OS(WINDOWS) + + Rubber stamped by Geoff Garen + + * assembler/MacroAssemblerCodeRef.h: + +2012-01-30 Gavin Barraclough + + Unreviewed build fix for interpreter builds. + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::CodeBlock): + * bytecode/CodeBlock.h: + (CodeBlock): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + * tools/CodeProfile.cpp: + (JSC::CodeProfile::sample): + +2012-01-30 Gavin Barraclough + + Unreviewed build fix following bug#76855 + + * JavaScriptCore.exp: + +2012-01-30 Michael Saboff + + CaseFoldingHash::hash() doesn't handle 8 bit strings directly + https://bugs.webkit.org/show_bug.cgi?id=76652 + + Reviewed by Andreas Kling. + + * wtf/text/StringHash.h: + (WTF::CaseFoldingHash::hash): Added 8 bit string code path. + +2012-01-30 Michael Saboff + + stringProtoFuncReplace converts 8 bit strings to 16 bit during replacement + https://bugs.webkit.org/show_bug.cgi?id=76651 + + Reviewed by Geoffrey Garen. + + Made local function substituteBackreferencesSlow a template function + based on character width. Cleaned up getCharacters() in both UString + and StringImpl. Changed getCharacters to up convert an 8 bit + string to 16 bits if necessary. + + * runtime/StringPrototype.cpp: + (JSC::substituteBackreferencesSlow): + (JSC::substituteBackreferences): + * runtime/UString.h: + (JSC::LChar): + (JSC::UChar): + * wtf/text/StringImpl.h: + (WTF::UChar): + +2012-01-30 Gavin Barraclough + + Clean up putDirect + https://bugs.webkit.org/show_bug.cgi?id=76232 + + Reviewed by Sam Weinig. + + Part 3 - merge op_put_getter & op_put_setter. + + Putting these separately is inefficient (and makes future optimiation, + e.g. making GetterSetter immutable) harder. Change to emit a single + op_put_getter_setter bytecode op. Ultimately we should probably be + able to merge this with put direct, to create a common op to initialize + object literal properties. + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::dump): + * bytecode/Opcode.h: + (JSC): + (): + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitPutGetterSetter): + * bytecompiler/BytecodeGenerator.h: + (BytecodeGenerator): + * bytecompiler/NodesCodegen.cpp: + (JSC::PropertyListNode::emitBytecode): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + * jit/JIT.cpp: + (JSC::JIT::privateCompileMainPass): + * jit/JIT.h: + (JIT): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::emit_op_put_getter_setter): + * jit/JITPropertyAccess32_64.cpp: + (JSC::JIT::emit_op_put_getter_setter): + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * jit/JITStubs.h: + (): + * runtime/JSObject.cpp: + (JSC::JSObject::putDirectVirtual): + (JSC::JSObject::putDirectAccessor): + (JSC): + (JSC::putDescriptor): + (JSC::JSObject::defineOwnProperty): + * runtime/JSObject.h: + (): + (JSC::JSObject::putDirectInternal): + (JSC::JSObject::putDirect): + (JSC::JSObject::putDirectWithoutTransition): + +2012-01-30 Michael Saboff + + Dromaeo tests call parseSimpleLengthValue() on 8 bit strings + https://bugs.webkit.org/show_bug.cgi?id=76649 + + Reviewed by Geoffrey Garen. + + * JavaScriptCore.exp: Added export for charactersToDouble. + +2012-01-30 Michael Saboff + + WebCore decodeEscapeSequences unnecessarily converts 8 bit strings to 16 bit when decoding. + https://bugs.webkit.org/show_bug.cgi?id=76648 + + Reviewed by Geoffrey Garen. + + Added a new overloaded append member that takes a String& argument, an offest + and a length to do direct sub string appending to a StringBuilder. + + * wtf/text/StringBuilder.h: + (WTF::StringBuilder::append): + +2012-01-29 Zoltan Herczeg + + Custom written CSS lexer + https://bugs.webkit.org/show_bug.cgi?id=70107 + + Reviewed by Antti Koivisto and Oliver Hunt. + + Add new helper functions for the custom written CSS lexer. + + * wtf/ASCIICType.h: + (WTF::toASCIILowerUnchecked): + (WTF): + (WTF::isASCIIAlphaCaselessEqual): + +2012-01-29 Filip Pizlo + + REGRESSION (r105576-r105582): Web Inspector Crash in JSC::JSValue::toString(JSC::ExecState*) const + https://bugs.webkit.org/show_bug.cgi?id=77146 + + + Reviewed by Oliver Hunt. + + The old JIT expects that the result of the last operation is in the lastResultRegister. The DFG JIT is + designed to correctly track the lastResultRegister by looking at SetLocal nodes. However, when the DFG + JIT inlines a code block, it forgets that the inlined code block's result would have been placed in the + lastResultRegister. Hence if we OSR exit on the first node following the end of an inlined code block + that had a return value, and that first node uses the return value, the old JIT will get massively + confused. This patch takes a surgical approach: instead of making the DFG smarter, it makes the old + JIT slightly dumber. + + * jit/JITCall.cpp: + (JSC::JIT::emit_op_call_put_result): + +2012-01-29 Filip Pizlo + + Build fix for Mac non-x64 platforms. + + * tools/CodeProfiling.cpp: + (JSC): + +2012-01-28 Gavin Barraclough + + Reserve 'let' + https://bugs.webkit.org/show_bug.cgi?id=77293 + + Rubber stamped by Oliver Hunt. + + 'let' may become a keyword in ES6. We're going to try experimentally reserving it, + to see if this breaks the web. + + * parser/Keywords.table: + +2012-01-27 Gavin Barraclough + + Implement a JIT-code aware sampling profiler for JSC + https://bugs.webkit.org/show_bug.cgi?id=76855 + + Reviewed by Oliver Hunt. + + To enable the profiler, set the JSC_CODE_PROFILING environment variable to + 1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively + trace all samples). + + The profiler requires -fomit-frame-pointer to be removed from the build flags. + + * JavaScriptCore.exp: + - Removed an export. + * JavaScriptCore.xcodeproj/project.pbxproj: + - Added new files + * bytecode/CodeBlock.cpp: + - For baseline codeblocks, cache the result of canCompileWithDFG. + * bytecode/CodeBlock.h: + - For baseline codeblocks, cache the result of canCompileWithDFG. + * jit/ExecutableAllocator.cpp: + (JSC::ExecutableAllocator::initializeAllocator): + - Notify the profiler when the allocator is created. + (JSC::ExecutableAllocator::allocate): + - Inform the allocated of the ownerUID. + * jit/ExecutableAllocatorFixedVMPool.cpp: + (JSC::ExecutableAllocator::initializeAllocator): + - Notify the profiler when the allocator is created. + (JSC::ExecutableAllocator::allocate): + - Inform the allocated of the ownerUID. + * jit/JITStubs.cpp: + - If profiling, don't mask the return address in JIT code. + (We do so to provide nicer backtraces in debug builds). + * runtime/Completion.cpp: + (JSC::evaluate): + - Notify the profiler of script evaluations. + * tools: Added. + * tools/CodeProfile.cpp: Added. + (JSC::symbolName): + - Helper function to get the name of a symbol in the framework. + (JSC::truncateTrace): + - Helper to truncate traces into methods know to have uninformatively deep stacks. + (JSC::CodeProfile::sample): + - Record a stack trace classifying samples. + (JSC::CodeProfile::report): + - {Print profiler output. + * tools/CodeProfile.h: Added. + - new class, captures a set of samples associated with an evaluated script, + and nested to record samples from subscripts. + * tools/CodeProfiling.cpp: Added. + (JSC::CodeProfiling::profilingTimer): + - callback fired then a timer event occurs. + (JSC::CodeProfiling::notifyAllocator): + - called when the executable allocator is constructed. + (JSC::CodeProfiling::getOwnerUIDForPC): + - helper to lookup the codeblock from an address in JIT code + (JSC::CodeProfiling::begin): + - enter a profiling scope. + (JSC::CodeProfiling::end): + - exit a profiling scope. + * tools/CodeProfiling.h: Added. + - new class, instantialed from Completion to define a profiling scope. + * tools/ProfileTreeNode.h: Added. + - new class, used to construct a tree of samples. + * tools/TieredMMapArray.h: Added. + - new class, a malloc-free vector (can be used while the main thread is suspended, + possibly holding the malloc heap lock). + * wtf/MetaAllocator.cpp: + (WTF::MetaAllocatorHandle::MetaAllocatorHandle): + (WTF::MetaAllocator::allocate): + - Allow allocation handles to track information about their owner. + * wtf/MetaAllocator.h: + (MetaAllocator): + - Allow allocation handles to track information about their owner. + * wtf/MetaAllocatorHandle.h: + (MetaAllocatorHandle): + (WTF::MetaAllocatorHandle::ownerUID): + - Allow allocation handles to track information about their owner. + * wtf/OSAllocator.h: + (WTF::OSAllocator::reallocateCommitted): + - reallocate an existing, committed memory allocation. + +2012-01-28 Sheriff Bot + + Unreviewed, rolling out r106187. + http://trac.webkit.org/changeset/106187 + https://bugs.webkit.org/show_bug.cgi?id=77276 + + The last rollout was a false charge. (Requested by morrita on + #webkit). + + * runtime/ExceptionHelpers.h: + (InterruptedExecutionError): + * runtime/JSBoundFunction.h: + (JSBoundFunction): + * runtime/RegExp.h: + (RegExp): + * runtime/RegExpMatchesArray.h: + (RegExpMatchesArray): + +2012-01-28 Sheriff Bot + + Unreviewed, rolling out r106151. + http://trac.webkit.org/changeset/106151 + https://bugs.webkit.org/show_bug.cgi?id=77275 + + may break windows build (Requested by morrita on #webkit). + + * runtime/ExceptionHelpers.h: + (InterruptedExecutionError): + * runtime/JSBoundFunction.h: + (JSBoundFunction): + * runtime/RegExp.h: + (RegExp): + * runtime/RegExpMatchesArray.h: + (RegExpMatchesArray): + +2012-01-28 Filip Pizlo + + GC invoked while doing an old JIT property storage reallocation may lead + to an object that refers to a dead structure + https://bugs.webkit.org/show_bug.cgi?id=77273 + + + Reviewed by Gavin Barraclough. + + The put_by_id transition was already saving the old structure by virtue of + having the object on the stack, so that wasn't going to get deleted. But the + new structure was unprotected in the transition. I've now changed the + transition code to save the new structure, ensuring that the GC will know it + to be marked if invoked from within put_by_id_transition_realloc. + + * jit/JITPropertyAccess.cpp: + (JSC::JIT::privateCompilePutByIdTransition): + * jit/JITPropertyAccess32_64.cpp: + (JSC::JIT::privateCompilePutByIdTransition): + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * jit/JITStubs.h: + (JSC): + (): + +2012-01-27 Sheriff Bot + + Unreviewed, rolling out r106167. + http://trac.webkit.org/changeset/106167 + https://bugs.webkit.org/show_bug.cgi?id=77264 + + broke LayoutTests/fast/js/string-capitalization.html + (Requested by msaboff on #webkit). + + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncToLowerCase): + (JSC::stringProtoFuncToUpperCase): + * wtf/text/StringImpl.cpp: + (WTF::StringImpl::upper): + +2012-01-27 Filip Pizlo + + Build fix for interpreter platforms. + + * interpreter/AbstractPC.cpp: + (JSC::AbstractPC::AbstractPC): + +2012-01-27 Michael Saboff + + StringProtoFuncToUpperCase should call StringImpl::upper similar to StringProtoToLowerCase + https://bugs.webkit.org/show_bug.cgi?id=76647 + + Reviewed by Geoffrey Garen. + + Changed stringProtoFuncToUpperCase to call StringImpl::upper() is a manor similar + to stringProtoFuncToLowerCase(). Fixed StringImpl::upper() to handle the two + 8 bit characters that when converted to upper case become 16 bit characters. + + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncToLowerCase): Removed extra trailing whitespace. + (JSC::stringProtoFuncToUpperCase): + * wtf/text/StringImpl.cpp: + (WTF::StringImpl::upper): + +2012-01-27 Hajime Morita + + [JSC] ThunkGenerators.cpp should hide its asm-defined symbols + https://bugs.webkit.org/show_bug.cgi?id=77244 + + Reviewed by Filip Pizlo. + + * jit/ThunkGenerators.cpp: Added HIDE_SYMBOLS() + * wtf/InlineASM.h: Moved some duplicated macros from ThunkGenerators.cpp + +2012-01-27 Simon Hausmann + + [JSC] Asm-originated symbols should be marked as hidden + https://bugs.webkit.org/show_bug.cgi?id=77150 + + Reviewed by Filip Pizlo. + + * dfg/DFGOperations.cpp: The HIDE_SYMBOLS macros were present in the CPU(ARM) preprocessor branches, + but they were missing in the CPU(X86) and the CPU(X86_64) cases. + +2012-01-27 MORITA Hajime + + [JSC] Some JS_EXPORTDATA may not be necessary. + https://bugs.webkit.org/show_bug.cgi?id=77145 + + Reviewed by Darin Adler. + + Removed JS_EXPORTDATA attributes whose attributing symbols are + not exported on Mac port. + + * runtime/ExceptionHelpers.h: + (InterruptedExecutionError): + * runtime/JSBoundFunction.h: + (JSBoundFunction): + * runtime/RegExp.h: + (RegExp): + * runtime/RegExpMatchesArray.h: + (RegExpMatchesArray): + +2012-01-27 MORITA Hajime + + [WTF] WTFString.h has some extra JS_EXPORT_PRIVATEs + https://bugs.webkit.org/show_bug.cgi?id=77113 + + Reviewed by Darin Adler. + + * wtf/text/WTFString.h: Removed some WTF_EXPORT_PRIVATE attributes which we don't need to export. + +2012-01-27 Zeno Albisser + + [Qt][Mac] Build fails after adding ICU support (r105997). + https://bugs.webkit.org/show_bug.cgi?id=77118 + + Use Apple code path for unicode date formats on mac. + + Reviewed by Tor Arne Vestbø. + + * runtime/DatePrototype.cpp: + (): + +2012-01-27 Carlos Garcia Campos + + [GTK] Add a GKeyFile especialization to GOwnPtr + https://bugs.webkit.org/show_bug.cgi?id=77191 + + Reviewed by Martin Robinson. + + * wtf/gobject/GOwnPtr.cpp: + (WTF::GKeyFile): Implement freeOwnedGPtr for GKeyFile. + * wtf/gobject/GOwnPtr.h: Add GKeyFile template. + * wtf/gobject/GTypedefs.h: Add forward declaration for GKeyFile. + +2012-01-25 Yury Semikhatsky + + Web Inspector: should be possible to open function declaration from script popover + https://bugs.webkit.org/show_bug.cgi?id=76913 + + Added display function name and source location to the popover in scripts panel. + Now when a function is hovered user can navigate to its definition. + + Reviewed by Pavel Feldman. + + * JavaScriptCore/JavaScriptCore.exp + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * runtime/JSFunction.h: + (JSFunction): + +2012-01-26 Kevin Ollivier + + [wx] Unreviewed. Build fix, wx uses the Mac ICU headers so we must match Mac behavior. + + * runtime/DatePrototype.cpp: + (): + +2012-01-26 Mark Hahnenberg + + Merge AllocationSpace into MarkedSpace + https://bugs.webkit.org/show_bug.cgi?id=77116 + + Reviewed by Geoffrey Garen. + + Merging AllocationSpace and MarkedSpace in preparation for future refactoring/enhancement to + MarkedSpace allocation. + + * CMakeLists.txt: + * GNUmakefile.list.am: + * JavaScriptCore.exp: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * Target.pri: + * heap/AllocationSpace.cpp: Removed. + * heap/AllocationSpace.h: Removed. + * heap/BumpSpace.h: + (BumpSpace): + * heap/Heap.h: + (JSC::Heap::objectSpace): + (Heap): + (): + * heap/HeapBlock.h: + (): + * heap/MarkedSpace.cpp: + (JSC::MarkedSpace::tryAllocateHelper): + (JSC): + (JSC::MarkedSpace::tryAllocate): + (JSC::MarkedSpace::allocateSlowCase): + (JSC::MarkedSpace::allocateBlock): + (JSC::MarkedSpace::freeBlocks): + (TakeIfUnmarked): + (JSC::TakeIfUnmarked::TakeIfUnmarked): + (JSC::TakeIfUnmarked::operator()): + (JSC::TakeIfUnmarked::returnValue): + (JSC::MarkedSpace::shrink): + (GatherDirtyCells): + (JSC::GatherDirtyCells::returnValue): + (JSC::GatherDirtyCells::GatherDirtyCells): + (JSC::GatherDirtyCells::operator()): + (JSC::MarkedSpace::gatherDirtyCells): + * heap/MarkedSpace.h: + (MarkedSpace): + (JSC::MarkedSpace::blocks): + (JSC::MarkedSpace::forEachCell): + (JSC): + (JSC::MarkedSpace::allocate): + +2012-01-26 Oliver Hunt + + MSVC bug fix. + MSVC generates bad code for enum compare. + + RS=Geoff + + Make bitfield large enough to work around MSVC's desire to make enums + signed types. + + * bytecode/CallLinkInfo.h: + (CallLinkInfo): + +2012-01-26 Filip Pizlo + + All DFG helpers that may call out to arbitrary JS code must know where they + were called from due to inlining and call stack walking + https://bugs.webkit.org/show_bug.cgi?id=77070 + + + Reviewed by Geoff Garen. + + Changed the DFG to always record a code origin index in the tag of the argument + count (which we previously left blank for the benefit of LLInt, but is still + otherwise unused by the DFG), so that if we ever need to walk the stack accurately + we know where to start. In particular, if the current ExecState* points several + semantic call frames away from the true semantic call frame because we had + performed inlining, having the code origin index recorded means that we can reify + those call frames as necessary to give runtime/library code an accurate view of + the current JS state. + + This required several large but mechanical changes: + + - Calling a function from the DFG now plants a store32 instruction to store the + code origin index. But the indices of code origins were previously picked by + the DFG::JITCompiler after code generation completed. I changed this somewhat; + even though the code origins are put into the CodeBlock after code gen, the + code gen now knows a priori what their indices will be. Extensive assertions + are in place to ensure that the two don't get out of sync, in the form of the + DFG::CallBeginToken. Note that this mechanism has almost no effect on JS calls; + those don't need the code origin index set in the call frame because we can get + it by doing a binary search on the return PC. + + - Stack walking now always calls trueCallFrame() first before beginning the walk, + since even the top call frame may be wrong. It still calls trueCallerFrame() as + before to get to the next frame, though trueCallerFrame() is now mostly a + wrapper around callerFrame()->trueCallFrame(). + + - Because the mechanism for getting the code origin of a call frame is bimodal + (either the call frame knows its code origin because the code origin index was + set, or it's necessary to use the callee frame's return PC), I put in extra + mechanisms to determine whether your caller, or your callee, corresponds to + a call out of C++ code. Previously we just had the host call flag, but this is + insufficient as it does not cover the case of someone calling JSC::call(). But + luckily we can determine this just by looking at the return PC: if the return + PC is in range of the ctiTrampiline, then two things are true: this call + frame's PC will tell you nothing about where you came from in your caller, and + the caller already knows where it's at because it must have set the code origin + index (unless it's not DFG code, in which case we don't care because there is + no inlining to worry about). + + - During testing this revealed a simple off-by-one goof in DFG::ByteCodeParser's + inlining code, so I fixed it. + + - Finally because I was tired of doing random #if's for checking if I should be + passing around an Instruction* or a ReturnAddressPtr, I created a class called + AbstractPC that holds whatever notion of a PC is appropriate for the current + execution environment. It's designed to work gracefully even if both the + interpreter and the JIT are compiled in, and should integrate nicely with the + LLInt. + + This is neutral on all benchmarks and fixes some nasty corner-case regressions of + evil code that uses combinations of getters/setters and function.arguments. + + * CMakeLists.txt: + * GNUmakefile.list.am: + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * Target.pri: + * bytecode/CodeBlock.h: + (JSC::CodeBlock::codeOrigin): + (CodeBlock): + * dfg/DFGByteCodeParser.cpp: + (JSC::DFG::ByteCodeParser::handleInlining): + * dfg/DFGJITCompiler.cpp: + (JSC::DFG::JITCompiler::link): + * dfg/DFGJITCompiler.h: + (CallBeginToken): + (JSC::DFG::CallBeginToken::CallBeginToken): + (JSC::DFG::CallBeginToken::assertCodeOriginIndex): + (JSC::DFG::CallBeginToken::assertNoCodeOriginIndex): + (DFG): + (JSC::DFG::CallExceptionRecord::CallExceptionRecord): + (CallExceptionRecord): + (JSC::DFG::JITCompiler::JITCompiler): + (JITCompiler): + (JSC::DFG::JITCompiler::nextCallBeginToken): + (JSC::DFG::JITCompiler::beginCall): + (JSC::DFG::JITCompiler::notifyCall): + (JSC::DFG::JITCompiler::addExceptionCheck): + (JSC::DFG::JITCompiler::addFastExceptionCheck): + * dfg/DFGOperations.cpp: + (): + * dfg/DFGRepatch.cpp: + (JSC::DFG::tryBuildGetByIDList): + * dfg/DFGSpeculativeJIT.h: + (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck): + * dfg/DFGSpeculativeJIT32_64.cpp: + (JSC::DFG::SpeculativeJIT::emitCall): + * dfg/DFGSpeculativeJIT64.cpp: + (JSC::DFG::SpeculativeJIT::emitCall): + * interpreter/AbstractPC.cpp: Added. + (JSC): + (JSC::AbstractPC::AbstractPC): + * interpreter/AbstractPC.h: Added. + (JSC): + (AbstractPC): + (JSC::AbstractPC::AbstractPC): + (JSC::AbstractPC::hasJITReturnAddress): + (JSC::AbstractPC::jitReturnAddress): + (JSC::AbstractPC::hasInterpreterReturnAddress): + (JSC::AbstractPC::interpreterReturnAddress): + (JSC::AbstractPC::isSet): + (JSC::AbstractPC::operator!): + (): + * interpreter/CallFrame.cpp: + (JSC): + (JSC::CallFrame::trueCallFrame): + (JSC::CallFrame::trueCallerFrame): + * interpreter/CallFrame.h: + (JSC::ExecState::abstractReturnPC): + (JSC::ExecState::codeOriginIndexForDFGWithInlining): + (ExecState): + (JSC::ExecState::trueCallFrame): + (JSC::ExecState::trueCallFrameFromVMCode): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::retrieveArgumentsFromVMCode): + (JSC::Interpreter::retrieveCallerFromVMCode): + (JSC::Interpreter::findFunctionCallFrameFromVMCode): + * interpreter/Interpreter.h: + (Interpreter): + (): + * jit/JITStubs.cpp: + (JSC): + (): + * jit/JITStubs.h: + (JSC): + (JSC::returnAddressIsInCtiTrampoline): + * runtime/JSFunction.cpp: + (JSC::JSFunction::argumentsGetter): + (JSC::JSFunction::callerGetter): + (JSC::JSFunction::getOwnPropertyDescriptor): + +2012-01-26 Peter Varga + + Fix build when VERBOSE_SPECULATION_FAILURE is enabled in DFG + https://bugs.webkit.org/show_bug.cgi?id=77104 + + Reviewed by Filip Pizlo. + + * dfg/DFGOperations.cpp: + (): + +2012-01-26 Michael Saboff + + String::latin1() should take advantage of 8 bit strings + https://bugs.webkit.org/show_bug.cgi?id=76646 + + Reviewed by Geoffrey Garen. + + * wtf/text/WTFString.cpp: + (WTF::String::latin1): For 8 bit strings, use existing buffer + without conversion. + +2012-01-26 Michael Saboff + + Dromaeo tests usage of StringImpl find routines cause 8->16 bit conversions + https://bugs.webkit.org/show_bug.cgi?id=76645 + + Reviewed by Geoffrey Garen. + + * wtf/text/StringImpl.cpp: + (WTF::equalIgnoringCase): New LChar version. + (WTF::findInner): New helper function. + (WTF::StringImpl::find): Added 8 bit path. + (WTF::reverseFindInner): New helper funciton. + (WTF::StringImpl::reverseFind): Added 8 bit path. + (WTF::StringImpl::reverseFindIgnoringCase): Added 8 bit path. + * wtf/text/StringImpl.h: + (WTF): + +2012-01-26 Csaba Osztrogonác + + [Qt][Win] One more speculative buildfix after r105970. + + * JavaScriptCore.pri: + +2012-01-26 Csaba Osztrogonác + + [Qt][Win] Speculative buildfix after r105970. + + * JavaScriptCore.pri: Link lgdi for DeleteObject() and DeleteDC(). + +2012-01-26 Sheriff Bot + + Unreviewed, rolling out r105982. + http://trac.webkit.org/changeset/105982 + https://bugs.webkit.org/show_bug.cgi?id=77090 + + breaks the world (Requested by WildFox on #webkit). + + * wtf/MainThread.cpp: + (WTF): + * wtf/Platform.h: + * wtf/mac/MainThreadMac.mm: + (WTF): + (WTF::registerGCThread): + (WTF::isMainThreadOrGCThread): + +2012-01-26 Roland Takacs + + [Qt] GC should be parallel on Qt platform + https://bugs.webkit.org/show_bug.cgi?id=73309 + + Reviewed by Zoltan Herczeg. + + These changes made the parallel gc feature available for Qt port. + The implementation of "registerGCThread" and "isMainThreadOrGCThread" + is moved from MainThreadMac.mm to the common MainThread.cpp to make + them available for other platforms. + + Measurement results: + V8 speed-up: 1.071x as fast [From: 746.1ms To: 696.4ms ] + WindScorpion speed-up: 1.082x as fast [From: 3490.4ms To: 3226.7ms] + V8 Splay speed-up: 1.158x as fast [From: 145.8ms To: 125.9ms ] + + Tested on Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz with 4-core. + + * wtf/MainThread.cpp: + (WTF): + (WTF::registerGCThread): + (WTF::isMainThreadOrGCThread): + * wtf/Platform.h: + * wtf/mac/MainThreadMac.mm: + +2012-01-26 Andy Estes + + REGRESSION (r105555): Incorrect use of OS() macro breaks OwnPtr when used with Win32 data types + https://bugs.webkit.org/show_bug.cgi?id=77073 + + Reviewed by Ryosuke Niwa. + + r105555 changed PLATFORM(WIN) to OS(WIN), but WTF_OS_WIN isn't defined. + This should have been changed to OS(WINDOWS). This causes the + preprocessor to strip out Win32 data type overrides for deleteOwnedPtr, + causing allocations made by Win32 to be deleted by fastmalloc. + + * wtf/OwnPtrCommon.h: + (WTF): Use OS(WINDOWS) instead of OS(WIN). + +2012-01-25 Mark Rowe + + Attempted Mac build fix after r105939. + + * runtime/DatePrototype.cpp: Don't #include unicode/udat.h on Mac or iOS. + It isn't used on these platforms and isn't available in the ICU headers + for Mac. + +2012-01-25 Mark Rowe + + Build in to an alternate location when USE_STAGING_INSTALL_PATH is set. + + Adopt USE_STAGING_INSTALL_PATH + + Reviewed by David Kilzer. + + * Configurations/Base.xcconfig: Define NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR, which contains + the path where JavaScriptCore is normally installed. Update JAVASCRIPTCORE_FRAMEWORKS_DIR + to point to the staged frameworks directory when USE_STAGING_INSTALL_PATH is set. + * Configurations/JavaScriptCore.xcconfig: Always set the framework's install name based on + the normal framework location. This prevents an incorrect install name from being used when + installing in to the staged frameworks directory. + +2012-01-25 Eli Fidler + + Implement Date.toLocaleString() using ICU + https://bugs.webkit.org/show_bug.cgi?id=76714 + + Reviewed by Darin Adler. + + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + +2012-01-25 Hajime Morita + + ENABLE_SHADOW_DOM should be available via build-webkit --shadow-dom + https://bugs.webkit.org/show_bug.cgi?id=76863 + + Reviewed by Dimitri Glazkov. + + Added a feature flag. + + * Configurations/FeatureDefines.xcconfig: + +2012-01-25 Yong Li + + [BlackBerry] Implement OSAllocator::commit/decommit. + BlackBerry port should support virtual memory decommiting. + https://bugs.webkit.org/show_bug.cgi?id=77013 + + Reviewed by Rob Buis. + + * wtf/OSAllocatorPosix.cpp: + (WTF::OSAllocator::reserveUncommitted): + (WTF::OSAllocator::commit): + (WTF::OSAllocator::decommit): + * wtf/Platform.h: + +2012-01-24 Oliver Hunt + + Make DFG update topCallFrame + https://bugs.webkit.org/show_bug.cgi?id=76969 + + Reviewed by Filip Pizlo. + + Add NativeCallFrameTracer to manage topCallFrame assignment + in the DFG operations, and make use of it. + + * dfg/DFGOperations.cpp: + (JSC::DFG::operationPutByValInternal): + (): + * interpreter/Interpreter.h: + (JSC): + (NativeCallFrameTracer): + (JSC::NativeCallFrameTracer::NativeCallFrameTracer): + +2012-01-24 Filip Pizlo + + Inlining breaks call frame walking when the walking is done from outside the inlinee, + but inside a code block that had inlining + https://bugs.webkit.org/show_bug.cgi?id=76978 + + + Reviewed by Oliver Hunt. + + * bytecode/CodeBlock.h: + (JSC::CodeBlock::codeOriginForReturn): + * interpreter/CallFrame.cpp: + (JSC::CallFrame::trueCallerFrame): + +2012-01-24 Gavin Barraclough + + https://bugs.webkit.org/show_bug.cgi?id=76855 + Implement a JIT-code aware sampling profiler for JSC + + Reviewed by Oliver Hunt. + + Add support to MetaAllocator.cpp to track all live handles in a map, + allowing lookup based on any address within the allocation. + + * wtf/MetaAllocator.cpp: + (WTF::MetaAllocatorTracker::notify): + (WTF::MetaAllocatorTracker::release): + - Track live handle objects in a map. + (WTF::MetaAllocator::release): + - Removed support for handles with null m_allocator (no longer used). + - Notify the tracker of handles being released. + (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): + - Moved functionality out into MetaAllocator::release. + (WTF::MetaAllocatorHandle::shrink): + - Removed support for handles with null m_allocator (no longer used). + (WTF::MetaAllocator::MetaAllocator): + - Initialize m_tracker. + (WTF::MetaAllocator::allocate): + - Notify the tracker of new allocations. + * wtf/MetaAllocator.h: + (WTF::MetaAllocatorTracker::find): + - Lookup a MetaAllocatorHandle based on an address inside the allocation. + (WTF::MetaAllocator::trackAllocations): + - Register a callback object to track allocation state. + * wtf/MetaAllocatorHandle.h: + - Remove unused createSelfManagedHandle/constructor. + (WTF::MetaAllocatorHandle::key): + - Added, for use in RedBlackTree. + +2012-01-24 Mark Hahnenberg + + Use copying collector for out-of-line JSObject property storage + https://bugs.webkit.org/show_bug.cgi?id=76665 + + Reviewed by Geoffrey Garen. + + * runtime/JSObject.cpp: + (JSC::JSObject::visitChildren): Changed to use copyAndAppend whenever the property storage is out-of-line. + Also added a temporary variable to avoid warnings from GCC. + (JSC::JSObject::allocatePropertyStorage): Changed to use tryAllocateStorage/tryReallocateStorage as opposed to + operator new. Also added a temporary variable to avoid warnings from GCC. + * runtime/JSObject.h: + +2012-01-24 Geoffrey Garen + + JSValue::toString() should return a JSString* instead of a UString + https://bugs.webkit.org/show_bug.cgi?id=76861 + + Fixed two failing layout tests after my last patch. + + Reviewed by Gavin Barraclough. + + * runtime/ArrayPrototype.cpp: + (JSC::arrayProtoFuncSort): Call value() after calling toString(), as + in all other cases. + + I missed this case because the JSString* type has a valid operator<, + so the compiler didn't complain. + +2012-01-24 Kenichi Ishibashi + + [V8] Add Uint8ClampedArray support + https://bugs.webkit.org/show_bug.cgi?id=76803 + + Reviewed by Kenneth Russell. + + * wtf/ArrayBufferView.h: + (WTF::ArrayBufferView::isUnsignedByteClampedArray): Added. + * wtf/Uint8ClampedArray.h: + (WTF::Uint8ClampedArray::isUnsignedByteClampedArray): Overridden to return true. + +2012-01-23 Carlos Garcia Campos + + [GTK] Add WebKitDownload to WebKit2 GTK+ API + https://bugs.webkit.org/show_bug.cgi?id=72949 + + Reviewed by Martin Robinson. + + * wtf/gobject/GOwnPtr.cpp: + (WTF::GTimer): Use g_timer_destroy() to free a GTimer. + * wtf/gobject/GOwnPtr.h: Add GTimer template. + * wtf/gobject/GTypedefs.h: Add GTimer forward declaration. + +2012-01-24 Ilya Tikhonovsky + + Unreviewed build fix for Qt LinuxSH4 build after r105698. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + +2012-01-23 Geoffrey Garen + + JSValue::toString() should return a JSString* instead of a UString + https://bugs.webkit.org/show_bug.cgi?id=76861 + + Reviewed by Gavin Barraclough. + + This makes the common case -- toString() on a string -- faster and + inline-able. (Not a measureable speedup, but we can now remove a bunch + of duplicate hand-rolled code for this optimization.) + + This also clarifies the boundary between "C++ strings" and "JS strings". + + In all cases other than true, false, null, undefined, and multi-digit + numbers, the JS runtime was just retrieving a UString from a JSString, + so returning a JSString* is strictly better. In the other cases, we can + optimize to avoid creating a new JSString if we care to, but it doesn't + seem to be a big deal. + + * JavaScriptCore.exp: Export! + + * jsc.cpp: + (functionPrint): + (functionDebug): + (functionRun): + (functionLoad): + (functionCheckSyntax): + (runWithScripts): + (runInteractive): + * API/JSValueRef.cpp: + (JSValueToStringCopy): + * bytecode/CodeBlock.cpp: + (JSC::valueToSourceString): Call value() after calling toString(), to + convert from "JS string" (JSString*) to "C++ string" (UString), since + toString() no longer returns a "C++ string". + + * dfg/DFGOperations.cpp: + (JSC::DFG::operationValueAddNotNumber): + * jit/JITStubs.cpp: + (op_add): Updated for removal of toPrimitiveString(): + all '+' operands can use toString(), except for object operands, which + need to take a slow path to call toPrimitive(). + + * runtime/ArrayPrototype.cpp: + (JSC::arrayProtoFuncToString): + (JSC::arrayProtoFuncToLocaleString): + (JSC::arrayProtoFuncJoin): + (JSC::arrayProtoFuncPush): + * runtime/CommonSlowPaths.h: + (JSC::CommonSlowPaths::opIn): + * runtime/DateConstructor.cpp: + (JSC::dateParse): + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): Call value() after calling toString(), as above. + + * runtime/ErrorInstance.h: + (JSC::ErrorInstance::create): Simplified down to one canonical create() + function, to make string handling easier. + + * runtime/ErrorPrototype.cpp: + (JSC::errorProtoFuncToString): + * runtime/ExceptionHelpers.cpp: + (JSC::createInvalidParamError): + (JSC::createNotAConstructorError): + (JSC::createNotAFunctionError): + (JSC::createNotAnObjectError): + * runtime/FunctionConstructor.cpp: + (JSC::constructFunctionSkippingEvalEnabledCheck): + * runtime/FunctionPrototype.cpp: + (JSC::functionProtoFuncBind): + * runtime/JSArray.cpp: + (JSC::JSArray::sort): Call value() after calling toString(), as above. + + * runtime/JSCell.cpp: + * runtime/JSCell.h: Removed JSCell::toString() because JSValue does this + job now. Doing it in JSCell is slower (requires extra type checking), and + creates the misimpression that language-defined toString() behavior is + an implementation detail of JSCell. + + * runtime/JSGlobalObjectFunctions.cpp: + (JSC::encode): + (JSC::decode): + (JSC::globalFuncEval): + (JSC::globalFuncParseInt): + (JSC::globalFuncParseFloat): + (JSC::globalFuncEscape): + (JSC::globalFuncUnescape): Call value() after calling toString(), as above. + + * runtime/JSONObject.cpp: + (JSC::unwrapBoxedPrimitive): + (JSC::Stringifier::Stringifier): + (JSC::JSONProtoFuncParse): Removed some manual optimization that toString() + takes care of. + + * runtime/JSObject.cpp: + (JSC::JSObject::toString): + * runtime/JSObject.h: Updated to return JSString*. + + * runtime/JSString.cpp: + * runtime/JSString.h: + (JSC::JSValue::toString): Removed, since I removed JSCell::toString(). + + * runtime/JSValue.cpp: + (JSC::JSValue::toStringSlowCase): Removed toPrimitiveString(), and re- + spawned toStringSlowCase() from its zombie corpse, since toPrimitiveString() + basically did what we want all the time. (Note that the toPrimitive() + preference changes from NoPreference to PreferString, because that's + how ToString is defined in the language. op_add does not want this behavior.) + + * runtime/NumberPrototype.cpp: + (JSC::numberProtoFuncToString): + (JSC::numberProtoFuncToLocaleString): A little simpler, now that toString() + returns a JSString*. + + * runtime/ObjectConstructor.cpp: + (JSC::objectConstructorGetOwnPropertyDescriptor): + (JSC::objectConstructorDefineProperty): + * runtime/ObjectPrototype.cpp: + (JSC::objectProtoFuncHasOwnProperty): + (JSC::objectProtoFuncDefineGetter): + (JSC::objectProtoFuncDefineSetter): + (JSC::objectProtoFuncLookupGetter): + (JSC::objectProtoFuncLookupSetter): + (JSC::objectProtoFuncPropertyIsEnumerable): More calls to value(), as above. + + * runtime/Operations.cpp: + (JSC::jsAddSlowCase): Need to check for object before taking the toString() + fast path becuase adding an object to a string requires calling toPrimitive() + on the object, not toString(). (They differ in their preferred conversion + type.) + + * runtime/Operations.h: + (JSC::jsString): + (JSC::jsStringFromArguments): This code gets simpler, now that toString() + does the right thing. + + (JSC::jsAdd): Now checks for object, just like jsAddSlowCase(). + + * runtime/RegExpConstructor.cpp: + (JSC::setRegExpConstructorInput): + (JSC::constructRegExp): + * runtime/RegExpObject.cpp: + (JSC::RegExpObject::match): + * runtime/RegExpPrototype.cpp: + (JSC::regExpProtoFuncCompile): + (JSC::regExpProtoFuncToString): More calls to value(), as above. + + * runtime/StringConstructor.cpp: + (JSC::constructWithStringConstructor): + (JSC::callStringConstructor): This code gets simpler, now that toString() + does the right thing. + + * runtime/StringPrototype.cpp: + (JSC::replaceUsingRegExpSearch): + (JSC::replaceUsingStringSearch): + (JSC::stringProtoFuncReplace): + (JSC::stringProtoFuncCharAt): + (JSC::stringProtoFuncCharCodeAt): + (JSC::stringProtoFuncConcat): + (JSC::stringProtoFuncIndexOf): + (JSC::stringProtoFuncLastIndexOf): + (JSC::stringProtoFuncMatch): + (JSC::stringProtoFuncSearch): + (JSC::stringProtoFuncSlice): + (JSC::stringProtoFuncSplit): + (JSC::stringProtoFuncSubstr): + (JSC::stringProtoFuncSubstring): + (JSC::stringProtoFuncToLowerCase): + (JSC::stringProtoFuncToUpperCase): + (JSC::stringProtoFuncLocaleCompare): + (JSC::stringProtoFuncBig): + (JSC::stringProtoFuncSmall): + (JSC::stringProtoFuncBlink): + (JSC::stringProtoFuncBold): + (JSC::stringProtoFuncFixed): + (JSC::stringProtoFuncItalics): + (JSC::stringProtoFuncStrike): + (JSC::stringProtoFuncSub): + (JSC::stringProtoFuncSup): + (JSC::stringProtoFuncFontcolor): + (JSC::stringProtoFuncFontsize): + (JSC::stringProtoFuncAnchor): + (JSC::stringProtoFuncLink): + (JSC::trimString): Some of this code gets simpler, now that toString() + does the right thing. More calls to value(), as above. + +2012-01-23 Luke Macpherson + + Unreviewed, rolling out r105676. + http://trac.webkit.org/changeset/105676 + https://bugs.webkit.org/show_bug.cgi?id=76665 + + Breaks build on max due to compile warnings. + + * runtime/JSObject.cpp: + (JSC::JSObject::finalize): + (JSC::JSObject::visitChildren): + (JSC::JSObject::allocatePropertyStorage): + * runtime/JSObject.h: + +2012-01-23 Mark Hahnenberg + + Use copying collector for out-of-line JSObject property storage + https://bugs.webkit.org/show_bug.cgi?id=76665 + + Reviewed by Geoffrey Garen. + + * runtime/JSObject.cpp: + (JSC::JSObject::visitChildren): Changed to use copyAndAppend whenever the property storage is out-of-line. + (JSC::JSObject::allocatePropertyStorage): Changed to use tryAllocateStorage/tryReallocateStorage as opposed to + operator new. + * runtime/JSObject.h: + +2012-01-23 Brian Weinstein + + More build fixing after r105646. + + * JavaScriptCore.exp: + +2012-01-23 Gavin Barraclough + + https://bugs.webkit.org/show_bug.cgi?id=76855 + Implement a JIT-code aware sampling profiler for JSC + + Reviewed by Geoff Garen. + + Step 2: generalize RedBlackTree. The profiler is going to want tio use + a RedBlackTree, allow this class to work with subclasses of + RedBlackTree::Node, Node should not need to know the names of the m_key + and m_value fields (the subclass can provide a key() accessor), and + RedBlackTree does not need to know anything about ValueType. + + * JavaScriptCore.exp: + * wtf/MetaAllocator.cpp: + (WTF::MetaAllocator::findAndRemoveFreeSpace): + (WTF::MetaAllocator::debugFreeSpaceSize): + (WTF::MetaAllocator::addFreeSpace): + * wtf/MetaAllocator.h: + (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): + (WTF::MetaAllocator::FreeSpaceNode::key): + * wtf/MetaAllocatorHandle.h: + (WTF::MetaAllocatorHandle::key): + * wtf/RedBlackTree.h: + (WTF::RedBlackTree::Node::successor): + (WTF::RedBlackTree::Node::predecessor): + (WTF::RedBlackTree::Node::parent): + (WTF::RedBlackTree::Node::setParent): + (WTF::RedBlackTree::Node::left): + (WTF::RedBlackTree::Node::setLeft): + (WTF::RedBlackTree::Node::right): + (WTF::RedBlackTree::Node::setRight): + (WTF::RedBlackTree::insert): + (WTF::RedBlackTree::remove): + (WTF::RedBlackTree::findExact): + (WTF::RedBlackTree::findLeastGreaterThanOrEqual): + (WTF::RedBlackTree::findGreatestLessThanOrEqual): + (WTF::RedBlackTree::first): + (WTF::RedBlackTree::last): + (WTF::RedBlackTree::size): + (WTF::RedBlackTree::treeMinimum): + (WTF::RedBlackTree::treeMaximum): + (WTF::RedBlackTree::treeInsert): + (WTF::RedBlackTree::leftRotate): + (WTF::RedBlackTree::rightRotate): + (WTF::RedBlackTree::removeFixup): + +2012-01-23 Andy Estes + + Fix the build after r105635. + + * JavaScriptCore.exp: + +2012-01-23 Mark Hahnenberg + + Remove StackBounds from JSGlobalData + https://bugs.webkit.org/show_bug.cgi?id=76310 + + Reviewed by Sam Weinig. + + Removed StackBounds and the stack() function from JSGlobalData since it no + longer accessed any members of JSGlobalData. + + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::BytecodeGenerator): + * heap/MachineStackMarker.cpp: + (JSC::MachineThreads::addCurrentThread): + (JSC::MachineThreads::gatherFromCurrentThread): + * parser/Parser.cpp: + (JSC::::Parser): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + * runtime/JSGlobalData.h: + +2012-01-23 Gavin Barraclough + + Implement a JIT-code aware sampling profiler for JSC + https://bugs.webkit.org/show_bug.cgi?id=76855 + + Rubber stanmped by Geoff Garen. + + Mechanical change - pass CodeBlock through to the executable allocator, + such that we will be able to map ranges of JIT code back to their owner. + + * assembler/ARMAssembler.cpp: + (JSC::ARMAssembler::executableCopy): + * assembler/ARMAssembler.h: + * assembler/AssemblerBuffer.h: + (JSC::AssemblerBuffer::executableCopy): + * assembler/AssemblerBufferWithConstantPool.h: + (JSC::AssemblerBufferWithConstantPool::executableCopy): + * assembler/LinkBuffer.h: + (JSC::LinkBuffer::LinkBuffer): + (JSC::LinkBuffer::linkCode): + * assembler/MIPSAssembler.h: + (JSC::MIPSAssembler::executableCopy): + * assembler/SH4Assembler.h: + (JSC::SH4Assembler::executableCopy): + * assembler/X86Assembler.h: + (JSC::X86Assembler::executableCopy): + (JSC::X86Assembler::X86InstructionFormatter::executableCopy): + * dfg/DFGJITCompiler.cpp: + (JSC::DFG::JITCompiler::compile): + (JSC::DFG::JITCompiler::compileFunction): + * dfg/DFGOSRExitCompiler.cpp: + * dfg/DFGRepatch.cpp: + (JSC::DFG::generateProtoChainAccessStub): + (JSC::DFG::tryCacheGetByID): + (JSC::DFG::tryBuildGetByIDList): + (JSC::DFG::tryCachePutByID): + * dfg/DFGThunks.cpp: + (JSC::DFG::osrExitGenerationThunkGenerator): + * jit/ExecutableAllocator.cpp: + (JSC::ExecutableAllocator::allocate): + * jit/ExecutableAllocator.h: + * jit/ExecutableAllocatorFixedVMPool.cpp: + (JSC::ExecutableAllocator::allocate): + * jit/JIT.cpp: + (JSC::JIT::privateCompile): + * jit/JITOpcodes.cpp: + (JSC::JIT::privateCompileCTIMachineTrampolines): + * jit/JITOpcodes32_64.cpp: + (JSC::JIT::privateCompileCTIMachineTrampolines): + (JSC::JIT::privateCompileCTINativeCall): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::stringGetByValStubGenerator): + (JSC::JIT::privateCompilePutByIdTransition): + (JSC::JIT::privateCompilePatchGetArrayLength): + (JSC::JIT::privateCompileGetByIdProto): + (JSC::JIT::privateCompileGetByIdSelfList): + (JSC::JIT::privateCompileGetByIdProtoList): + (JSC::JIT::privateCompileGetByIdChainList): + (JSC::JIT::privateCompileGetByIdChain): + * jit/JITPropertyAccess32_64.cpp: + (JSC::JIT::stringGetByValStubGenerator): + (JSC::JIT::privateCompilePutByIdTransition): + (JSC::JIT::privateCompilePatchGetArrayLength): + (JSC::JIT::privateCompileGetByIdProto): + (JSC::JIT::privateCompileGetByIdSelfList): + (JSC::JIT::privateCompileGetByIdProtoList): + (JSC::JIT::privateCompileGetByIdChainList): + (JSC::JIT::privateCompileGetByIdChain): + * jit/JITStubs.cpp: + * jit/SpecializedThunkJIT.h: + (JSC::SpecializedThunkJIT::finalize): + * yarr/YarrJIT.cpp: + (JSC::Yarr::YarrGenerator::compile): + +2012-01-23 Xianzhu Wang + + Basic enhancements to StringBuilder + https://bugs.webkit.org/show_bug.cgi?id=67081 + + This change contains the following enhancements to StringBuilder, + for convenience, performance, testability, etc.: + - Change toStringPreserveCapacity() to const + - new public methods: capacity(), swap(), toAtomicString(), canShrink() + and append(const StringBuilder&) + - == and != opearators to compare StringBuilders and a StringBuilder/String + + Unit tests: Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp + + Reviewed by Darin Adler. + + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * wtf/text/AtomicString.cpp: + (WTF::SubstringTranslator::hash): + (WTF::SubstringTranslator::equal): + (WTF::SubstringTranslator::translate): + (WTF::AtomicString::add): + (WTF::AtomicString::addSlowCase): + * wtf/text/AtomicString.h: + (WTF::AtomicString::AtomicString): + (WTF::AtomicString::add): + * wtf/text/StringBuilder.cpp: + (WTF::StringBuilder::reifyString): + (WTF::StringBuilder::resize): + (WTF::StringBuilder::canShrink): + (WTF::StringBuilder::shrinkToFit): + * wtf/text/StringBuilder.h: + (WTF::StringBuilder::append): + (WTF::StringBuilder::toString): + (WTF::StringBuilder::toStringPreserveCapacity): + (WTF::StringBuilder::toAtomicString): + (WTF::StringBuilder::isEmpty): + (WTF::StringBuilder::capacity): + (WTF::StringBuilder::is8Bit): + (WTF::StringBuilder::swap): + (WTF::equal): + (WTF::operator==): + (WTF::operator!=): + * wtf/text/StringImpl.h: + +2012-01-23 Carlos Garcia Campos + + Unreviewed. Fix make distcheck. + + * GNUmakefile.list.am: Add missing files, remove deleted files and + fix indentation. + +2012-01-22 Filip Pizlo + + Build fix for non-DFG platforms that error out on warn-unused-parameter. + + * bytecode/CallLinkStatus.cpp: + (JSC::CallLinkStatus::computeFor): + * bytecode/GetByIdStatus.cpp: + (JSC::GetByIdStatus::computeFor): + * bytecode/MethodCallLinkStatus.cpp: + (JSC::MethodCallLinkStatus::computeFor): + * bytecode/PutByIdStatus.cpp: + (JSC::PutByIdStatus::computeFor): + +2012-01-22 Filip Pizlo + + Build fix for non-DFG platforms. + + * bytecode/CallLinkStatus.cpp: + (JSC::CallLinkStatus::computeFor): + * bytecode/GetByIdStatus.cpp: + (JSC::GetByIdStatus::computeFor): + * bytecode/MethodCallLinkStatus.cpp: + (JSC::MethodCallLinkStatus::computeFor): + * bytecode/PutByIdStatus.cpp: + (JSC::PutByIdStatus::computeFor): + +2012-01-20 Filip Pizlo + + DFG should not have code that directly decodes the states of old JIT inline + cache data structures + https://bugs.webkit.org/show_bug.cgi?id=76768 + + Reviewed by Sam Weinig. + + Introduced new classes (like GetByIdStatus) that encapsulate the set of things + that the DFG would like to know about property accesses and calls. Whereas it + previously got this information by directly decoding the data structures used + by the old JIT for inline caching, it now uses these classes, which do the work + for it. This should make it somewhat more straight forward to introduce new + ways of profiling the same information. + + Also hoisted StructureSet into bytecode/ from dfg/, because it's now used by + code in bytecode/. + + Making this work right involved carefully ensuring that the heuristics for + choosing how to handle property accesses was at least as good as what we had + before, since I completely restructured that code. Currently the performance + looks neutral. Since I rewrote the code I did change some things that I never + liked before, like previously if a put_bu_id had executed exactly once then + we'd compile it as if it had taken slow-path. Executing once is special because + then the inline cache is not baked in, so there is no information about how the + DFG should optimize the code. Now this is rationalized: if the put_by_id does + not offer enough information to be optimized (i.e. had executed 0 or 1 times) + then we turn it into a forced OSR exit (i.e. a patch point). However, get_by_id + still has the old behavior; I left it that way because I didn't want to make + too many changes at once. + + * CMakeLists.txt: + * GNUmakefile.list.am: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * Target.pri: + * bytecode/CallLinkStatus.cpp: Added. + (JSC::CallLinkStatus::computeFor): + * bytecode/CallLinkStatus.h: Added. + (JSC::CallLinkStatus::CallLinkStatus): + (JSC::CallLinkStatus::isSet): + (JSC::CallLinkStatus::operator!): + (JSC::CallLinkStatus::couldTakeSlowPath): + (JSC::CallLinkStatus::callTarget): + * bytecode/GetByIdStatus.cpp: Added. + (JSC::GetByIdStatus::computeFor): + * bytecode/GetByIdStatus.h: Added. + (JSC::GetByIdStatus::GetByIdStatus): + (JSC::GetByIdStatus::state): + (JSC::GetByIdStatus::isSet): + (JSC::GetByIdStatus::operator!): + (JSC::GetByIdStatus::isSimpleDirect): + (JSC::GetByIdStatus::takesSlowPath): + (JSC::GetByIdStatus::makesCalls): + (JSC::GetByIdStatus::structureSet): + (JSC::GetByIdStatus::offset): + * bytecode/MethodCallLinkStatus.cpp: Added. + (JSC::MethodCallLinkStatus::computeFor): + * bytecode/MethodCallLinkStatus.h: Added. + (JSC::MethodCallLinkStatus::MethodCallLinkStatus): + (JSC::MethodCallLinkStatus::isSet): + (JSC::MethodCallLinkStatus::operator!): + (JSC::MethodCallLinkStatus::needsPrototypeCheck): + (JSC::MethodCallLinkStatus::structure): + (JSC::MethodCallLinkStatus::prototypeStructure): + (JSC::MethodCallLinkStatus::function): + (JSC::MethodCallLinkStatus::prototype): + * bytecode/PutByIdStatus.cpp: Added. + (JSC::PutByIdStatus::computeFor): + * bytecode/PutByIdStatus.h: Added. + (JSC::PutByIdStatus::PutByIdStatus): + (JSC::PutByIdStatus::state): + (JSC::PutByIdStatus::isSet): + (JSC::PutByIdStatus::operator!): + (JSC::PutByIdStatus::isSimpleReplace): + (JSC::PutByIdStatus::isSimpleTransition): + (JSC::PutByIdStatus::takesSlowPath): + (JSC::PutByIdStatus::oldStructure): + (JSC::PutByIdStatus::newStructure): + (JSC::PutByIdStatus::structureChain): + (JSC::PutByIdStatus::offset): + * bytecode/StructureSet.h: Added. + (JSC::StructureSet::StructureSet): + (JSC::StructureSet::clear): + (JSC::StructureSet::add): + (JSC::StructureSet::addAll): + (JSC::StructureSet::remove): + (JSC::StructureSet::contains): + (JSC::StructureSet::isSubsetOf): + (JSC::StructureSet::isSupersetOf): + (JSC::StructureSet::size): + (JSC::StructureSet::at): + (JSC::StructureSet::operator[]): + (JSC::StructureSet::last): + (JSC::StructureSet::predictionFromStructures): + (JSC::StructureSet::operator==): + (JSC::StructureSet::dump): + * dfg/DFGAbstractValue.h: + * dfg/DFGByteCodeParser.cpp: + (JSC::DFG::ByteCodeParser::handleCall): + (JSC::DFG::ByteCodeParser::parseBlock): + * dfg/DFGStructureSet.h: Removed. + +2012-01-20 Filip Pizlo + + JIT compilation should not require ExecState + https://bugs.webkit.org/show_bug.cgi?id=76729 + + + Reviewed by Gavin Barraclough. + + Changed the relevant JIT driver functions to take JSGlobalData& instead of + ExecState*, since really they just needed the global data. + + * dfg/DFGDriver.cpp: + (JSC::DFG::compile): + (JSC::DFG::tryCompile): + (JSC::DFG::tryCompileFunction): + * dfg/DFGDriver.h: + (JSC::DFG::tryCompile): + (JSC::DFG::tryCompileFunction): + * jit/JITDriver.h: + (JSC::jitCompileIfAppropriate): + (JSC::jitCompileFunctionIfAppropriate): + * runtime/Executable.cpp: + (JSC::EvalExecutable::compileInternal): + (JSC::ProgramExecutable::compileInternal): + (JSC::FunctionExecutable::compileForCallInternal): + (JSC::FunctionExecutable::compileForConstructInternal): + +2012-01-20 David Levin + + Make OwnPtr work for the Chromium Windows port. + https://bugs.webkit.org/show_bug.cgi?id=76738 + + Reviewed by Jian Li. + + * JavaScriptCore.gyp/JavaScriptCore.gyp: Added OwnPtrWin.cpp to the + Chromium Windows build. + * wtf/OwnPtrCommon.h: Changed from platform WIN to OS WIN for + OwnPtr and similar constructs. + +2012-01-19 Geoffrey Garen + + Removed some regexp entry boilerplate code + https://bugs.webkit.org/show_bug.cgi?id=76687 + + Reviewed by Darin Adler. + + 1% - 2% speedup on regexp tests, no change overall. + + * runtime/RegExp.cpp: + (JSC::RegExp::match): + - ASSERT that our startIndex is non-negative, because anything less + would be uncivilized. + + - ASSERT that our input is not the null string for the same reason. + + - No need to test for startOffset being past the end of the string, + since the regular expression engine will do this test for us. + + - No need to initialize the output vector, since the regular expression + engine will fill it in for us. + + * yarr/YarrInterpreter.cpp: + (JSC::Yarr::Interpreter::interpret): + * yarr/YarrJIT.cpp: + (JSC::Yarr::YarrGenerator::compile): + + RegExp used to do these jobs for us, but now we do them for ourselves + because it's a better separation of concerns, and the JIT can do them + more efficiently than C++ code: + + - Test for "past the end" before doing any matching -- otherwise + a* will match with zero length past the end of the string, which is wrong. + + - Initialize the output vector before doing any matching. + +2012-01-20 Filip Pizlo + + Build fix for no-DFG configuration. + Needed for . + + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitProfiledOpcode): + * jit/JIT.h: + (JSC::JIT::emitValueProfilingSite): + +2012-01-19 Filip Pizlo + + Bytecode instructions that may have value profiling should have a direct inline + link to the ValueProfile instance + https://bugs.webkit.org/show_bug.cgi?id=76682 + + + Reviewed by Sam Weinig. + + Each opcode that gets value profiled now has a link to its ValueProfile. This + required rationalizing the emission of value profiles for opcode combos, like + op_method_check/op_get_by_id and op_call/op_call_put_result. It only makes + sense for one of them to have a value profile link, and it makes most sense + for it to be the one that actually sets the result. The previous behavior was + to have op_method_check profile for op_get_by_id when they were used together, + but otherwise for op_get_by_id to have its own profiles. op_call already did + the right thing; all profiling was done by op_call_put_result. + + But rationalizing this code required breaking some of the natural boundaries + that the code had; for instance the code in DFG that emits a GetById in place + of both op_method_check and op_get_by_id must now know that it's the latter of + those that has the value profile, while the first of those constitutes the OSR + target. Hence each CodeOrigin must now have two bytecode indices - one for + OSR exit and one for profiling. + + Finally this change required some refiddling of our optimization heuristics, + because now all code blocks have "more instructions" due to the value profile + slots. + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::printGetByIdOp): + (JSC::CodeBlock::dump): + * bytecode/CodeBlock.h: + (JSC::CodeBlock::valueProfileForBytecodeOffset): + * bytecode/CodeOrigin.h: + (JSC::CodeOrigin::CodeOrigin): + (JSC::CodeOrigin::bytecodeIndexForValueProfile): + * bytecode/Instruction.h: + (JSC::Instruction::Instruction): + * bytecode/Opcode.h: + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitProfiledOpcode): + (JSC::BytecodeGenerator::emitResolve): + (JSC::BytecodeGenerator::emitGetScopedVar): + (JSC::BytecodeGenerator::emitResolveBase): + (JSC::BytecodeGenerator::emitResolveBaseForPut): + (JSC::BytecodeGenerator::emitResolveWithBase): + (JSC::BytecodeGenerator::emitResolveWithThis): + (JSC::BytecodeGenerator::emitGetById): + (JSC::BytecodeGenerator::emitGetByVal): + (JSC::BytecodeGenerator::emitCall): + (JSC::BytecodeGenerator::emitCallVarargs): + (JSC::BytecodeGenerator::emitConstruct): + * bytecompiler/BytecodeGenerator.h: + * dfg/DFGByteCodeParser.cpp: + (JSC::DFG::ByteCodeParser::ByteCodeParser): + (JSC::DFG::ByteCodeParser::currentCodeOrigin): + (JSC::DFG::ByteCodeParser::addCall): + (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): + (JSC::DFG::ByteCodeParser::getPrediction): + (JSC::DFG::ByteCodeParser::handleCall): + (JSC::DFG::ByteCodeParser::handleInlining): + (JSC::DFG::ByteCodeParser::parseBlock): + (JSC::DFG::ByteCodeParser::parse): + * dfg/DFGGraph.h: + (JSC::DFG::Graph::valueProfileFor): + * jit/JIT.h: + (JSC::JIT::emitValueProfilingSite): + * jit/JITCall.cpp: + (JSC::JIT::emit_op_call_put_result): + * jit/JITCall32_64.cpp: + (JSC::JIT::emit_op_call_put_result): + * jit/JITInlineMethods.h: + (JSC::JIT::emitValueProfilingSite): + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_resolve): + (JSC::JIT::emit_op_resolve_base): + (JSC::JIT::emit_op_resolve_skip): + (JSC::JIT::emit_op_resolve_global): + (JSC::JIT::emitSlow_op_resolve_global): + (JSC::JIT::emit_op_resolve_with_base): + (JSC::JIT::emit_op_resolve_with_this): + (JSC::JIT::emitSlow_op_resolve_global_dynamic): + * jit/JITOpcodes32_64.cpp: + (JSC::JIT::emit_op_resolve): + (JSC::JIT::emit_op_resolve_base): + (JSC::JIT::emit_op_resolve_skip): + (JSC::JIT::emit_op_resolve_global): + (JSC::JIT::emitSlow_op_resolve_global): + (JSC::JIT::emit_op_resolve_with_base): + (JSC::JIT::emit_op_resolve_with_this): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::emit_op_get_by_val): + (JSC::JIT::emitSlow_op_get_by_val): + (JSC::JIT::emit_op_method_check): + (JSC::JIT::emitSlow_op_method_check): + (JSC::JIT::emit_op_get_by_id): + (JSC::JIT::emitSlow_op_get_by_id): + (JSC::JIT::emit_op_get_scoped_var): + (JSC::JIT::emit_op_get_global_var): + * jit/JITPropertyAccess32_64.cpp: + (JSC::JIT::emit_op_method_check): + (JSC::JIT::emitSlow_op_method_check): + (JSC::JIT::emit_op_get_by_val): + (JSC::JIT::emitSlow_op_get_by_val): + (JSC::JIT::emit_op_get_by_id): + (JSC::JIT::emitSlow_op_get_by_id): + (JSC::JIT::emit_op_get_scoped_var): + (JSC::JIT::emit_op_get_global_var): + * jit/JITStubCall.h: + (JSC::JITStubCall::callWithValueProfiling): + * runtime/Options.cpp: + (JSC::Options::initializeOptions): + +2012-01-20 ChangSeok Oh + + undefined reference to symbol eina_module_free + https://bugs.webkit.org/show_bug.cgi?id=76681 + + Reviewed by Martin Robinson. + + eina_module_free has been used without including eina libraries after r104936. + + * wtf/PlatformEfl.cmake: Add EINA_LIBRARIES. + +2012-01-19 Tony Chang + + [chromium] Remove an obsolete comment about features.gypi + https://bugs.webkit.org/show_bug.cgi?id=76643 + + There can be only one features.gypi. + + Reviewed by James Robinson. + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + +2012-01-19 Geoffrey Garen + + Implicit creation of a regular expression should eagerly check for syntax errors + https://bugs.webkit.org/show_bug.cgi?id=76642 + + Reviewed by Oliver Hunt. + + This is a correctness fix and a slight optimization. + + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncMatch): + (JSC::stringProtoFuncSearch): Check for syntax errors because that's the + correct behavior. + + * runtime/RegExp.cpp: + (JSC::RegExp::match): ASSERT that we aren't a syntax error. (One line + of code change, many lines of indentation change.) + + Since we have no clients that try to match a RegExp that is a syntax error, + let's optimize out the check. + +2012-01-19 Mark Hahnenberg + + Implement a new allocator for backing stores + https://bugs.webkit.org/show_bug.cgi?id=75181 + + Reviewed by Filip Pizlo. + + We want to move away from using fastMalloc for the backing stores for + some of our objects (e.g. JSArray, JSObject, JSString, etc). These backing + stores have a nice property in that they only have a single owner (i.e. a + single pointer to them at any one time). One way that we can take advantage + of this property is to implement a simple bump allocator/copying collector, + which will run alongside our normal mark/sweep collector, that only needs to + update the single owner pointer rather than having to redirect an arbitrary + number of pointers in from-space to to-space. + + This plan can give us a number of benefits. We can beat fastMalloc in terms + of both performance and memory usage, we can track how much memory we're using + far more accurately than our rough estimation now through the use of + reportExtraMemoryCost, and we can allocate arbitrary size objects (as opposed + to being limited to size classes like we have been historically). This is also + another step toward moving away from lazy destruction, which will improve our memory footprint. + + We start by creating said allocator and moving the ArrayStorage for JSArray + to use it rather than fastMalloc. + + The design of the collector is as follows: + Allocation: + -The collector allocates 64KB chunks from the OS to use for object allocation. + -Each chunk contains an offset, a flag indicating if the block has been pinned, + and a payload, along with next and prev pointers so that they can be put in DoublyLinkedLists. + -Any allocation greater than 64KB gets its own separate oversize block, which + is managed separately from the rest. + -If the allocator receives a request for more than the remaining amount in the + current block, it grabs a fresh block. + -Grabbing a fresh block means grabbing one off of the global free list (which is now + shared between the mark/sweep allocator and the bump allocator) if there is one. + If there isn't a new one we do one of two things: allocate a new block from the OS + if we're not ready for a GC yet, or run a GC and then try again. If we still don't + have enough space after the GC, we allocate a new block from the OS. + + Garbage collection: + -At the start of garbage collection during conservative stack scanning, if we encounter + what appears to be a pointer to a bump-allocated block of memory, we pin that block so + that it will not be copied for this round of collection. + -We also pin any oversize blocks that we encounter, which effectively doubles as a + "mark bit" for that block. Any oversize blocks that aren't pinned at the end of copying + are given back to the OS. + -Marking threads are now also responsible for copying bump-allocated objects to newSpace + -Each marking thread has a private 64KB block into which it copies bump-allocated objects that it encounters. + -When that block fills up, the marking thread gives it back to the allocator and requests a new one. + -When all marking has concluded, each thread gives back its copy block, even if it isn't full. + -At the conclusion of copying (which is done by the end of the marking phase), we un-pin + any pinned blocks and give any blocks left in from-space to the global free list. + + * CMakeLists.txt: + * GNUmakefile.list.am: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.vcproj/WTF/WTF.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * Target.pri: + * heap/AllocationSpace.cpp: + (JSC::AllocationSpace::allocateSlowCase): + (JSC::AllocationSpace::allocateBlock): + (JSC::AllocationSpace::freeBlocks): + * heap/AllocationSpace.h: + (JSC::AllocationSpace::waterMark): + * heap/BumpBlock.h: Added. + (JSC::BumpBlock::BumpBlock): + * heap/BumpSpace.cpp: Added. + (JSC::BumpSpace::tryAllocateSlowCase): + * heap/BumpSpace.h: Added. + (JSC::BumpSpace::isInCopyPhase): + (JSC::BumpSpace::totalMemoryAllocated): + (JSC::BumpSpace::totalMemoryUtilized): + * heap/BumpSpaceInlineMethods.h: Added. + (JSC::BumpSpace::BumpSpace): + (JSC::BumpSpace::init): + (JSC::BumpSpace::contains): + (JSC::BumpSpace::pin): + (JSC::BumpSpace::startedCopying): + (JSC::BumpSpace::doneCopying): + (JSC::BumpSpace::doneFillingBlock): + (JSC::BumpSpace::recycleBlock): + (JSC::BumpSpace::getFreshBlock): + (JSC::BumpSpace::borrowBlock): + (JSC::BumpSpace::addNewBlock): + (JSC::BumpSpace::allocateNewBlock): + (JSC::BumpSpace::fitsInBlock): + (JSC::BumpSpace::fitsInCurrentBlock): + (JSC::BumpSpace::tryAllocate): + (JSC::BumpSpace::tryAllocateOversize): + (JSC::BumpSpace::allocateFromBlock): + (JSC::BumpSpace::tryReallocate): + (JSC::BumpSpace::tryReallocateOversize): + (JSC::BumpSpace::isOversize): + (JSC::BumpSpace::isPinned): + (JSC::BumpSpace::oversizeBlockFor): + (JSC::BumpSpace::blockFor): + * heap/ConservativeRoots.cpp: + (JSC::ConservativeRoots::ConservativeRoots): + (JSC::ConservativeRoots::genericAddPointer): + (JSC::ConservativeRoots::add): + * heap/ConservativeRoots.h: + * heap/Heap.cpp: + (JSC::Heap::Heap): + (JSC::Heap::blockFreeingThreadMain): + (JSC::Heap::reportExtraMemoryCostSlowCase): + (JSC::Heap::getConservativeRegisterRoots): + (JSC::Heap::markRoots): + (JSC::Heap::collect): + (JSC::Heap::releaseFreeBlocks): + * heap/Heap.h: + (JSC::Heap::waterMark): + (JSC::Heap::highWaterMark): + (JSC::Heap::setHighWaterMark): + (JSC::Heap::tryAllocateStorage): + (JSC::Heap::tryReallocateStorage): + * heap/HeapBlock.h: Added. + (JSC::HeapBlock::HeapBlock): + * heap/MarkStack.cpp: + (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData): + (JSC::SlotVisitor::drain): + (JSC::SlotVisitor::drainFromShared): + (JSC::SlotVisitor::startCopying): + (JSC::SlotVisitor::allocateNewSpace): + (JSC::SlotVisitor::copy): + (JSC::SlotVisitor::copyAndAppend): + (JSC::SlotVisitor::doneCopying): + * heap/MarkStack.h: + * heap/MarkedBlock.cpp: + (JSC::MarkedBlock::recycle): + (JSC::MarkedBlock::MarkedBlock): + * heap/MarkedBlock.h: + * heap/MarkedSpace.cpp: + (JSC::MarkedSpace::MarkedSpace): + * heap/MarkedSpace.h: + (JSC::MarkedSpace::allocate): + (JSC::MarkedSpace::forEachBlock): + (JSC::MarkedSpace::SizeClass::resetAllocator): + * heap/SlotVisitor.h: + (JSC::SlotVisitor::SlotVisitor): + * heap/TinyBloomFilter.h: + (JSC::TinyBloomFilter::reset): + * runtime/JSArray.cpp: + (JSC::JSArray::JSArray): + (JSC::JSArray::finishCreation): + (JSC::JSArray::tryFinishCreationUninitialized): + (JSC::JSArray::~JSArray): + (JSC::JSArray::enterSparseMode): + (JSC::JSArray::defineOwnNumericProperty): + (JSC::JSArray::setLengthWritable): + (JSC::JSArray::getOwnPropertySlotByIndex): + (JSC::JSArray::getOwnPropertyDescriptor): + (JSC::JSArray::putByIndexBeyondVectorLength): + (JSC::JSArray::deletePropertyByIndex): + (JSC::JSArray::getOwnPropertyNames): + (JSC::JSArray::increaseVectorLength): + (JSC::JSArray::unshiftCountSlowCase): + (JSC::JSArray::setLength): + (JSC::JSArray::pop): + (JSC::JSArray::unshiftCount): + (JSC::JSArray::visitChildren): + (JSC::JSArray::sortNumeric): + (JSC::JSArray::sort): + (JSC::JSArray::compactForSorting): + (JSC::JSArray::subclassData): + (JSC::JSArray::setSubclassData): + (JSC::JSArray::checkConsistency): + * runtime/JSArray.h: + (JSC::JSArray::inSparseMode): + (JSC::JSArray::isLengthWritable): + * wtf/CheckedBoolean.h: Added. + (CheckedBoolean::CheckedBoolean): + (CheckedBoolean::~CheckedBoolean): + (CheckedBoolean::operator bool): + * wtf/DoublyLinkedList.h: + (WTF::::push): + * wtf/StdLibExtras.h: + (WTF::isPointerAligned): + +2012-01-19 Joi Sigurdsson + + Enable use of precompiled headers in Chromium port on Windows. + + Bug 76381 - Use precompiled headers in Chromium port on Windows + https://bugs.webkit.org/show_bug.cgi?id=76381 + + Reviewed by Tony Chang. + + * JavaScriptCore.gyp/JavaScriptCore.gyp: Include WinPrecompile.gypi. + +2012-01-18 Roland Takacs + + Cross-platform processor core counter fix + https://bugs.webkit.org/show_bug.cgi?id=76540 + + Reviewed by Zoltan Herczeg. + + I attached "OS(FREEBSD)" to "#if OS(DARWIN) || OS(OPENBSD) || OS(NETBSD)" + and I removed the OS checking macros from ParallelJobsGeneric.cpp because + the NumberOfCores.cpp contains them for counting CPU cores. + The processor core counter patch located at + https://bugs.webkit.org/show_bug.cgi?id=76530 + + * wtf/NumberOfCores.cpp: + * wtf/ParallelJobsGeneric.cpp: + +2012-01-18 Csaba Osztrogonác + + Cross-platform processor core counter + https://bugs.webkit.org/show_bug.cgi?id=76530 + + Unreviewed cross-MinGW buildfix after r105270. + + * wtf/NumberOfCores.cpp: Use windows.h instead of Windows.h. + +2012-01-18 Roland Takacs + + Cross-platform processor core counter + https://bugs.webkit.org/show_bug.cgi?id=76530 + + Reviewed by Zoltan Herczeg. + + Two files have been created that include the processor core counter function. + It used to be in ParallelJobsGeneric.h/cpp before. + + * GNUmakefile.list.am: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/WTF/WTF.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * runtime/Options.cpp: + (JSC::Options::initializeOptions): + * wtf/CMakeLists.txt: + * wtf/NumberOfCores.cpp: Added. + (WTF::numberOfProcessorCores): + * wtf/NumberOfCores.h: Added. + * wtf/ParallelJobsGeneric.cpp: + (WTF::ParallelEnvironment::ParallelEnvironment): + * wtf/ParallelJobsGeneric.h: + +2012-01-18 Balazs Kelemen + + [Qt] Consolidate layout test crash logging + https://bugs.webkit.org/show_bug.cgi?id=75088 + + Reviewed by Simon Hausmann. + + Move backtrace generating logic into WTFReportBacktrace + and add a way to deinstall signal handlers if we know + that we have already printed the backtrace. + + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * wtf/Assertions.cpp: + (WTFLogLocker::WTFReportBacktrace): + (WTFLogLocker::WTFSetCrashHook): + (WTFLogLocker::WTFInvokeCrashHook): + * wtf/Assertions.h: + +2012-01-17 Geoffrey Garen + + Factored out some code into a helper function. + + I think this might help getting rid of omit-frame-pointer. + + Reviewed by Sam Weinig. + + No benchmark change. + + * runtime/StringPrototype.cpp: + (JSC::removeUsingRegExpSearch): Moved to here... + (JSC::replaceUsingRegExpSearch): ...from here. + +2012-01-17 Caio Marcelo de Oliveira Filho + + Uint8ClampedArray support + https://bugs.webkit.org/show_bug.cgi?id=74455 + + Reviewed by Filip Pizlo. + + * GNUmakefile.list.am: + * JavaScriptCore.xcodeproj/project.pbxproj: + * bytecode/PredictedType.cpp: + (JSC::predictionToString): + (JSC::predictionFromClassInfo): + * bytecode/PredictedType.h: + (JSC::isUint8ClampedArrayPrediction): + (JSC::isActionableMutableArrayPrediction): + * dfg/DFGAbstractState.cpp: + (JSC::DFG::AbstractState::initialize): + (JSC::DFG::AbstractState::execute): + * dfg/DFGNode.h: + (JSC::DFG::Node::shouldSpeculateUint8ClampedArray): + * dfg/DFGPropagator.cpp: + (JSC::DFG::Propagator::propagateNodePredictions): + (JSC::DFG::Propagator::fixupNode): + (JSC::DFG::Propagator::performNodeCSE): + * dfg/DFGSpeculativeJIT.cpp: + (JSC::DFG::SpeculativeJIT::checkArgumentTypes): + (JSC::DFG::clampDoubleToByte): + (JSC::DFG::compileClampIntegerToByte): + (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): + (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): + (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage): + * dfg/DFGSpeculativeJIT.h: + * dfg/DFGSpeculativeJIT32_64.cpp: + (JSC::DFG::SpeculativeJIT::compile): + * dfg/DFGSpeculativeJIT64.cpp: + (JSC::DFG::SpeculativeJIT::compile): + * runtime/JSCell.h: + * runtime/JSGlobalData.h: + * wtf/Forward.h: + * wtf/Uint8Array.h: + * wtf/Uint8ClampedArray.h: Added. + (WTF::Uint8ClampedArray::set): + (WTF::Uint8ClampedArray::create): + (WTF::Uint8ClampedArray::Uint8ClampedArray): + (WTF::Uint8ClampedArray::subarray): + +2012-01-17 Sam Weinig + + Add helper macro for forward declaring objective-c classes + https://bugs.webkit.org/show_bug.cgi?id=76485 + + Reviewed by Anders Carlsson. + + * wtf/Compiler.h: + Add OBJC_CLASS macro which helps reduce code when forward declaring an + objective-c class in a header which can be included from both Objective-C + and non-Objective-C files. + +2012-01-17 Filip Pizlo + + DFG should be able to do JS and custom getter caching + https://bugs.webkit.org/show_bug.cgi?id=76361 + + Reviewed by Csaba Osztrogonác. + + Fix for 32-bit. + + * dfg/DFGRepatch.cpp: + (JSC::DFG::tryBuildGetByIDList): + * dfg/DFGSpeculativeJIT32_64.cpp: + (JSC::DFG::SpeculativeJIT::compile): + +2012-01-15 Filip Pizlo + + DFG should be able to do JS and custom getter caching + https://bugs.webkit.org/show_bug.cgi?id=76361 + + + Reviewed by Geoff Garen. + + Added the ability to cache JS getter calls and custom getter calls in the DFG. + Most of this is pretty mundane, since the old JIT supported this functionality + as well. But a couple interesting things had to happen: + + - There are now two variants of GetById: GetById, which works as before, and + GetByIdFlush, which flushes registers prior to doing the GetById. Only + GetByIdFlush can be used for caching getters. We detect which GetById style + to use by looking at the inline caches of the old JIT. + + - Exception handling for getter calls planted in stubs uses a separate lookup + handler routine, which uses the CodeOrigin stored in the StructureStubInfo. + + This is a 40% speed-up in the Dromaeo DOM Traversal average. It removes all of + the DFG regressions we saw in Dromaeo. This is neutral on SunSpider, V8, and + Kraken. + + * bytecode/StructureStubInfo.h: + * dfg/DFGAbstractState.cpp: + (JSC::DFG::AbstractState::execute): + * dfg/DFGAssemblyHelpers.h: + (JSC::DFG::AssemblyHelpers::emitExceptionCheck): + * dfg/DFGByteCodeParser.cpp: + (JSC::DFG::ByteCodeParser::willNeedFlush): + (JSC::DFG::ByteCodeParser::parseBlock): + * dfg/DFGCCallHelpers.h: + (JSC::DFG::CCallHelpers::setupResults): + * dfg/DFGJITCompiler.cpp: + (JSC::DFG::JITCompiler::link): + * dfg/DFGJITCompiler.h: + (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord): + (JSC::DFG::JITCompiler::addExceptionCheck): + * dfg/DFGNode.h: + (JSC::DFG::Node::hasIdentifier): + (JSC::DFG::Node::hasHeapPrediction): + * dfg/DFGOperations.cpp: + * dfg/DFGOperations.h: + * dfg/DFGPropagator.cpp: + (JSC::DFG::Propagator::propagateNodePredictions): + * dfg/DFGRepatch.cpp: + (JSC::DFG::tryCacheGetByID): + (JSC::DFG::tryBuildGetByIDList): + * dfg/DFGSpeculativeJIT.h: + (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheckSetResult): + * dfg/DFGSpeculativeJIT32_64.cpp: + (JSC::DFG::SpeculativeJIT::cachedGetById): + (JSC::DFG::SpeculativeJIT::compile): + * dfg/DFGSpeculativeJIT64.cpp: + (JSC::DFG::SpeculativeJIT::cachedGetById): + (JSC::DFG::SpeculativeJIT::compile): + +2012-01-16 Jon Lee + + Build fix for r105086. + + * Configurations/FeatureDefines.xcconfig: + * wtf/Platform.h: + +2012-01-16 Jon Lee + + Remove HTML notifications support on Mac + https://bugs.webkit.org/show_bug.cgi?id=76401 + + + Reviewed by Sam Weinig. + + * wtf/Platform.h: Define ENABLE_HTML_NOTIFICATIONS macro. + +2012-01-16 Zeno Albisser + + [Qt] Fix QT_VERSION related warnings when building on Mac OS X + https://bugs.webkit.org/show_bug.cgi?id=76340 + + This bug was caused by r104826. + As already mentioned for https://bugs.webkit.org/show_bug.cgi?id=57239 + we should not use "using namespace WebCore" in header files, + because it might cause ambiguous references. + This patch reverts the changes from r104826 and r104981 + and removes the "using namespace WebCore" statement from + two header files. + + Reviewed by Tor Arne Vestbø. + + * wtf/Platform.h: + +2012-01-16 Carlos Garcia Campos + + Unreviewed. Fix make distcheck. + + * GNUmakefile.list.am: Fix typo. + +2012-01-16 Pavel Heimlich + + Solaris Studio supports alignment macros too + https://bugs.webkit.org/show_bug.cgi?id=75453 + + Reviewed by Hajime Morita. + + * wtf/Alignment.h: + +2012-01-16 Yuqiang Xian + + Build fix on 32bit if verbose debug is enabled in DFG + https://bugs.webkit.org/show_bug.cgi?id=76351 + + Reviewed by Hajime Morita. + + Mostly change "%lu" to "%zu" to print a "size_t" variable. + + * dfg/DFGAbstractState.cpp: + (JSC::DFG::AbstractState::endBasicBlock): + * dfg/DFGByteCodeParser.cpp: + (JSC::DFG::ByteCodeParser::handleCall): + (JSC::DFG::ByteCodeParser::handleInlining): + (JSC::DFG::ByteCodeParser::parseBlock): + (JSC::DFG::ByteCodeParser::parseCodeBlock): + * dfg/DFGGraph.cpp: + (JSC::DFG::Graph::predictArgumentTypes): + * dfg/DFGJITCompiler.cpp: + (JSC::DFG::JITCompiler::link): + * dfg/DFGOSREntry.cpp: + (JSC::DFG::prepareOSREntry): + +2012-01-15 Filip Pizlo + + The C calling convention logic in DFG::SpeculativeJIT should be available even + when not generating code for the DFG speculative path + https://bugs.webkit.org/show_bug.cgi?id=76355 + + Reviewed by Dan Bernstein. + + Moved all of the logic for placing C call arguments into the right place (stack + or registers) into a new class, DFG::CCallHelpers. This class inherits from + AssemblyHelpers, another DFG grab-bag of helper functions. I could have moved + this code into AssemblyHelpers, but decided against it, because I wanted to + limit the number of methods each class in the JIT has. Hence now we have a + slightly odd organization of JIT classes in DFG: MacroAssembler (basic instruction + emission) <= AssemblyHelpers (some additional JS smarts) <= CCallHelpers + (understands calls to C functions) <= JITCompiler (can compile a graph to machine + code). Each of these except for JITCompiler can be reused for stub compilation. + + * GNUmakefile.list.am: + * JavaScriptCore.xcodeproj/project.pbxproj: + * dfg/DFGCCallHelpers.h: Added. + (JSC::DFG::CCallHelpers::CCallHelpers): + (JSC::DFG::CCallHelpers::resetCallArguments): + (JSC::DFG::CCallHelpers::addCallArgument): + (JSC::DFG::CCallHelpers::setupArguments): + (JSC::DFG::CCallHelpers::setupArgumentsExecState): + (JSC::DFG::CCallHelpers::setupArgumentsWithExecState): + (JSC::DFG::CCallHelpers::setupTwoStubArgs): + (JSC::DFG::CCallHelpers::setupStubArguments): + * dfg/DFGJITCompiler.h: + (JSC::DFG::JITCompiler::JITCompiler): + * dfg/DFGSpeculativeJIT.h: + (JSC::DFG::SpeculativeJIT::callOperation): + +2012-01-15 Pablo Flouret + + Fix compilation errors on build-webkit --debug --no-video on mac. + https://bugs.webkit.org/show_bug.cgi?id=75867 + + Reviewed by Philippe Normand. + + Make ENABLE_VIDEO_TRACK conditional on ENABLE_VIDEO, video track feature + doesn't build without video. + + * wtf/Platform.h: + +2012-01-14 David Levin + + HWndDC should be in platform/win instead of wtf. + https://bugs.webkit.org/show_bug.cgi?id=76314 + + Reviewed by Sam Weinig. + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + * JavaScriptCore.gypi: + +2012-01-13 David Levin + + check-webkit-style: should encourage the use of Own* classes for Windows DC. + https://bugs.webkit.org/show_bug.cgi?id=76227 + + Reviewed by Dirk Pranke. + + * wtf/win/HWndDCWin.h: + (WTF::HwndDC::HwndDC): Add a way to do GetDCEx. + There are no users, but I want to catch this in check-webkit-style + and tell any users to use HwndDC to avoid leaks. + +2012-01-13 David Levin + + Header file is missing header guard. + + Reviewed by Dirk Pranke. + + * wtf/win/HWndDCWin.h: Added the guards. + +2012-01-13 Andy Wingo + + Eval in strict mode does not need dynamic checks + https://bugs.webkit.org/show_bug.cgi?id=76286 + + Reviewed by Oliver Hunt. + + * runtime/JSActivation.cpp (JSC::JSActivation::JSActivation): + Eval in strict mode cannot introduce variables, so it not impose + the need for dynamic checks. + +2012-01-13 David Levin + + HWndDC is a better name than HwndDC. + https://bugs.webkit.org/show_bug.cgi?id=76281 + + Reviewed by Darin Adler. + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + * JavaScriptCore.gypi: + * wtf/win/HWndDCWin.h: Renamed from Source/JavaScriptCore/wtf/win/HwndDCWin.h. + (WTF::HWndDC::HWndDC): + (WTF::HWndDC::~HWndDC): + (WTF::HWndDC::operator HDC): + +2012-01-13 YoungTaeck Song + + [EFL] Add OwnPtr specialization for Eina_Module. + https://bugs.webkit.org/show_bug.cgi?id=76255 + + Reviewed by Andreas Kling. + + Add an overload for deleteOwnedPtr(Eina_Module*) on EFL port. + + * wtf/OwnPtrCommon.h: + * wtf/efl/OwnPtrEfl.cpp: + (WTF::deleteOwnedPtr): + +2012-01-13 Yuqiang Xian + + Unreviewed build fix after r104787 if JIT_VERBOSE_OSR is defined + + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + +2012-01-12 Hajime Morrita + + JavaScriptCore: Mark all exported symbols in the header file automatically. + https://bugs.webkit.org/show_bug.cgi?id=72855 + + Reviewed by Darin Adler. + + Added WTF_EXPORT_PRIVATE and JS_EXPORT_PRIVATE based on JavaScriptCore.exp files. + The change is generated by a tool calledListExportables (https://github.com/omo/ListExportables) + + * API/OpaqueJSString.h: + * bytecode/CodeBlock.h: + * bytecode/SamplingTool.h: + * debugger/Debugger.h: + * debugger/DebuggerActivation.h: + * debugger/DebuggerCallFrame.h: + * heap/AllocationSpace.h: + * heap/HandleHeap.h: + * heap/Heap.h: + * heap/MachineStackMarker.h: + * heap/MarkStack.h: + * heap/VTableSpectrum.h: + * heap/WriteBarrierSupport.h: + * parser/Nodes.h: + * parser/ParserArena.h: + * profiler/Profile.h: + * runtime/ArgList.h: + * runtime/CallData.h: + * runtime/Completion.h: + * runtime/ConstructData.h: + * runtime/DateInstance.h: + * runtime/Error.h: + * runtime/ExceptionHelpers.h: + * runtime/FunctionConstructor.h: + * runtime/Identifier.h: + * runtime/InitializeThreading.h: + * runtime/InternalFunction.h: + * runtime/JSArray.h: + * runtime/JSByteArray.h: + * runtime/JSCell.h: + * runtime/JSFunction.h: + * runtime/JSGlobalData.cpp: + * runtime/JSGlobalData.h: + * runtime/JSGlobalObject.h: + * runtime/JSGlobalThis.h: + * runtime/JSLock.h: + * runtime/JSObject.h: + * runtime/JSString.h: + * runtime/JSValue.h: + * runtime/JSVariableObject.h: + * runtime/Lookup.h: + * runtime/MemoryStatistics.h: + * runtime/ObjectPrototype.h: + * runtime/Options.h: + * runtime/PropertyDescriptor.h: + * runtime/PropertyNameArray.h: + * runtime/PropertySlot.h: + * runtime/RegExp.h: + * runtime/RegExpObject.h: + * runtime/SamplingCounter.h: + * runtime/SmallStrings.h: + * runtime/StringObject.h: + * runtime/Structure.h: + * runtime/TimeoutChecker.h: + * runtime/UString.h: + * runtime/WriteBarrier.h: + * wtf/ArrayBufferView.h: + * wtf/ByteArray.h: + * wtf/CryptographicallyRandomNumber.h: + * wtf/CurrentTime.h: + * wtf/DateMath.h: + * wtf/DecimalNumber.h: + * wtf/FastMalloc.cpp: + * wtf/FastMalloc.h: + * wtf/MD5.h: + * wtf/MainThread.h: + * wtf/MetaAllocator.h: + * wtf/MetaAllocatorHandle.h: + * wtf/OSAllocator.h: + * wtf/PageBlock.h: + * wtf/RandomNumber.h: + * wtf/RefCountedLeakCounter.h: + * wtf/SHA1.h: + * wtf/Threading.cpp: + * wtf/Threading.h: + * wtf/ThreadingPrimitives.h: + * wtf/WTFThreadData.h: + * wtf/dtoa.h: + * wtf/text/AtomicString.h: + * wtf/text/CString.h: + * wtf/text/StringBuilder.h: + * wtf/text/StringImpl.h: + * wtf/text/WTFString.h: + * wtf/unicode/Collator.h: + * wtf/unicode/UTF8.h: + * yarr/Yarr.h: + * yarr/YarrPattern.h: + +2012-01-12 MORITA Hajime + + [Chromium] JSExportMacros.h should be visible. + https://bugs.webkit.org/show_bug.cgi?id=76147 + + Reviewed by Tony Chang. + + * config.h: + +2012-01-12 David Levin + + HwndDC is a better name than OwnGetDC. + https://bugs.webkit.org/show_bug.cgi?id=76235 + + Reviewed by Dmitry Titov. + + This is a better name for two reasons: + 1. "Own" implies "delete". In this case, the final call is a release (ReleaseDC). + 2. "Ref" would be a better name due to the release but the RefPtr (and OwnPtr) + classes always take something to hold on to. In this case, the object (the DC) + is created by the class once it is given a Window to ensure that the HDC + was actually created using GetDC. + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + * JavaScriptCore.gypi: + * wtf/win/HwndDCWin.h: Renamed from Source/JavaScriptCore/wtf/win/OwnGetDCWin.h. + (WTF::HwndDC::HwndDC): + (WTF::HwndDC::~HwndDC): + (WTF::HwndDC::operator HDC): + +2012-01-12 Gavin Barraclough + + Clean up putDirect (part 2) + https://bugs.webkit.org/show_bug.cgi?id=76232 + + Reviewed by Sam Weinig. + + Rename putWithAttributes to putDirectVirtual, to identify that this + has the same unchecked-DefineOwnProperty behaviour, change putDirectInternal + to be templated on an enum indicating which behaviour it is supposed to be + implementing, and change clients that are defining properties to call + putDirectInternal correctly. + + * API/JSObjectRef.cpp: + (JSObjectSetProperty): + * JavaScriptCore.exp: + * debugger/DebuggerActivation.cpp: + (JSC::DebuggerActivation::putDirectVirtual): + * debugger/DebuggerActivation.h: + * interpreter/Interpreter.cpp: + (JSC::Interpreter::execute): + * runtime/ClassInfo.h: + * runtime/Error.cpp: + (JSC::addErrorInfo): + * runtime/JSActivation.cpp: + (JSC::JSActivation::putDirectVirtual): + * runtime/JSActivation.h: + * runtime/JSCell.cpp: + (JSC::JSCell::putDirectVirtual): + * runtime/JSCell.h: + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::putDirectVirtual): + * runtime/JSGlobalObject.h: + * runtime/JSObject.cpp: + (JSC::JSObject::put): + (JSC::JSObject::putDirectVirtual): + (JSC::JSObject::defineGetter): + (JSC::JSObject::initializeGetterSetterProperty): + (JSC::JSObject::defineSetter): + (JSC::putDescriptor): + * runtime/JSObject.h: + (JSC::JSObject::putDirectInternal): + (JSC::JSObject::putOwnDataProperty): + (JSC::JSObject::putDirect): + * runtime/JSStaticScopeObject.cpp: + (JSC::JSStaticScopeObject::putDirectVirtual): + * runtime/JSStaticScopeObject.h: + * runtime/JSVariableObject.cpp: + (JSC::JSVariableObject::putDirectVirtual): + * runtime/JSVariableObject.h: + +2012-01-12 Gavin Barraclough + + Clean up putDirect (part 1) + https://bugs.webkit.org/show_bug.cgi?id=76232 + + Reviewed by Sam Weinig. + + putDirect has ambiguous semantics, clean these up a bit. + + putDirect generally behaves a bit like a fast defineOwnProperty, but one that + always creates the property, with no checking to validate the put it permitted. + + It also encompasses two slightly different behaviors. + (1) a fast form of put for JSActivation, which doesn't have to handle searching + the prototype chain, getter/setter properties, or the magic __proto__ value. + Break this out as a new method, 'putOwnDataProperty'. + (2) the version of putDirect on JSValue will also check for overwriting ReadOnly + values, in strict mode. This is, however, not so smart on a few level, since + it is only called from op_put_by_id with direct set, which is only used with + an object as the base, and is only used to put new properties onto objects. + + * dfg/DFGOperations.cpp: + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * runtime/JSActivation.cpp: + (JSC::JSActivation::put): + * runtime/JSFunction.cpp: + (JSC::JSFunction::getOwnPropertySlot): + * runtime/JSObject.h: + (JSC::JSObject::putOwnDataProperty): + * runtime/JSValue.h: + +2012-01-12 Gavin Barraclough + + https://bugs.webkit.org/show_bug.cgi?id=76141 + defineSetter/defineGetter may fail to update Accessor attribute + + Reviewed by Oliver Hunt. + + * runtime/JSObject.cpp: + (JSC::JSObject::defineGetter): + (JSC::JSObject::initializeGetterSetterProperty): + (JSC::JSObject::defineSetter): + * runtime/Structure.cpp: + (JSC::Structure::attributeChangeTransition): + * runtime/Structure.h: + +2012-01-12 David Levin + + [chromium] Fix DC leak in WebScreenInfoFactory. + https://bugs.webkit.org/show_bug.cgi?id=76203 + + Reviewed by Dmitry Titov. + + * JavaScriptCore.gyp/JavaScriptCore.gyp: Added OwnGetDCWin.h + * JavaScriptCore.gypi: Added OwnGetDCWin.h + * JavaScriptCore/wtf/win/OwnGetDCWin.h: Made an owner class for GetDC which needs ReleaseDC as opposed to DeleteDC. + +2012-01-11 Gavin Barraclough + + Allow accessor get/set property to be set to undefined + https://bugs.webkit.org/show_bug.cgi?id=76148 + + Reviewed by Oliver Hunt. + + AccessorDescriptor properties may have their get & set properties defined to reference a function + (Callable object) or be set to undefined. Valid PropertyDescriptors created by toPropertyDescriptor + (defined from JS code via Object.defineProperty, etc) have get and set properties that are in one of + three states (1) nonexistent, (2) set to undefined, or (3) a function (any Callable object). + + On the PropertyDescriptor object these three states are represneted by JSValue(), jsUndefined(), and + any JSObject* (with a constraint that this must be callable). + + Logically the get/set property of an accessor descriptor on an object might be in any of the three + states above, but in practice there is no way to distinguish between the first two states. As such + we stor the get/set values in property storage in a JSObject* field, with 0 indicating absent or + undefined. When unboxing to a PropertyDescriptor, map this back to a JS undefined value. + + * runtime/GetterSetter.h: + (JSC::GetterSetter::setGetter): + (JSC::GetterSetter::setSetter): + - Allow the getter/setter to be cleared. + * runtime/JSArray.cpp: + (JSC::JSArray::putDescriptor): + - Changed to call getterObject/setterObject. + (JSC::JSArray::defineOwnNumericProperty): + - Added ASSERT. + * runtime/JSObject.cpp: + (JSC::putDescriptor): + (JSC::JSObject::defineOwnProperty): + - Changed to call getterObject/setterObject. + * runtime/ObjectConstructor.cpp: + (JSC::objectConstructorGetOwnPropertyDescriptor): + - getter/setter values read from properties on object are never missing, they will now be set as undefined by 'setDescriptor'. + (JSC::toPropertyDescriptor): + - Do not translate undefined->empty, this loses an important distinction between a get/set property being absent, or being explicitly set to undefined. + * runtime/PropertyDescriptor.cpp: + (JSC::PropertyDescriptor::getterObject): + (JSC::PropertyDescriptor::setterObject): + - Accessors to convert the get/set property to an object pointer, converting undefined to 0. + (JSC::PropertyDescriptor::setDescriptor): + (JSC::PropertyDescriptor::setAccessorDescriptor): + - Translate a getter/setter internally represented at 0 to undefined, indicating that it is present. + * runtime/PropertyDescriptor.h: + - Declare getterObject/setterObject. + +2012-01-12 Zeno Albisser + + [Qt][WK2][Mac] Conflict of MacTypes.h defining a Fixed type after r104560. + https://bugs.webkit.org/show_bug.cgi?id=76175 + + Defining ENABLE_CSS_FILTERS leads to ambiguous references + due to MacTypes.h being included. + Defining CF_OPEN_SOURCE works around this problem. + + Reviewed by Simon Hausmann. + + * wtf/Platform.h: + +2012-01-12 Simon Hausmann + + Make the new WTF module build on Qt + https://bugs.webkit.org/show_bug.cgi?id=76163 + + Reviewed by Tor Arne Vestbø. + + * JavaScriptCore.pro: Removed wtf from the subdirs to build. + +2012-01-11 Filip Pizlo + + CodeBlock::m_executeCounter should be renamed to CodeBlock::m_jitExecuteCounter + https://bugs.webkit.org/show_bug.cgi?id=76144 + + + Rubber stamped by Gavin Barraclough. + + * bytecode/CodeBlock.h: + (JSC::CodeBlock::addressOfJITExecuteCounter): + (JSC::CodeBlock::offsetOfJITExecuteCounter): + (JSC::CodeBlock::jitExecuteCounter): + (JSC::CodeBlock::optimizeNextInvocation): + (JSC::CodeBlock::dontOptimizeAnytimeSoon): + (JSC::CodeBlock::optimizeAfterWarmUp): + (JSC::CodeBlock::optimizeAfterLongWarmUp): + (JSC::CodeBlock::optimizeSoon): + * dfg/DFGOSRExitCompiler32_64.cpp: + (JSC::DFG::OSRExitCompiler::compileExit): + * dfg/DFGOSRExitCompiler64.cpp: + (JSC::DFG::OSRExitCompiler::compileExit): + * jit/JIT.cpp: + (JSC::JIT::emitOptimizationCheck): + +2012-01-11 Gavin Barraclough + + Merge 'Getter'/'Setter' attributes into 'Accessor' + https://bugs.webkit.org/show_bug.cgi?id=76141 + + Reviewed by Filip Pizlo. + + These are currently ambiguous (and used inconsistently). It would logically appear + that either being bit set implies that the corresponding type of accessor is present + but (a) we don't correctly enforce this, and (b) this means the attributes would not + be able to distinguish between a data descriptor and an accessor descriptor with + neither a getter nor setter defined (which is a descriptor permissible under the spec). + This ambiguity would lead to unsafe property caching behavior (though this does not + represent an actual current bug, since we are currently unable to create descriptors + that have neither a getter nor setter, it just prevents us from doing so). + + * runtime/Arguments.cpp: + (JSC::Arguments::createStrictModeCallerIfNecessary): + (JSC::Arguments::createStrictModeCalleeIfNecessary): + * runtime/JSArray.cpp: + (JSC::SparseArrayValueMap::put): + (JSC::JSArray::putDescriptor): + * runtime/JSBoundFunction.cpp: + (JSC::JSBoundFunction::finishCreation): + * runtime/JSFunction.cpp: + (JSC::JSFunction::getOwnPropertySlot): + (JSC::JSFunction::getOwnPropertyDescriptor): + * runtime/JSObject.cpp: + (JSC::JSObject::defineGetter): + (JSC::JSObject::initializeGetterSetterProperty): + (JSC::JSObject::defineSetter): + (JSC::putDescriptor): + (JSC::JSObject::defineOwnProperty): + * runtime/JSObject.h: + * runtime/ObjectConstructor.cpp: + (JSC::objectConstructorDefineProperty): + * runtime/PropertyDescriptor.cpp: + (JSC::PropertyDescriptor::setDescriptor): + (JSC::PropertyDescriptor::setAccessorDescriptor): + (JSC::PropertyDescriptor::setSetter): + (JSC::PropertyDescriptor::setGetter): + (JSC::PropertyDescriptor::attributesOverridingCurrent): + +2012-01-11 Gavin Barraclough + + Object.defineProperty([], 'length', {}) should not make length read-only + https://bugs.webkit.org/show_bug.cgi?id=76097 + + Reviewed by Oliver Hunt. + + * runtime/JSArray.cpp: + (JSC::JSArray::defineOwnProperty): + - We should be checking writablePresent(). + +2012-01-11 Filip Pizlo + + Code duplication for invoking the JIT and DFG should be reduced + https://bugs.webkit.org/show_bug.cgi?id=76117 + + + Rubber stamped by Geoff Garen. + + * GNUmakefile.list.am: + * JavaScriptCore.xcodeproj/project.pbxproj: + * jit/JITDriver.h: Added. + (JSC::jitCompileIfAppropriate): + (JSC::jitCompileFunctionIfAppropriate): + * runtime/Executable.cpp: + (JSC::EvalExecutable::compileInternal): + (JSC::ProgramExecutable::compileInternal): + (JSC::FunctionExecutable::compileForCallInternal): + (JSC::FunctionExecutable::compileForConstructInternal): + +2012-01-11 Geoffrey Garen + + Bytecode dumping is broken for call opcodes (due to two new operands) + https://bugs.webkit.org/show_bug.cgi?id=75886 + + Reviewed by Oliver Hunt. + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::printCallOp): Made a helper function, so I wouldn't have + to fix this more than once. The helper function skips the extra two operands + at the end of the opcode, used for optimization. + + (JSC::CodeBlock::dump): Used the helper function. + + * bytecode/CodeBlock.h: Declared the helper function. + +2012-01-09 Geoffrey Garen + + REGRESSION: d3 Bullet Charts demo doesn't work (call with argument assignment is broken) + https://bugs.webkit.org/show_bug.cgi?id=75911 + + * bytecompiler/BytecodeGenerator.h: + (JSC::BytecodeGenerator::emitNodeForLeftHandSide): Cleanup: No need to + explicitly cast to our return type in C++. + + * bytecompiler/NodesCodegen.cpp: + (JSC::FunctionCallResolveNode::emitBytecode): + (JSC::ApplyFunctionCallDotNode::emitBytecode): Make sure to copy our function + into a temporary register before evaluating our arguments, since argument + evaluation might include function calls or assignments that overwrite our callee by name. + +2012-01-11 Michael Saboff + + v8-regexp spends 35% of its time allocating and copying internal regexp results data + https://bugs.webkit.org/show_bug.cgi?id=76079 + + Reviewed by Geoffrey Garen. + + Added a new RegExpResults struct that has the input string, the number of + subexpressions and the output vector. Changed RegExpConstructor to + include a RegExpConstructorPrivate instead of having a reference to one. + Changed RegExpMatchesArray to include a RegExpResults instead of a + reference to a RegExpConstructorPrivate. Created an overloaded assignment + operator to assign a RegExpConstructorPrivate to a RegExpResults. + Collectively this change is worth 24% performance improvement to v8-regexp. + + * runtime/RegExpConstructor.cpp: + (JSC::RegExpResult::operator=): + (JSC::RegExpConstructor::RegExpConstructor): + (JSC::RegExpMatchesArray::RegExpMatchesArray): + (JSC::RegExpMatchesArray::finishCreation): + (JSC::RegExpMatchesArray::~RegExpMatchesArray): + (JSC::RegExpMatchesArray::fillArrayInstance): + (JSC::RegExpConstructor::arrayOfMatches): + (JSC::RegExpConstructor::getBackref): + (JSC::RegExpConstructor::getLastParen): + (JSC::RegExpConstructor::getLeftContext): + (JSC::RegExpConstructor::getRightContext): + (JSC::RegExpConstructor::setInput): + (JSC::RegExpConstructor::input): + (JSC::RegExpConstructor::setMultiline): + (JSC::RegExpConstructor::multiline): + * runtime/RegExpConstructor.h: + (JSC::RegExpResult::RegExpResult): + (JSC::RegExpConstructor::performMatch): + * runtime/RegExpMatchesArray.h: + (JSC::RegExpMatchesArray::create): + (JSC::RegExpMatchesArray::getOwnPropertySlot): + (JSC::RegExpMatchesArray::getOwnPropertySlotByIndex): + (JSC::RegExpMatchesArray::getOwnPropertyDescriptor): + (JSC::RegExpMatchesArray::put): + (JSC::RegExpMatchesArray::putByIndex): + (JSC::RegExpMatchesArray::deleteProperty): + (JSC::RegExpMatchesArray::deletePropertyByIndex): + (JSC::RegExpMatchesArray::getOwnPropertyNames): + +2012-01-11 Eugene Girard + + Typo in error message: Unexpected token 'defualt' + https://bugs.webkit.org/show_bug.cgi?id=75105 + + Reviewed by Simon Fraser. + + * parser/Parser.h: + (JSC::Parser::getTokenName): + +2012-01-11 Anders Carlsson + + Assertion failure in JSC::allocateCell trying to allocate a JSString + https://bugs.webkit.org/show_bug.cgi?id=76101 + + Reviewed by Adam Roben. + + Remove the ExecutableBase::s_info and JSString::s_info static member variables from the .def file and + export them explicitly using the JS_EXPORTDATA macro. + + member variables explicitly using + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * runtime/Executable.h: + * runtime/JSString.h: + 2012-01-10 Mark Rowe jsc should install directly in to versioned Resources subfolder diff --git a/Source/JavaScriptCore/Configurations/Base.xcconfig b/Source/JavaScriptCore/Configurations/Base.xcconfig index ba5c75e29..e304bd1fb 100644 --- a/Source/JavaScriptCore/Configurations/Base.xcconfig +++ b/Source/JavaScriptCore/Configurations/Base.xcconfig @@ -82,12 +82,19 @@ REAL_PLATFORM_NAME_macosx = macosx; TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); +NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR = $(NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR_$(REAL_PLATFORM_NAME)); +NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR_iphoneos = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks; +NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR_iphonesimulator = $(NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR_iphoneos); +NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR_macosx = $(SYSTEM_LIBRARY_DIR)/Frameworks; JAVASCRIPTCORE_FRAMEWORKS_DIR = $(JAVASCRIPTCORE_FRAMEWORKS_DIR_$(REAL_PLATFORM_NAME)); -JAVASCRIPTCORE_FRAMEWORKS_DIR_iphoneos = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks; +JAVASCRIPTCORE_FRAMEWORKS_DIR_iphoneos = $(NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR_iphoneos); JAVASCRIPTCORE_FRAMEWORKS_DIR_iphonesimulator = $(JAVASCRIPTCORE_FRAMEWORKS_DIR_iphoneos); -JAVASCRIPTCORE_FRAMEWORKS_DIR_macosx = $(SYSTEM_LIBRARY_DIR)/Frameworks; +JAVASCRIPTCORE_FRAMEWORKS_DIR_macosx = $(JAVASCRIPTCORE_FRAMEWORKS_DIR_macosx_USE_STAGING_INSTALL_PATH_$(USE_STAGING_INSTALL_PATH)); +JAVASCRIPTCORE_FRAMEWORKS_DIR_macosx_USE_STAGING_INSTALL_PATH_ = $(JAVASCRIPTCORE_FRAMEWORKS_DIR_macosx_USE_STAGING_INSTALL_PATH_NO); +JAVASCRIPTCORE_FRAMEWORKS_DIR_macosx_USE_STAGING_INSTALL_PATH_NO = $(NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR); +JAVASCRIPTCORE_FRAMEWORKS_DIR_macosx_USE_STAGING_INSTALL_PATH_YES = $(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari; // DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants. // We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant. diff --git a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig index ac37615e8..3846b27bf 100644 --- a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig +++ b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig @@ -106,11 +106,13 @@ ENABLE_PROGRESS_TAG = ENABLE_PROGRESS_TAG; ENABLE_QUOTA = ; ENABLE_REGISTER_PROTOCOL_HANDLER = ; ENABLE_REQUEST_ANIMATION_FRAME = ENABLE_REQUEST_ANIMATION_FRAME; +ENABLE_SHADOW_DOM = ; ENABLE_SHARED_WORKERS = ENABLE_SHARED_WORKERS; ENABLE_SQL_DATABASE = ENABLE_SQL_DATABASE; ENABLE_STYLE_SCOPED = ; ENABLE_SVG = ENABLE_SVG; ENABLE_SVG_FONTS = ENABLE_SVG_FONTS; +ENABLE_TEXT_NOTIFICATIONS_ONLY = ENABLE_TEXT_NOTIFICATIONS_ONLY; ENABLE_TOUCH_ICON_LOADING = ; ENABLE_VIDEO = ENABLE_VIDEO; ENABLE_VIDEO_TRACK = ; @@ -121,4 +123,4 @@ ENABLE_WEB_TIMING = ; ENABLE_WORKERS = ENABLE_WORKERS; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_SHADERS) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_COLOR) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_SHADERS) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_COLOR) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_TAG) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(ENABLE_QUOTA) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT); diff --git a/Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig b/Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig index e6b5b4d2a..827749871 100644 --- a/Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig +++ b/Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig @@ -46,8 +46,5 @@ GCC_PREFIX_HEADER = JavaScriptCorePrefix.h; HEADER_SEARCH_PATHS = "${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore" $(HEADER_SEARCH_PATHS); INFOPLIST_FILE = Info.plist; INSTALL_PATH = $(JAVASCRIPTCORE_FRAMEWORKS_DIR); +DYLIB_INSTALL_NAME_BASE = $(NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR); PRODUCT_NAME = JavaScriptCore; - -OTHER_CFLAGS = $(OTHER_CFLAGS_$(CONFIGURATION)_$(CURRENT_VARIANT)); -OTHER_CFLAGS_Release_normal = -fomit-frame-pointer -funwind-tables; -OTHER_CFLAGS_Production_normal = $(OTHER_CFLAGS_Release_normal); diff --git a/Source/JavaScriptCore/Configurations/Version.xcconfig b/Source/JavaScriptCore/Configurations/Version.xcconfig index 33019e72f..0510654ff 100644 --- a/Source/JavaScriptCore/Configurations/Version.xcconfig +++ b/Source/JavaScriptCore/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 535; -MINOR_VERSION = 16; +MINOR_VERSION = 19; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/Source/JavaScriptCore/GNUmakefile.am b/Source/JavaScriptCore/GNUmakefile.am index 8498702dc..654cd108e 100644 --- a/Source/JavaScriptCore/GNUmakefile.am +++ b/Source/JavaScriptCore/GNUmakefile.am @@ -60,6 +60,7 @@ javascriptcore_cppflags += \ -I$(srcdir)/Source/JavaScriptCore/parser \ -I$(srcdir)/Source/JavaScriptCore/profiler \ -I$(srcdir)/Source/JavaScriptCore/runtime \ + -I$(srcdir)/Source/JavaScriptCore/tools \ -I$(srcdir)/Source/JavaScriptCore/wtf \ -I$(srcdir)/Source/JavaScriptCore/wtf \ -I$(srcdir)/Source/JavaScriptCore/wtf/gobject \ diff --git a/Source/JavaScriptCore/GNUmakefile.list.am b/Source/JavaScriptCore/GNUmakefile.list.am index 4fb218199..de5338dd4 100644 --- a/Source/JavaScriptCore/GNUmakefile.list.am +++ b/Source/JavaScriptCore/GNUmakefile.list.am @@ -83,6 +83,8 @@ javascriptcore_sources += \ Source/JavaScriptCore/assembler/X86Assembler.h \ Source/JavaScriptCore/bytecode/CallLinkInfo.cpp \ Source/JavaScriptCore/bytecode/CallLinkInfo.h \ + Source/JavaScriptCore/bytecode/CallLinkStatus.cpp \ + Source/JavaScriptCore/bytecode/CallLinkStatus.h \ Source/JavaScriptCore/bytecode/CallReturnOffsetToBytecodeOffset.h \ Source/JavaScriptCore/bytecode/CodeType.h \ Source/JavaScriptCore/bytecode/CodeBlock.cpp \ @@ -93,21 +95,28 @@ javascriptcore_sources += \ Source/JavaScriptCore/bytecode/DFGExitProfile.h \ Source/JavaScriptCore/bytecode/EvalCodeCache.h \ Source/JavaScriptCore/bytecode/ExpressionRangeInfo.h \ + Source/JavaScriptCore/bytecode/GetByIdStatus.cpp \ + Source/JavaScriptCore/bytecode/GetByIdStatus.h \ Source/JavaScriptCore/bytecode/GlobalResolveInfo.h \ - Source/JavaScriptCore/bytecode/HandelerInfo.h \ + Source/JavaScriptCore/bytecode/HandlerInfo.h \ Source/JavaScriptCore/bytecode/Instruction.h \ Source/JavaScriptCore/bytecode/JumpTable.cpp \ Source/JavaScriptCore/bytecode/JumpTable.h \ Source/JavaScriptCore/bytecode/LineInfo.h \ Source/JavaScriptCore/bytecode/MethodCallLinkInfo.cpp \ Source/JavaScriptCore/bytecode/MethodCallLinkInfo.h \ + Source/JavaScriptCore/bytecode/MethodCallLinkStatus.cpp \ + Source/JavaScriptCore/bytecode/MethodCallLinkStatus.h \ Source/JavaScriptCore/bytecode/Opcode.cpp \ Source/JavaScriptCore/bytecode/Opcode.h \ Source/JavaScriptCore/bytecode/PredictedType.cpp \ Source/JavaScriptCore/bytecode/PredictedType.h \ Source/JavaScriptCore/bytecode/PredictionTracker.h \ + Source/JavaScriptCore/bytecode/PutByIdStatus.cpp \ + Source/JavaScriptCore/bytecode/PutByIdStatus.h \ Source/JavaScriptCore/bytecode/SamplingTool.cpp \ Source/JavaScriptCore/bytecode/SamplingTool.h \ + Source/JavaScriptCore/bytecode/StructureSet.h \ Source/JavaScriptCore/bytecode/StructureStubInfo.cpp \ Source/JavaScriptCore/bytecode/StructureStubInfo.h \ Source/JavaScriptCore/bytecode/ValueProfile.cpp \ @@ -129,6 +138,7 @@ javascriptcore_sources += \ Source/JavaScriptCore/dfg/DFGByteCodeCache.h \ Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp \ Source/JavaScriptCore/dfg/DFGByteCodeParser.h \ + Source/JavaScriptCore/dfg/DFGCCallHelpers.h \ Source/JavaScriptCore/dfg/DFGCapabilities.cpp \ Source/JavaScriptCore/dfg/DFGCapabilities.h \ Source/JavaScriptCore/dfg/DFGCommon.h \ @@ -165,12 +175,13 @@ javascriptcore_sources += \ Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp \ Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp \ Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h \ - Source/JavaScriptCore/dfg/DFGStructureSet.h \ Source/JavaScriptCore/dfg/DFGThunks.cpp \ Source/JavaScriptCore/dfg/DFGThunks.h \ Source/JavaScriptCore/dfg/DFGVariableAccessData.h \ - Source/JavaScriptCore/heap/AllocationSpace.cpp \ - Source/JavaScriptCore/heap/AllocationSpace.h \ + Source/JavaScriptCore/heap/BumpBlock.h \ + Source/JavaScriptCore/heap/BumpSpace.cpp \ + Source/JavaScriptCore/heap/BumpSpace.h \ + Source/JavaScriptCore/heap/BumpSpaceInlineMethods.h \ Source/JavaScriptCore/heap/CardSet.h \ Source/JavaScriptCore/heap/ConservativeRoots.cpp \ Source/JavaScriptCore/heap/ConservativeRoots.h \ @@ -179,6 +190,7 @@ javascriptcore_sources += \ Source/JavaScriptCore/heap/Handle.h \ Source/JavaScriptCore/heap/HandleHeap.cpp \ Source/JavaScriptCore/heap/HandleHeap.h \ + Source/JavaScriptCore/heap/HeapBlock.h \ Source/JavaScriptCore/heap/SlotVisitor.h \ Source/JavaScriptCore/heap/HandleStack.cpp \ Source/JavaScriptCore/heap/HandleStack.h \ @@ -250,6 +262,8 @@ javascriptcore_sources += \ Source/JavaScriptCore/icu/unicode/utf_old.h \ Source/JavaScriptCore/icu/unicode/utypes.h \ Source/JavaScriptCore/icu/unicode/uversion.h \ + Source/JavaScriptCore/interpreter/AbstractPC.cpp \ + Source/JavaScriptCore/interpreter/AbstractPC.h \ Source/JavaScriptCore/interpreter/CachedCall.h \ Source/JavaScriptCore/interpreter/CallFrameClosure.h \ Source/JavaScriptCore/interpreter/CallFrame.cpp \ @@ -268,6 +282,7 @@ javascriptcore_sources += \ Source/JavaScriptCore/jit/JITCall32_64.cpp \ Source/JavaScriptCore/jit/JITCall.cpp \ Source/JavaScriptCore/jit/JITCode.h \ + Source/JavaScriptCore/jit/JITDriver.h \ Source/JavaScriptCore/jit/JIT.cpp \ Source/JavaScriptCore/jit/JIT.h \ Source/JavaScriptCore/jit/JITExceptions.cpp \ @@ -510,6 +525,12 @@ javascriptcore_sources += \ Source/JavaScriptCore/runtime/WeakGCMap.h \ Source/JavaScriptCore/runtime/WeakRandom.h \ Source/JavaScriptCore/runtime/WriteBarrier.h \ + Source/JavaScriptCore/tools/CodeProfile.cpp \ + Source/JavaScriptCore/tools/CodeProfile.h \ + Source/JavaScriptCore/tools/CodeProfiling.cpp \ + Source/JavaScriptCore/tools/CodeProfiling.h \ + Source/JavaScriptCore/tools/ProfileTreeNode.h \ + Source/JavaScriptCore/tools/TieredMMapArray.h \ Source/JavaScriptCore/wtf/Alignment.h \ Source/JavaScriptCore/wtf/AlwaysInline.h \ Source/JavaScriptCore/wtf/ArrayBuffer.cpp \ @@ -531,6 +552,7 @@ javascriptcore_sources += \ Source/JavaScriptCore/wtf/ByteArray.cpp \ Source/JavaScriptCore/wtf/ByteArray.h \ Source/JavaScriptCore/wtf/CheckedArithmetic.h \ + Source/JavaScriptCore/wtf/CheckedBoolean.h \ Source/JavaScriptCore/wtf/Compiler.h \ Source/JavaScriptCore/wtf/CryptographicallyRandomNumber.cpp \ Source/JavaScriptCore/wtf/CryptographicallyRandomNumber.h \ @@ -616,6 +638,8 @@ javascriptcore_sources += \ Source/JavaScriptCore/wtf/NonCopyingSort.h \ Source/JavaScriptCore/wtf/NotFound.h \ Source/JavaScriptCore/wtf/NullPtr.h \ + Source/JavaScriptCore/wtf/NumberOfCores.cpp \ + Source/JavaScriptCore/wtf/NumberOfCores.h \ Source/JavaScriptCore/wtf/OSAllocator.h \ Source/JavaScriptCore/wtf/OSRandomSource.cpp \ Source/JavaScriptCore/wtf/OSRandomSource.h \ @@ -704,6 +728,7 @@ javascriptcore_sources += \ Source/JavaScriptCore/wtf/Uint16Array.h \ Source/JavaScriptCore/wtf/Uint32Array.h \ Source/JavaScriptCore/wtf/Uint8Array.h \ + Source/JavaScriptCore/wtf/Uint8ClampedArray.h \ Source/JavaScriptCore/wtf/unicode/CharacterNames.h \ Source/JavaScriptCore/wtf/unicode/Collator.h \ Source/JavaScriptCore/wtf/unicode/CollatorDefault.cpp \ diff --git a/Source/JavaScriptCore/JavaScriptCore.exp b/Source/JavaScriptCore/JavaScriptCore.exp index c79c146e9..51032d742 100644 --- a/Source/JavaScriptCore/JavaScriptCore.exp +++ b/Source/JavaScriptCore/JavaScriptCore.exp @@ -91,6 +91,7 @@ _JSWeakObjectMapGet _JSWeakObjectMapRemove _JSWeakObjectMapSet _WTFGetBacktrace +_WTFInvokeCrashHook _WTFLog _WTFLogVerbose _WTFReportArgumentAssertionFailure @@ -99,6 +100,7 @@ _WTFReportAssertionFailureWithMessage _WTFReportBacktrace _WTFReportError _WTFReportFatalError +_WTFSetCrashHook __ZN14OpaqueJSString6createERKN3JSC7UStringE __ZN3JSC10HandleHeap12writeBarrierEPNS_7JSValueERKS1_ __ZN3JSC10HandleHeap4growEv @@ -110,6 +112,8 @@ __ZN3JSC10Identifier3addEPNS_9ExecStateEPKc __ZN3JSC10Identifier4fromEPNS_9ExecStateEi __ZN3JSC10Identifier4fromEPNS_9ExecStateEj __ZN3JSC10Identifier8toUInt32ERKNS_7UStringERb +__ZN3JSC10JSFunction11displayNameEPNS_9ExecStateE +__ZN3JSC10JSFunction21calculatedDisplayNameEPNS_9ExecStateE __ZN3JSC10JSFunction4nameEPNS_9ExecStateE __ZN3JSC10JSFunction6s_infoE __ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureE @@ -125,6 +129,7 @@ __ZN3JSC11JSByteArray3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSVal __ZN3JSC11JSByteArray6s_infoE __ZN3JSC11JSByteArray7destroyEPNS_6JSCellE __ZN3JSC11JSByteArrayC1EPNS_9ExecStateEPNS_9StructureEPN3WTF9ByteArrayE +__ZN3JSC11MarkedSpace16allocateSlowCaseERNS0_9SizeClassE __ZN3JSC11ParserArena5resetEv __ZN3JSC11checkSyntaxEPNS_9ExecStateERKNS_10SourceCodeEPNS_7JSValueE __ZN3JSC11createErrorEPNS_9ExecStateERKNS_7UStringE @@ -168,7 +173,7 @@ __ZN3JSC14JSGlobalObject12defineSetterEPNS_8JSObjectEPNS_9ExecStateERKNS_10Ident __ZN3JSC14JSGlobalObject13clearRareDataEPNS_6JSCellE __ZN3JSC14JSGlobalObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE __ZN3JSC14JSGlobalObject16addStaticGlobalsEPNS0_18GlobalPropertyInfoEi -__ZN3JSC14JSGlobalObject17putWithAttributesEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj +__ZN3JSC14JSGlobalObject16putDirectVirtualEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj __ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE __ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE __ZN3JSC14JSGlobalObject25s_globalObjectMethodTableE @@ -188,7 +193,6 @@ __ZN3JSC14TimeoutChecker5resetEv __ZN3JSC14VTableSpectrum5countEPNS_6JSCellE __ZN3JSC14throwTypeErrorEPNS_9ExecStateE __ZN3JSC14throwTypeErrorEPNS_9ExecStateERKNS_7UStringE -__ZN3JSC15AllocationSpace16allocateSlowCaseERNS_11MarkedSpace9SizeClassE __ZN3JSC15WeakHandleOwner26isReachableFromOpaqueRootsENS_6HandleINS_7UnknownEEEPvRNS_11SlotVisitorE __ZN3JSC15WeakHandleOwner8finalizeENS_6HandleINS_7UnknownEEEPv __ZN3JSC15WeakHandleOwnerD2Ev @@ -237,6 +241,7 @@ __ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectER __ZN3JSC24DynamicGlobalObjectScopeC1ERNS_12JSGlobalDataEPNS_14JSGlobalObjectE __ZN3JSC24TerminatedExecutionError6s_infoE __ZN3JSC24createStackOverflowErrorEPNS_9ExecStateE +__ZN3JSC24getCalculatedDisplayNameEPNS_9ExecStateEPNS_8JSObjectE __ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE __ZN3JSC29callHostFunctionAsConstructorEPNS_9ExecStateE __ZN3JSC30isTerminatedExecutionExceptionENS_7JSValueE @@ -276,7 +281,7 @@ __ZN3JSC6JSLock4lockENS_14JSLockBehaviorE __ZN3JSC6JSLock6unlockENS_14JSLockBehaviorE __ZN3JSC6JSLock9lockCountEv __ZN3JSC6JSLockC1EPNS_9ExecStateE -__ZN3JSC6RegExp5matchERNS_12JSGlobalDataERKNS_7UStringEiPN3WTF6VectorIiLm32EEE +__ZN3JSC6RegExp5matchERNS_12JSGlobalDataERKNS_7UStringEjPN3WTF6VectorIiLm32EEE __ZN3JSC6RegExp6createERNS_12JSGlobalDataERKNS_7UStringENS_11RegExpFlagsE __ZN3JSC7JSArray13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE __ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataEj @@ -285,10 +290,8 @@ __ZN3JSC7JSArray17defineOwnPropertyEPNS_8JSObjectEPNS_9ExecStateERKNS_10Identifi __ZN3JSC7JSArray25getOwnPropertySlotByIndexEPNS_6JSCellEPNS_9ExecStateEjRNS_12PropertySlotE __ZN3JSC7JSArray30tryFinishCreationUninitializedERNS_12JSGlobalDataEj __ZN3JSC7JSArray6s_infoE -__ZN3JSC7JSArray7destroyEPNS_6JSCellE __ZN3JSC7JSArrayC1ERNS_12JSGlobalDataEPNS_9StructureE __ZN3JSC7JSArrayC2ERNS_12JSGlobalDataEPNS_9StructureE -__ZN3JSC7JSArrayD2Ev __ZN3JSC7JSValue13isValidCalleeEv __ZN3JSC7Options17numberOfGCMarkersE __ZN3JSC7Options24opaqueRootMergeThresholdE @@ -320,10 +323,9 @@ __ZN3JSC8JSObject12toThisObjectEPNS_6JSCellEPNS_9ExecStateE __ZN3JSC8JSObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE __ZN3JSC8JSObject14deletePropertyEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierE __ZN3JSC8JSObject16getPropertyNamesEPS0_PNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE +__ZN3JSC8JSObject16putDirectVirtualEPS0_PNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj __ZN3JSC8JSObject17defineOwnPropertyEPS0_PNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorEb __ZN3JSC8JSObject17preventExtensionsERNS_12JSGlobalDataE -__ZN3JSC8JSObject17putWithAttributesEPNS_12JSGlobalDataERKNS_10IdentifierENS_7JSValueEj -__ZN3JSC8JSObject17putWithAttributesEPS0_PNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj __ZN3JSC8JSObject19getOwnPropertyNamesEPS0_PNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE __ZN3JSC8JSObject21deletePropertyByIndexEPNS_6JSCellEPNS_9ExecStateEj __ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE @@ -402,6 +404,7 @@ __ZN3WTF12AtomicString3addEPKh __ZN3WTF12AtomicString3addEPKt __ZN3WTF12AtomicString3addEPKtj __ZN3WTF12AtomicString3addEPKtjj +__ZN3WTF12AtomicString3addEPNS_10StringImplEjj __ZN3WTF12AtomicString4findEPKtjj __ZN3WTF12AtomicString4initEv __ZN3WTF12createThreadEPFPvS0_ES0_ @@ -410,11 +413,10 @@ __ZN3WTF12detachThreadEj __ZN3WTF12isMainThreadEv __ZN3WTF12randomNumberEv __ZN3WTF13MetaAllocator17addFreshFreeSpaceEPvm -__ZN3WTF13MetaAllocator17freeFreeSpaceNodeEPNS_12RedBlackTreeImPvE4NodeE +__ZN3WTF13MetaAllocator17freeFreeSpaceNodeEPNS0_13FreeSpaceNodeE __ZN3WTF13MetaAllocator18debugFreeSpaceSizeEv -__ZN3WTF13MetaAllocator8allocateEm +__ZN3WTF13MetaAllocator8allocateEmPv __ZN3WTF13MetaAllocatorC2Em -__ZN3WTF13StringBuilder11reifyStringEv __ZN3WTF13StringBuilder11shrinkToFitEv __ZN3WTF13StringBuilder15reserveCapacityEj __ZN3WTF13StringBuilder6appendEPKhj @@ -450,6 +452,7 @@ __ZN3WTF17equalIgnoringCaseEPNS_10StringImplEPKh __ZN3WTF17equalIgnoringCaseEPNS_10StringImplES1_ __ZN3WTF18calculateDSTOffsetEdd __ZN3WTF18calculateUTCOffsetEv +__ZN3WTF18charactersToDoubleEPKhmPbS2_ __ZN3WTF18charactersToDoubleEPKtmPbS2_ __ZN3WTF18dateToDaysFrom1970Eiii __ZN3WTF18monthFromDayInYearEib @@ -547,7 +550,6 @@ __ZN3WTF9xmlnsAtomE __ZN3WTFeqERKNS_7CStringES2_ __ZNK3JSC10JSFunction10sourceCodeEv __ZNK3JSC10JSFunction23isHostFunctionNonInlineEv -__ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_10JSFunctionE __ZNK3JSC11Interpreter18retrieveLastCallerEPNS_9ExecStateERiRlRNS_7UStringERNS_7JSValueE __ZNK3JSC12PropertySlot14functionGetterEPNS_9ExecStateE __ZNK3JSC17DebuggerCallFrame10thisObjectEv @@ -566,13 +568,13 @@ __ZNK3JSC19SourceProviderCache8byteSizeEv __ZNK3JSC6JSCell11toPrimitiveEPNS_9ExecStateENS_22PreferredPrimitiveTypeE __ZNK3JSC6JSCell8toNumberEPNS_9ExecStateE __ZNK3JSC6JSCell8toObjectEPNS_9ExecStateEPNS_14JSGlobalObjectE -__ZNK3JSC6JSCell8toStringEPNS_9ExecStateE __ZNK3JSC6JSCell9getStringEPNS_9ExecStateE __ZNK3JSC6JSCell9getStringEPNS_9ExecStateERNS_7UStringE __ZNK3JSC7ArgList8getSliceEiRS0_ __ZNK3JSC7JSArray12subclassDataEv __ZNK3JSC7JSValue16toNumberSlowCaseEPNS_9ExecStateE __ZNK3JSC7JSValue16toObjectSlowCaseEPNS_9ExecStateEPNS_14JSGlobalObjectE +__ZNK3JSC7JSValue16toStringSlowCaseEPNS_9ExecStateE __ZNK3JSC7JSValue19synthesizePrototypeEPNS_9ExecStateE __ZNK3JSC7JSValue20toThisObjectSlowCaseEPNS_9ExecStateE __ZNK3JSC7JSValue9toIntegerEPNS_9ExecStateE @@ -596,6 +598,8 @@ __ZNK3WTF13DecimalNumber15toStringDecimalEPtj __ZNK3WTF13DecimalNumber19toStringExponentialEPtj __ZNK3WTF13DecimalNumber28bufferLengthForStringDecimalEv __ZNK3WTF13DecimalNumber32bufferLengthForStringExponentialEv +__ZNK3WTF13StringBuilder11reifyStringEv +__ZNK3WTF13StringBuilder9canShrinkEv __ZNK3WTF6String11toIntStrictEPbi __ZNK3WTF6String12isolatedCopyEv __ZNK3WTF6String12toUIntStrictEPbi diff --git a/Source/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp b/Source/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp index bec3ae17d..34b4e08e5 100644 --- a/Source/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp +++ b/Source/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp @@ -1,10 +1,10 @@ # -# Copyright (C) 2009 Google Inc. All rights reserved. -# +# Copyright (C) 2009, 2012 Google 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: -# +# # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above @@ -14,7 +14,7 @@ # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -30,8 +30,7 @@ { 'includes': [ - # FIXME: Sense whether upstream or downstream build, and - # include the right features.gypi + '../../WebKit/chromium/WinPrecompile.gypi', '../../WebKit/chromium/features.gypi', '../JavaScriptCore.gypi', ], @@ -66,7 +65,7 @@ 'defines': [ # Import features_defines from features.gypi '<@(feature_defines)', - + # Turns on #if PLATFORM(CHROMIUM) 'BUILDING_CHROMIUM__=1', # Controls wtf/FastMalloc @@ -123,18 +122,18 @@ ['exclude', '../'], # ... Then include what we want. ['include', '../wtf/'], - # FIXME: This is clearly not sustainable. - ['exclude', '../wtf/efl'], - ['exclude', '../wtf/gobject'], - ['exclude', '../wtf/gtk'], - ['exclude', '../wtf/mac'], - ['exclude', '../wtf/qt'], - ['exclude', '../wtf/url'], - ['exclude', '../wtf/wince'], - ['exclude', '../wtf/wx'], - ['exclude', '../wtf/unicode/wince'], - ['exclude', '../wtf/unicode/glib'], - ['exclude', '../wtf/unicode/qt4'], + # FIXME: This is clearly not sustainable. + ['exclude', '../wtf/efl'], + ['exclude', '../wtf/gobject'], + ['exclude', '../wtf/gtk'], + ['exclude', '../wtf/mac'], + ['exclude', '../wtf/qt'], + ['exclude', '../wtf/url'], + ['exclude', '../wtf/wince'], + ['exclude', '../wtf/wx'], + ['exclude', '../wtf/unicode/wince'], + ['exclude', '../wtf/unicode/glib'], + ['exclude', '../wtf/unicode/qt4'], # GLib/GTK, even though its name doesn't really indicate. ['exclude', '/(gtk|glib|gobject)/.*\\.(cpp|h)$'], ['exclude', '(Default|Gtk|Mac|None|Qt|Win|Wx|Efl|Symbian)\\.(cpp|mm)$'], @@ -172,7 +171,8 @@ ['exclude', 'ThreadingPthreads\\.cpp$'], ['include', 'Thread(ing|Specific)Win\\.cpp$'], ['exclude', 'OSAllocatorPosix\\.cpp$'], - ['include', 'OSAllocatorWin\\.cpp$'] + ['include', 'OSAllocatorWin\\.cpp$'], + ['include', 'win/OwnPtrWin\\.cpp$'], ], 'include_dirs!': [ '<(SHARED_INTERMEDIATE_DIR)/webkit', @@ -198,11 +198,6 @@ 'dependencies': [ 'wtf', ], - 'conditions': [ - ['OS=="win"', { - 'dependencies': ['<(chromium_src_dir)/build/win/system.gyp:cygwin'], - }], - ], 'variables': { 'optimize': 'max' }, 'actions': [ { diff --git a/Source/JavaScriptCore/JavaScriptCore.gypi b/Source/JavaScriptCore/JavaScriptCore.gypi index c9367911b..b59be38d9 100644 --- a/Source/JavaScriptCore/JavaScriptCore.gypi +++ b/Source/JavaScriptCore/JavaScriptCore.gypi @@ -27,10 +27,13 @@ 'API/OpaqueJSString.h', 'assembler/MacroAssemblerCodeRef.h', 'bytecode/Opcode.h', - 'heap/AllocationSpace.h', + 'heap/BumpBlock.h', + 'heap/BumpSpace.h', + 'heap/BumpSpaceInlineMethods.h', 'heap/ConservativeRoots.h', 'heap/Handle.h', 'heap/HandleHeap.h', + 'heap/HeapBlock.h', 'heap/SlotVisitor.h', 'heap/HandleStack.h', 'heap/HandleTypes.h', @@ -144,6 +147,7 @@ 'wtf/BumpPointerAllocator.h', 'wtf/ByteArray.h', 'wtf/CheckedArithmetic.h', + 'wtf/CheckedBoolean.h', 'wtf/Compiler.h', 'wtf/Complex.h', 'wtf/CryptographicallyRandomNumber.h', @@ -328,7 +332,6 @@ 'bytecompiler/LabelScope.h', 'bytecompiler/NodesCodegen.cpp', 'bytecompiler/RegisterID.h', - 'heap/AllocationSpace.cpp', 'heap/ConservativeRoots.cpp', 'heap/HandleHeap.cpp', 'heap/HandleStack.cpp', @@ -571,6 +574,8 @@ 'wtf/MainThread.cpp', 'wtf/MallocZoneSupport.h', 'wtf/NullPtr.cpp', + 'wtf/NumberOfCores.cpp', + 'wtf/NumberOfCores.h', 'wtf/OSAllocatorPosix.cpp', 'wtf/OSAllocatorWin.cpp', 'wtf/OSRandomSource.cpp', diff --git a/Source/JavaScriptCore/JavaScriptCore.order b/Source/JavaScriptCore/JavaScriptCore.order index 3ceda653e..d8513d099 100644 --- a/Source/JavaScriptCore/JavaScriptCore.order +++ b/Source/JavaScriptCore/JavaScriptCore.order @@ -323,7 +323,8 @@ __ZN3WTF13StringBuilder6appendEPKtj __ZN3WTF13StringBuilder19appendUninitializedEj __ZN3WTF13StringBuilder14allocateBufferEPKtj __ZN3WTF13StringBuilder11shrinkToFitEv -__ZN3WTF13StringBuilder11reifyStringEv +__ZNK3WTF13StringBuilder11reifyStringEv +__ZNK3WTF13StringBuilder9canShrinkEv __ZN3JSC7JSArray4pushEPNS_9ExecStateENS_7JSValueE __ZN3JSC7JSArray20increaseVectorLengthEj __ZN3WTF14tryFastReallocEPvm diff --git a/Source/JavaScriptCore/JavaScriptCore.pri b/Source/JavaScriptCore/JavaScriptCore.pri index 65e0eb31a..4e2426f8f 100644 --- a/Source/JavaScriptCore/JavaScriptCore.pri +++ b/Source/JavaScriptCore/JavaScriptCore.pri @@ -23,6 +23,7 @@ INCLUDEPATH += \ $$SOURCE_DIR/parser \ $$SOURCE_DIR/profiler \ $$SOURCE_DIR/runtime \ + $$SOURCE_DIR/tools \ $$SOURCE_DIR/yarr \ $$SOURCE_DIR/API \ $$SOURCE_DIR/ForwardingHeaders \ diff --git a/Source/JavaScriptCore/JavaScriptCore.pro b/Source/JavaScriptCore/JavaScriptCore.pro index cd3ab235f..393728f99 100644 --- a/Source/JavaScriptCore/JavaScriptCore.pro +++ b/Source/JavaScriptCore/JavaScriptCore.pro @@ -7,19 +7,13 @@ TEMPLATE = subdirs CONFIG += ordered -WTF.file = wtf/wtf.pro -WTF.makefile = Makefile.WTF -SUBDIRS += WTF +derived_sources.file = DerivedSources.pri +target.file = Target.pri -!v8 { - derived_sources.file = DerivedSources.pri - target.file = Target.pri +SUBDIRS += derived_sources target - SUBDIRS += derived_sources target +addStrictSubdirOrderBetween(derived_sources, target) - addStrictSubdirOrderBetween(derived_sources, target) - - jsc.file = jsc.pro - jsc.makefile = Makefile.jsc - SUBDIRS += jsc -} +jsc.file = jsc.pro +jsc.makefile = Makefile.jsc +SUBDIRS += jsc diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def index 577329e94..93c9e7569 100644 --- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def +++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def @@ -64,7 +64,7 @@ EXPORTS ?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVJSGlobalData@2@PAVStringImpl@4@@Z ?addStaticGlobals@JSGlobalObject@JSC@@IAEXPAUGlobalPropertyInfo@12@H@Z ?allocatePropertyStorage@JSObject@JSC@@QAEXAAVJSGlobalData@2@II@Z - ?allocateSlowCase@AllocationSpace@JSC@@AAEPAXAAUSizeClass@MarkedSpace@2@@Z + ?allocateSlowCase@MarkedSpace@JSC@@AAEPAXAAUSizeClass@12@@Z ?append@StringBuilder@WTF@@QAEXPBEI@Z ?append@StringBuilder@WTF@@QAEXPB_WI@Z ?ascii@UString@JSC@@QBE?AVCString@WTF@@XZ @@ -158,6 +158,7 @@ EXPORTS ?detach@Debugger@JSC@@UAEXPAVJSGlobalObject@2@@Z ?detachThread@WTF@@YAXI@Z ?didTimeOut@TimeoutChecker@JSC@@QAE_NPAVExecState@2@@Z + ?displayName@JSFunction@JSC@@QAE?BVUString@2@PAVExecState@2@@Z ?dtoa@WTF@@YAXQADNAA_NAAHAAI@Z ?dumpSampleData@JSGlobalData@JSC@@QAEXPAVExecState@2@@Z ?empty@StringImpl@WTF@@SAPAV12@XZ @@ -243,7 +244,7 @@ EXPORTS ?lock@Mutex@WTF@@QAEXXZ ?lockAtomicallyInitializedStaticMutex@WTF@@YAXXZ ?lockCount@JSLock@JSC@@SAHXZ - ?match@RegExp@JSC@@QAEHAAVJSGlobalData@2@ABVUString@2@HPAV?$Vector@H$0CA@@WTF@@@Z + ?match@RegExp@JSC@@QAEHAAVJSGlobalData@2@ABVUString@2@IPAV?$Vector@H$0CA@@WTF@@@Z ?materializePropertyMap@Structure@JSC@@AAEXAAVJSGlobalData@2@@Z ?monotonicallyIncreasingTime@WTF@@YANXZ ?monthFromDayInYear@WTF@@YAHH_N@Z @@ -274,13 +275,12 @@ EXPORTS ?put@JSObject@JSC@@SAXPAVJSCell@2@PAVExecState@2@ABVIdentifier@2@VJSValue@2@AAVPutPropertySlot@2@@Z ?putByIndex@JSByteArray@JSC@@SAXPAVJSCell@2@PAVExecState@2@IVJSValue@2@@Z ?putByIndex@JSObject@JSC@@SAXPAVJSCell@2@PAVExecState@2@IVJSValue@2@@Z - ?putDirectInternal@JSObject@JSC@@AAE_NAAVJSGlobalData@2@ABVIdentifier@2@VJSValue@2@I_NAAVPutPropertySlot@2@PAVJSCell@2@@Z - ?putWithAttributes@JSGlobalObject@JSC@@SAXPAVJSObject@2@PAVExecState@2@ABVIdentifier@2@VJSValue@2@I@Z - ?putWithAttributes@JSObject@JSC@@SAXPAV12@PAVExecState@2@ABVIdentifier@2@VJSValue@2@I@Z + ?putDirectVirtual@JSGlobalObject@JSC@@SAXPAVJSObject@2@PAVExecState@2@ABVIdentifier@2@VJSValue@2@I@Z + ?putDirectVirtual@JSObject@JSC@@SAXPAV12@PAVExecState@2@ABVIdentifier@2@VJSValue@2@I@Z ?randomNumber@WTF@@YANXZ ?recompileAllJSFunctions@Debugger@JSC@@QAEXPAVJSGlobalData@2@@Z ?regExpFlags@JSC@@YA?AW4RegExpFlags@1@ABVUString@1@@Z - ?reifyString@StringBuilder@WTF@@AAEXXZ + ?reifyString@StringBuilder@WTF@@ABEXXZ ?releaseDecommitted@OSAllocator@WTF@@SAXPAXI@Z ?releaseExecutableMemory@JSGlobalData@JSC@@QAEXXZ ?reportExtraMemoryCostSlowCase@Heap@JSC@@AAEXI@Z @@ -292,11 +292,9 @@ EXPORTS ?resize@StringBuilder@WTF@@QAEXI@Z ?resolveRope@JSString@JSC@@ABEXPAVExecState@2@@Z ?restoreAll@Profile@JSC@@QAEXXZ - ?retrieveCaller@Interpreter@JSC@@QBE?AVJSValue@2@PAVExecState@2@PAVJSFunction@2@@Z + ?retrieveCallerFromVMCode@Interpreter@JSC@@QBE?AVJSValue@2@PAVExecState@2@PAVJSFunction@2@@Z ?retrieveLastCaller@Interpreter@JSC@@QBEXPAVExecState@2@AAH1AAVUString@2@AAVJSValue@2@@Z ?s_globalObjectMethodTable@JSGlobalObject@JSC@@1UGlobalObjectMethodTable@2@B - ?s_info@ExecutableBase@JSC@@2UClassInfo@2@B - ?s_info@JSString@JSC@@2UClassInfo@2@B ?setConfigurable@PropertyDescriptor@JSC@@QAEX_N@Z ?setDescriptor@PropertyDescriptor@JSC@@QAEXVJSValue@2@I@Z ?setDumpsGeneratedCode@BytecodeGenerator@JSC@@SAX_N@Z @@ -342,10 +340,10 @@ EXPORTS ?toNumberSlowCase@JSValue@JSC@@ABENPAVExecState@2@@Z ?toObject@JSCell@JSC@@QBEPAVJSObject@2@PAVExecState@2@PAVJSGlobalObject@2@@Z ?toObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@PAVJSGlobalObject@2@@Z - ?toString@JSCell@JSC@@QBE?AVUString@2@PAVExecState@2@@Z - ?toString@JSObject@JSC@@QBE?AVUString@2@PAVExecState@2@@Z + ?toString@JSObject@JSC@@QBEPAVJSString@2@PAVExecState@2@@Z ?toStringDecimal@DecimalNumber@WTF@@QBEIPA_WI@Z ?toStringExponential@DecimalNumber@WTF@@QBEIPA_WI@Z + ?toStringSlowCase@JSValue@JSC@@ABEPAVJSString@2@PAVExecState@2@@Z ?toThisObject@JSObject@JSC@@SAPAV12@PAVJSCell@2@PAVExecState@2@@Z ?toThisObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z ?toUInt32@Identifier@JSC@@SAIABVUString@2@AA_N@Z @@ -370,6 +368,7 @@ EXPORTS ?writeBarrier@HandleHeap@JSC@@QAEXPAVJSValue@2@ABV32@@Z ?yield@WTF@@YAXXZ WTFGetBacktrace + WTFInvokeCrashHook WTFLog WTFLogVerbose WTFReportArgumentAssertionFailure @@ -377,3 +376,4 @@ EXPORTS WTFReportAssertionFailureWithMessage WTFReportBacktrace WTFReportError + WTFSetCrashHook diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj index 8fd3c8ab0..fea820ddc 100644 --- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj +++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj @@ -1446,9 +1446,69 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1785,6 +1845,14 @@ + + + + @@ -1966,11 +2034,19 @@ Name="heap" > + + + + + + diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops index e94459681..33b53442a 100644 --- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops +++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops @@ -6,7 +6,7 @@ > diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj index 6e89b0167..c914b22c1 100644 --- a/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj +++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj @@ -692,6 +692,10 @@ RelativePath="..\..\wtf\CheckedArithmetic.h" > + + @@ -948,6 +952,14 @@ RelativePath="..\..\wtf\NullPtr.h" > + + + + diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 8685f097f..9d8b3dd58 100644 --- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -60,6 +60,7 @@ 0F0B83B914BCF95F00885B4F /* CallReturnOffsetToBytecodeOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F15F15F14B7A73E005DE37D /* CommonSlowPaths.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F16D726142C39C000CF784A /* BitVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F16D724142C39A200CF784A /* BitVector.cpp */; }; + 0F21C26814BE5F6800ADC64B /* JITDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C26614BE5F5E00ADC64B /* JITDriver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F242DA713F3B1E8007ADD4C /* WeakReferenceHarvester.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F2C556F14738F3100121E4F /* DFGCodeBlocks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F2C557014738F3500121E4F /* DFGCodeBlocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */; }; @@ -70,6 +71,8 @@ 0F431738146BAC69007E3890 /* ListableHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F431736146BAC65007E3890 /* ListableHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F46808214BA572D00BFE272 /* JITExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F46808014BA572700BFE272 /* JITExceptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F46808314BA573100BFE272 /* JITExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F46807F14BA572700BFE272 /* JITExceptions.cpp */; }; + 0F55F0F414D1063900AC7649 /* AbstractPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F55F0F114D1063600AC7649 /* AbstractPC.cpp */; }; + 0F55F0F514D1063C00AC7649 /* AbstractPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F55F0F214D1063600AC7649 /* AbstractPC.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F5F08CF146C7633000472A9 /* UnconditionalFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620172143FCD2F0068B77C /* DFGVariableAccessData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F620175143FCD370068B77C /* DFGOperands.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620171143FCD2F0068B77C /* DFGOperands.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -79,6 +82,19 @@ 0F620179143FCD480068B77C /* DFGAbstractState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F62016D143FCD2F0068B77C /* DFGAbstractState.cpp */; }; 0F636DA0142D27D700B2E66A /* PackedIntVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F636D9F142D27D200B2E66A /* PackedIntVector.h */; }; 0F7700921402FF3C0078EB39 /* SamplingCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F7700911402FF280078EB39 /* SamplingCounter.cpp */; }; + 0F7B294A14C3CD29007C3DB1 /* DFGCCallHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7B294814C3CD23007C3DB1 /* DFGCCallHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 0F7B294B14C3CD2F007C3DB1 /* DFGCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82E1F14172C2F00179C94 /* DFGCapabilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 0F7B294C14C3CD43007C3DB1 /* DFGByteCodeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5F08CC146BE602000472A9 /* DFGByteCodeCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 0F7B294D14C3CD4C007C3DB1 /* DFGCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC0977E1469EBC400CF2442 /* DFGCommon.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 0F93329D14CA7DC30085F3C6 /* CallLinkStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329314CA7DC10085F3C6 /* CallLinkStatus.cpp */; }; + 0F93329E14CA7DC50085F3C6 /* CallLinkStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329414CA7DC10085F3C6 /* CallLinkStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 0F93329F14CA7DCA0085F3C6 /* GetByIdStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329514CA7DC10085F3C6 /* GetByIdStatus.cpp */; }; + 0F9332A014CA7DCD0085F3C6 /* GetByIdStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329614CA7DC10085F3C6 /* GetByIdStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 0F9332A114CA7DD10085F3C6 /* MethodCallLinkStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329714CA7DC10085F3C6 /* MethodCallLinkStatus.cpp */; }; + 0F9332A214CA7DD30085F3C6 /* MethodCallLinkStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329814CA7DC10085F3C6 /* MethodCallLinkStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329914CA7DC10085F3C6 /* PutByIdStatus.cpp */; }; + 0F9332A414CA7DD90085F3C6 /* PutByIdStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329A14CA7DC10085F3C6 /* PutByIdStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 0F9332A514CA7DDD0085F3C6 /* StructureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329B14CA7DC10085F3C6 /* StructureSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F963B2713F753BB0002D9B2 /* RedBlackTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B2613F753990002D9B2 /* RedBlackTree.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F963B2C13F853EC0002D9B2 /* MetaAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F963B2B13F853C70002D9B2 /* MetaAllocator.cpp */; settings = {COMPILER_FLAGS = "-fno-strict-aliasing"; }; }; 0F963B2D13F854020002D9B2 /* MetaAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B2A13F853BD0002D9B2 /* MetaAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -120,7 +136,6 @@ 0FD82F4B142806A100179C94 /* BitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82F491428069200179C94 /* BitVector.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0FE228ED1436AB2700196C48 /* Options.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE228EB1436AB2300196C48 /* Options.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0FE228EE1436AB2C00196C48 /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE228EA1436AB2300196C48 /* Options.cpp */; }; - 0FFF4BB4143955E900655BC0 /* DFGStructureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFF4BB2143955E600655BC0 /* DFGStructureSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1400067712A6F7830064D123 /* OSAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1400067612A6F7830064D123 /* OSAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1400069312A6F9E10064D123 /* OSAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1400069212A6F9E10064D123 /* OSAllocatorPosix.cpp */; }; 140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0894D50FAFBA2D00001865 /* JSAPIValueWrapper.cpp */; }; @@ -367,6 +382,8 @@ 86AE64AA135E5E1C00963012 /* SH4Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE64A7135E5E1C00963012 /* SH4Assembler.h */; }; 86AE6C4D136A11E400963012 /* DFGFPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE6C4B136A11E400963012 /* DFGFPRInfo.h */; }; 86AE6C4E136A11E400963012 /* DFGGPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE6C4C136A11E400963012 /* DFGGPRInfo.h */; }; + 86B5826714D2796C00A9C306 /* CodeProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86B5822E14D2373B00A9C306 /* CodeProfile.cpp */; }; + 86B5826914D2797000A9C306 /* CodeProfiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8603CEF214C7546400AE59E3 /* CodeProfiling.cpp */; }; 86B99AE3117E578100DF5A90 /* StringBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AE1117E578100DF5A90 /* StringBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86BB09C0138E381B0056702F /* DFGRepatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BB09BE138E381B0056702F /* DFGRepatch.cpp */; }; 86BB09C1138E381B0056702F /* DFGRepatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BB09BF138E381B0056702F /* DFGRepatch.h */; }; @@ -414,6 +431,7 @@ 90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 90213E3C123A40C200D422F3 /* MemoryStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; }; 905B02AE0E28640F006DF882 /* RefCountedLeakCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 905B02AD0E28640F006DF882 /* RefCountedLeakCounter.cpp */; }; 90D3469C0E285280009492EE /* RefCountedLeakCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 90D3469B0E285280009492EE /* RefCountedLeakCounter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 91A3905614C0F47200F67901 /* Uint8ClampedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 91A3905514C0F47200F67901 /* Uint8ClampedArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; 93052C340FB792190048FDC3 /* ParserArena.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93052C320FB792190048FDC3 /* ParserArena.cpp */; }; 93052C350FB792190048FDC3 /* ParserArena.h in Headers */ = {isa = PBXBuildFile; fileRef = 93052C330FB792190048FDC3 /* ParserArena.h */; settings = {ATTRIBUTES = (Private, ); }; }; 932F5BD30822A1C700736975 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; }; @@ -460,8 +478,6 @@ A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B3E11C7B228007A5315 /* RegExpCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; A1712B4111C7B235007A5315 /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; A1D764521354448B00C5C7C0 /* Alignment.h in Headers */ = {isa = PBXBuildFile; fileRef = A1D764511354448B00C5C7C0 /* Alignment.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A70456B01427FB910037DA68 /* AllocationSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = A70456AF1427FB150037DA68 /* AllocationSpace.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A70456B11427FB950037DA68 /* AllocationSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A70456AE1427FB030037DA68 /* AllocationSpace.cpp */; }; A71236E51195F33C00BD2174 /* JITOpcodes32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */; }; A72700900DAC6BBC00E548D7 /* JSNotAnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72700780DAC605600E548D7 /* JSNotAnObject.cpp */; }; A72701B90DADE94900E548D7 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; }; @@ -704,6 +720,12 @@ C22C531313FAF6EF00B7DC0D /* strtod.cc in Sources */ = {isa = PBXBuildFile; fileRef = C22C52B913FAF6EF00B7DC0D /* strtod.cc */; }; C22C531413FAF6EF00B7DC0D /* strtod.h in Headers */ = {isa = PBXBuildFile; fileRef = C22C52BA13FAF6EF00B7DC0D /* strtod.h */; settings = {ATTRIBUTES = (Private, ); }; }; C22C531513FAF6EF00B7DC0D /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = C22C52BB13FAF6EF00B7DC0D /* utils.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C240305514B404E60079EB64 /* BumpSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C240305314B404C90079EB64 /* BumpSpace.cpp */; }; + C2C8D02D14A3C6E000578E65 /* BumpSpaceInlineMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02B14A3C6B200578E65 /* BumpSpaceInlineMethods.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C2C8D03014A3CEFC00578E65 /* BumpBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02E14A3CEFC00578E65 /* BumpBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C2C8D03114A3CEFC00578E65 /* HeapBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02F14A3CEFC00578E65 /* HeapBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C2D9CA1314BCC04600304B46 /* CheckedBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = C2D9CA1214BCC04600304B46 /* CheckedBoolean.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C2EAA3FA149A835E00FCE112 /* BumpSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EAA3F8149A830800FCE112 /* BumpSpace.h */; settings = {ATTRIBUTES = (Private, ); }; }; C2EE59A013FC973F009CEAFE /* DecimalNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EE599E13FC972A009CEAFE /* DecimalNumber.h */; settings = {ATTRIBUTES = (Private, ); }; }; C2EE59A113FC9768009CEAFE /* DecimalNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2EE599D13FC972A009CEAFE /* DecimalNumber.cpp */; }; D7A46A4F1338FFEA00ED695C /* DynamicAnnotations.h in Headers */ = {isa = PBXBuildFile; fileRef = D75AF59612F8CB9500FC0ADF /* DynamicAnnotations.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -725,6 +747,8 @@ E49DC16D12EF295300184A1F /* SourceProviderCacheItem.h in Headers */ = {isa = PBXBuildFile; fileRef = E49DC14912EF261A00184A1F /* SourceProviderCacheItem.h */; settings = {ATTRIBUTES = (Private, ); }; }; E4D8CEFB12FC439600BC9F5A /* BloomFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D8CE9B12FC42E100BC9F5A /* BloomFilter.h */; settings = {ATTRIBUTES = (Private, ); }; }; F3BD31ED126735770065467F /* TextPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = F3BD31D0126730180065467F /* TextPosition.h */; settings = {ATTRIBUTES = (Private, ); }; }; + F69E86C314C6E551002C2C62 /* NumberOfCores.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F69E86C114C6E551002C2C62 /* NumberOfCores.cpp */; }; + F69E86C414C6E551002C2C62 /* NumberOfCores.h in Headers */ = {isa = PBXBuildFile; fileRef = F69E86C214C6E551002C2C62 /* NumberOfCores.h */; }; FDA15C1E12B0305C003A583A /* Complex.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA15C1612B03028003A583A /* Complex.h */; settings = {ATTRIBUTES = (Private, ); }; }; FE1B447A0ECCD73B004F4DD1 /* StdLibExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1B44790ECCD73B004F4DD1 /* StdLibExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; /* End PBXBuildFile section */ @@ -827,6 +851,7 @@ 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallReturnOffsetToBytecodeOffset.h; sourceTree = ""; }; 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonSlowPaths.h; sourceTree = ""; }; 0F16D724142C39A200CF784A /* BitVector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitVector.cpp; sourceTree = ""; }; + 0F21C26614BE5F5E00ADC64B /* JITDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITDriver.h; sourceTree = ""; }; 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakReferenceHarvester.h; sourceTree = ""; }; 0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DFGCodeBlocks.cpp; sourceTree = ""; }; 0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFGCodeBlocks.h; sourceTree = ""; }; @@ -837,6 +862,8 @@ 0F431736146BAC65007E3890 /* ListableHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListableHandler.h; sourceTree = ""; }; 0F46807F14BA572700BFE272 /* JITExceptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITExceptions.cpp; sourceTree = ""; }; 0F46808014BA572700BFE272 /* JITExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITExceptions.h; sourceTree = ""; }; + 0F55F0F114D1063600AC7649 /* AbstractPC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AbstractPC.cpp; sourceTree = ""; }; + 0F55F0F214D1063600AC7649 /* AbstractPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractPC.h; sourceTree = ""; }; 0F5F08CC146BE602000472A9 /* DFGByteCodeCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGByteCodeCache.h; path = dfg/DFGByteCodeCache.h; sourceTree = ""; }; 0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnconditionalFinalizer.h; sourceTree = ""; }; 0F62016D143FCD2F0068B77C /* DFGAbstractState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGAbstractState.cpp; path = dfg/DFGAbstractState.cpp; sourceTree = ""; }; @@ -848,6 +875,16 @@ 0F636D9F142D27D200B2E66A /* PackedIntVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PackedIntVector.h; sourceTree = ""; }; 0F77008E1402FDD60078EB39 /* SamplingCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SamplingCounter.h; sourceTree = ""; }; 0F7700911402FF280078EB39 /* SamplingCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SamplingCounter.cpp; sourceTree = ""; }; + 0F7B294814C3CD23007C3DB1 /* DFGCCallHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGCCallHelpers.h; path = dfg/DFGCCallHelpers.h; sourceTree = ""; }; + 0F93329314CA7DC10085F3C6 /* CallLinkStatus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallLinkStatus.cpp; sourceTree = ""; }; + 0F93329414CA7DC10085F3C6 /* CallLinkStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallLinkStatus.h; sourceTree = ""; }; + 0F93329514CA7DC10085F3C6 /* GetByIdStatus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetByIdStatus.cpp; sourceTree = ""; }; + 0F93329614CA7DC10085F3C6 /* GetByIdStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetByIdStatus.h; sourceTree = ""; }; + 0F93329714CA7DC10085F3C6 /* MethodCallLinkStatus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MethodCallLinkStatus.cpp; sourceTree = ""; }; + 0F93329814CA7DC10085F3C6 /* MethodCallLinkStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodCallLinkStatus.h; sourceTree = ""; }; + 0F93329914CA7DC10085F3C6 /* PutByIdStatus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PutByIdStatus.cpp; sourceTree = ""; }; + 0F93329A14CA7DC10085F3C6 /* PutByIdStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PutByIdStatus.h; sourceTree = ""; }; + 0F93329B14CA7DC10085F3C6 /* StructureSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureSet.h; sourceTree = ""; }; 0F963B2613F753990002D9B2 /* RedBlackTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RedBlackTree.h; sourceTree = ""; }; 0F963B2A13F853BD0002D9B2 /* MetaAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetaAllocator.h; sourceTree = ""; }; 0F963B2B13F853C70002D9B2 /* MetaAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MetaAllocator.cpp; sourceTree = ""; }; @@ -891,7 +928,6 @@ 0FD82F491428069200179C94 /* BitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitVector.h; sourceTree = ""; }; 0FE228EA1436AB2300196C48 /* Options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Options.cpp; sourceTree = ""; }; 0FE228EB1436AB2300196C48 /* Options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Options.h; sourceTree = ""; }; - 0FFF4BB2143955E600655BC0 /* DFGStructureSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStructureSet.h; path = dfg/DFGStructureSet.h; sourceTree = ""; }; 1400067612A6F7830064D123 /* OSAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSAllocator.h; sourceTree = ""; }; 1400069212A6F9E10064D123 /* OSAllocatorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSAllocatorPosix.cpp; sourceTree = ""; }; 140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBasePrivate.h; sourceTree = ""; }; @@ -1008,7 +1044,7 @@ 1A082778142168D70090CCAC /* BinarySemaphore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BinarySemaphore.h; sourceTree = ""; }; 1AA9E5501498093500001A8A /* Functional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Functional.h; sourceTree = ""; }; 1C9051420BA9E8A70081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = ""; }; - 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = JavaScriptCore.xcconfig; path = ../Configurations/JavaScriptCore.xcconfig; sourceTree = ""; }; + 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = JavaScriptCore.xcconfig; sourceTree = ""; }; 1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = ""; }; 1C9051450BA9E8A70081E9D0 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = ""; }; 1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScript.h; sourceTree = ""; }; @@ -1104,6 +1140,8 @@ 860161E00F3A83C100F84710 /* MacroAssemblerX86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86.h; sourceTree = ""; }; 860161E10F3A83C100F84710 /* MacroAssemblerX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86_64.h; sourceTree = ""; }; 860161E20F3A83C100F84710 /* MacroAssemblerX86Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86Common.h; sourceTree = ""; }; + 8603CEF214C7546400AE59E3 /* CodeProfiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CodeProfiling.cpp; sourceTree = ""; }; + 8603CEF314C7546400AE59E3 /* CodeProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeProfiling.h; sourceTree = ""; }; 8604F4F2143A6C4400B295F5 /* ChangeLog */ = {isa = PBXFileReference; lastKnownFileType = text; path = ChangeLog; sourceTree = ""; }; 8604F503143CE1C100B295F5 /* JSGlobalThis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalThis.h; sourceTree = ""; }; 8626BECE11928E3900782FAB /* StringStatics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringStatics.cpp; path = text/StringStatics.cpp; sourceTree = ""; }; @@ -1151,6 +1189,10 @@ 86AE64A7135E5E1C00963012 /* SH4Assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SH4Assembler.h; sourceTree = ""; }; 86AE6C4B136A11E400963012 /* DFGFPRInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGFPRInfo.h; path = dfg/DFGFPRInfo.h; sourceTree = ""; }; 86AE6C4C136A11E400963012 /* DFGGPRInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGGPRInfo.h; path = dfg/DFGGPRInfo.h; sourceTree = ""; }; + 86B5822C14D22F5F00A9C306 /* ProfileTreeNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProfileTreeNode.h; sourceTree = ""; }; + 86B5822E14D2373B00A9C306 /* CodeProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CodeProfile.cpp; sourceTree = ""; }; + 86B5822F14D2373B00A9C306 /* CodeProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeProfile.h; sourceTree = ""; }; + 86B5826A14D35D5100A9C306 /* TieredMMapArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TieredMMapArray.h; sourceTree = ""; }; 86B99AE1117E578100DF5A90 /* StringBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringBuffer.h; path = text/StringBuffer.h; sourceTree = ""; }; 86BB09BE138E381B0056702F /* DFGRepatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGRepatch.cpp; path = dfg/DFGRepatch.cpp; sourceTree = ""; }; 86BB09BF138E381B0056702F /* DFGRepatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGRepatch.h; path = dfg/DFGRepatch.h; sourceTree = ""; }; @@ -1199,6 +1241,7 @@ 90213E3C123A40C200D422F3 /* MemoryStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryStatistics.h; sourceTree = ""; }; 905B02AD0E28640F006DF882 /* RefCountedLeakCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RefCountedLeakCounter.cpp; sourceTree = ""; }; 90D3469B0E285280009492EE /* RefCountedLeakCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefCountedLeakCounter.h; sourceTree = ""; }; + 91A3905514C0F47200F67901 /* Uint8ClampedArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Uint8ClampedArray.h; sourceTree = ""; }; 9303F567099118FA00AD71B8 /* OwnPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnPtr.h; sourceTree = ""; }; 9303F5690991190000AD71B8 /* Noncopyable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Noncopyable.h; sourceTree = ""; }; 9303F5A409911A5800AD71B8 /* OwnArrayPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnArrayPtr.h; sourceTree = ""; }; @@ -1272,8 +1315,6 @@ A1712B3E11C7B228007A5315 /* RegExpCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCache.h; sourceTree = ""; }; A1712B4011C7B235007A5315 /* RegExpKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpKey.h; sourceTree = ""; }; A1D764511354448B00C5C7C0 /* Alignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Alignment.h; sourceTree = ""; }; - A70456AE1427FB030037DA68 /* AllocationSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AllocationSpace.cpp; sourceTree = ""; }; - A70456AF1427FB150037DA68 /* AllocationSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllocationSpace.h; sourceTree = ""; }; A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITOpcodes32_64.cpp; sourceTree = ""; }; A718F61A11754A21002465A7 /* RegExpJitTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpJitTables.h; sourceTree = ""; }; A718F8211178EB4B002465A7 /* create_regex_tables */ = {isa = PBXFileReference; explicitFileType = text.script.python; fileEncoding = 4; path = create_regex_tables; sourceTree = ""; }; @@ -1464,6 +1505,12 @@ C22C52B913FAF6EF00B7DC0D /* strtod.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strtod.cc; sourceTree = ""; }; C22C52BA13FAF6EF00B7DC0D /* strtod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strtod.h; sourceTree = ""; }; C22C52BB13FAF6EF00B7DC0D /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utils.h; sourceTree = ""; }; + C240305314B404C90079EB64 /* BumpSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BumpSpace.cpp; sourceTree = ""; }; + C2C8D02B14A3C6B200578E65 /* BumpSpaceInlineMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BumpSpaceInlineMethods.h; sourceTree = ""; }; + C2C8D02E14A3CEFC00578E65 /* BumpBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BumpBlock.h; sourceTree = ""; }; + C2C8D02F14A3CEFC00578E65 /* HeapBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapBlock.h; sourceTree = ""; }; + C2D9CA1214BCC04600304B46 /* CheckedBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckedBoolean.h; sourceTree = ""; }; + C2EAA3F8149A830800FCE112 /* BumpSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BumpSpace.h; sourceTree = ""; }; C2EE599D13FC972A009CEAFE /* DecimalNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DecimalNumber.cpp; sourceTree = ""; }; C2EE599E13FC972A009CEAFE /* DecimalNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DecimalNumber.h; sourceTree = ""; }; D21202280AD4310C00ED79B6 /* DateConversion.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DateConversion.cpp; sourceTree = ""; }; @@ -1533,6 +1580,8 @@ F692A8850255597D01FF60F7 /* UString.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UString.cpp; sourceTree = ""; tabWidth = 8; }; F692A8860255597D01FF60F7 /* UString.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = UString.h; sourceTree = ""; tabWidth = 8; }; F692A8870255597D01FF60F7 /* JSValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSValue.cpp; sourceTree = ""; tabWidth = 8; }; + F69E86C114C6E551002C2C62 /* NumberOfCores.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NumberOfCores.cpp; path = wtf/NumberOfCores.cpp; sourceTree = ""; }; + F69E86C214C6E551002C2C62 /* NumberOfCores.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NumberOfCores.h; path = wtf/NumberOfCores.h; sourceTree = ""; }; FDA15C1612B03028003A583A /* Complex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Complex.h; sourceTree = ""; }; FE1B44790ECCD73B004F4DD1 /* StdLibExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StdLibExtras.h; sourceTree = ""; }; /* End PBXFileReference section */ @@ -1613,6 +1662,8 @@ 0867D691FE84028FC02AAC07 /* JavaScriptCore */ = { isa = PBXGroup; children = ( + F69E86C114C6E551002C2C62 /* NumberOfCores.cpp */, + F69E86C214C6E551002C2C62 /* NumberOfCores.h */, 8604F4F2143A6C4400B295F5 /* ChangeLog */, A718F8211178EB4B002465A7 /* create_regex_tables */, 937B63CC09E766D200A671DD /* DerivedSources.make */, @@ -1637,6 +1688,7 @@ 95AB831A0DA42C6900BC83F3 /* profiler */, 7EF6E0BB0EB7A1EC0079AFAF /* runtime */, 141211000A48772600480255 /* tests */, + 8603CEF014C753EF00AE59E3 /* tools */, 65162EF108E6A21C007556CD /* wtf */, 86EAC48C0F93E8B9008EC948 /* yarr */, 1C90513E0BA9E8830081E9D0 /* Configurations */, @@ -1678,6 +1730,8 @@ 1429D77A0ED20D7300B89619 /* interpreter */ = { isa = PBXGroup; children = ( + 0F55F0F114D1063600AC7649 /* AbstractPC.cpp */, + 0F55F0F214D1063600AC7649 /* AbstractPC.h */, A7F8690E0F9584A100558697 /* CachedCall.h */, 1429D8DB0ED2205B00B89619 /* CallFrame.cpp */, 1429D8DC0ED2205B00B89619 /* CallFrame.h */, @@ -1707,6 +1761,7 @@ 86CC85A20EE79B7400288682 /* JITCall.cpp */, 146FE51111A710430087AE66 /* JITCall32_64.cpp */, 86CCEFDD0F413F8900FD7F9E /* JITCode.h */, + 0F21C26614BE5F5E00ADC64B /* JITDriver.h */, 86CC85A00EE79A4700288682 /* JITInlineMethods.h */, BCDD51E90FB8DF74004A8BDC /* JITOpcodes.cpp */, A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */, @@ -1727,8 +1782,10 @@ 142E312A134FF0A600AFADB5 /* heap */ = { isa = PBXGroup; children = ( - A70456AE1427FB030037DA68 /* AllocationSpace.cpp */, - A70456AF1427FB150037DA68 /* AllocationSpace.h */, + C2C8D02E14A3CEFC00578E65 /* BumpBlock.h */, + C240305314B404C90079EB64 /* BumpSpace.cpp */, + C2EAA3F8149A830800FCE112 /* BumpSpace.h */, + C2C8D02B14A3C6B200578E65 /* BumpSpaceInlineMethods.h */, A7521E121429169A003C8D0C /* CardSet.h */, 146B14DB12EB5B12001BEC1B /* ConservativeRoots.cpp */, 149DAAF212EB559D0083B12B /* ConservativeRoots.h */, @@ -1742,6 +1799,7 @@ 146FA5A81378F6B0003627A3 /* HandleTypes.h */, 14BA7A9513AADFF8005B7C2C /* Heap.cpp */, 14BA7A9613AADFF8005B7C2C /* Heap.h */, + C2C8D02F14A3CEFC00578E65 /* HeapBlock.h */, 14F97446138C853E00DA1C67 /* HeapRootVisitor.h */, 0F431736146BAC65007E3890 /* ListableHandler.h */, 142E3130134FF0A600AFADB5 /* Local.h */, @@ -1777,7 +1835,6 @@ 865F408710E7D56300947361 /* APIShims.h */, 1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */, 1CAA8B4B0D32C39A0041BCFF /* JavaScriptCore.h */, - 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */, BC0894D50FAFBA2D00001865 /* JSAPIValueWrapper.cpp */, BC0894D60FAFBA2D00001865 /* JSAPIValueWrapper.h */, 1421359A0A677F4F00A8195E /* JSBase.cpp */, @@ -1867,6 +1924,7 @@ 1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */, 449097EE0F8F81B50076A327 /* FeatureDefines.xcconfig */, 5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */, + 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */, BC021BF2136900C300FC5467 /* TestAPI.xcconfig */, 5DAFD6CC146B68B900FBEFB4 /* TestRegExp.xcconfig */, 1C9051420BA9E8A70081E9D0 /* Version.xcconfig */, @@ -2057,6 +2115,7 @@ A73BE165148420520091204B /* Uint16Array.h */, A73BE167148420520091204B /* Uint32Array.h */, A73BE163148420520091204B /* Uint8Array.h */, + 91A3905514C0F47200F67901 /* Uint8ClampedArray.h */, E195678D09E7CF1200B89D13 /* unicode */, 0FD52AAC1430359D0026DC9F /* UnionFind.h */, 935AF46B09E9D9DB00ACD1D8 /* UnusedParam.h */, @@ -2066,6 +2125,7 @@ 96DD73780F9DA3100027FBCC /* VMTags.h */, 86D08D5111793613006E5ED0 /* WTFThreadData.cpp */, 86D08D5211793613006E5ED0 /* WTFThreadData.h */, + C2D9CA1214BCC04600304B46 /* CheckedBoolean.h */, ); path = wtf; sourceTree = ""; @@ -2314,6 +2374,19 @@ path = runtime; sourceTree = ""; }; + 8603CEF014C753EF00AE59E3 /* tools */ = { + isa = PBXGroup; + children = ( + 86B5822E14D2373B00A9C306 /* CodeProfile.cpp */, + 86B5822F14D2373B00A9C306 /* CodeProfile.h */, + 8603CEF214C7546400AE59E3 /* CodeProfiling.cpp */, + 8603CEF314C7546400AE59E3 /* CodeProfiling.h */, + 86B5822C14D22F5F00A9C306 /* ProfileTreeNode.h */, + 86B5826A14D35D5100A9C306 /* TieredMMapArray.h */, + ); + path = tools; + sourceTree = ""; + }; 8656573E115BE35200291F40 /* text */ = { isa = PBXGroup; children = ( @@ -2369,6 +2442,7 @@ 0F5F08CC146BE602000472A9 /* DFGByteCodeCache.h */, 86EC9DB41328DF82002B2AD7 /* DFGByteCodeParser.cpp */, 86EC9DB51328DF82002B2AD7 /* DFGByteCodeParser.h */, + 0F7B294814C3CD23007C3DB1 /* DFGCCallHelpers.h */, 0FD82E1E14172C2F00179C94 /* DFGCapabilities.cpp */, 0FD82E1F14172C2F00179C94 /* DFGCapabilities.h */, 0FC0977E1469EBC400CF2442 /* DFGCommon.h */, @@ -2405,7 +2479,6 @@ 86EC9DC31328DF82002B2AD7 /* DFGSpeculativeJIT.h */, 86880F1B14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp */, 86880F4C14353B2100B08D42 /* DFGSpeculativeJIT64.cpp */, - 0FFF4BB2143955E600655BC0 /* DFGStructureSet.h */, 0FC0979F146B28C700CF2442 /* DFGThunks.cpp */, 0FC097A0146B28C700CF2442 /* DFGThunks.h */, 0F620172143FCD2F0068B77C /* DFGVariableAccessData.h */, @@ -2474,6 +2547,15 @@ 969A078F0ED1D3AE00F1F681 /* bytecode */ = { isa = PBXGroup; children = ( + 0F93329314CA7DC10085F3C6 /* CallLinkStatus.cpp */, + 0F93329414CA7DC10085F3C6 /* CallLinkStatus.h */, + 0F93329514CA7DC10085F3C6 /* GetByIdStatus.cpp */, + 0F93329614CA7DC10085F3C6 /* GetByIdStatus.h */, + 0F93329714CA7DC10085F3C6 /* MethodCallLinkStatus.cpp */, + 0F93329814CA7DC10085F3C6 /* MethodCallLinkStatus.h */, + 0F93329914CA7DC10085F3C6 /* PutByIdStatus.cpp */, + 0F93329A14CA7DC10085F3C6 /* PutByIdStatus.h */, + 0F93329B14CA7DC10085F3C6 /* StructureSet.h */, 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */, 0F0B83B614BCF8DF00885B4F /* GlobalResolveInfo.h */, 0F0B83B214BCF85E00885B4F /* MethodCallLinkInfo.cpp */, @@ -2586,7 +2668,6 @@ files = ( 860161E30F3A83C100F84710 /* AbstractMacroAssembler.h in Headers */, A1D764521354448B00C5C7C0 /* Alignment.h in Headers */, - A70456B01427FB910037DA68 /* AllocationSpace.h in Headers */, BC18C3E40E16F5CD00B34460 /* AlwaysInline.h in Headers */, BC18C3E50E16F5CD00B34460 /* APICast.h in Headers */, 865F408810E7D56300947361 /* APIShims.h in Headers */, @@ -2595,6 +2676,7 @@ 86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */, 86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */, A73BE169148420520091204B /* ArrayBuffer.h in Headers */, + C2D9CA1314BCC04600304B46 /* CheckedBoolean.h in Headers */, A73BE16B148420520091204B /* ArrayBufferView.h in Headers */, BC18C3E60E16F5CD00B34460 /* ArrayConstructor.h in Headers */, BC18C3E70E16F5CD00B34460 /* ArrayPrototype.h in Headers */, @@ -2621,7 +2703,10 @@ E4D8CEFB12FC439600BC9F5A /* BloomFilter.h in Headers */, BC18C3EC0E16F5CD00B34460 /* BooleanObject.h in Headers */, 0FD82E85141F3FE300179C94 /* BoundsCheckedPointer.h in Headers */, + C2C8D03014A3CEFC00578E65 /* BumpBlock.h in Headers */, 86676D5211FED9BC004B6863 /* BumpPointerAllocator.h in Headers */, + C2EAA3FA149A835E00FCE112 /* BumpSpace.h in Headers */, + C2C8D02D14A3C6E000578E65 /* BumpSpaceInlineMethods.h in Headers */, A7A1F7AD0F252B3C00E184E2 /* ByteArray.h in Headers */, 969A07230ED1CE3300F1F681 /* BytecodeGenerator.h in Headers */, C22C52F613FAF6EF00B7DC0D /* cached-powers.h in Headers */, @@ -2688,7 +2773,6 @@ 86BB09C1138E381B0056702F /* DFGRepatch.h in Headers */, 86ECA3FA132DF25A002B2AD7 /* DFGScoreBoard.h in Headers */, 86EC9DD31328DF82002B2AD7 /* DFGSpeculativeJIT.h in Headers */, - 0FFF4BB4143955E900655BC0 /* DFGStructureSet.h in Headers */, 0FC097A2146B28CC00CF2442 /* DFGThunks.h in Headers */, 0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */, BC18C3FD0E16F5CD00B34460 /* DisallowCType.h in Headers */, @@ -2733,6 +2817,7 @@ BC18C40D0E16F5CD00B34460 /* HashTable.h in Headers */, BC18C40E0E16F5CD00B34460 /* HashTraits.h in Headers */, 14BA7A9813AADFF8005B7C2C /* Heap.h in Headers */, + C2C8D03114A3CEFC00578E65 /* HeapBlock.h in Headers */, 14F97447138C853E00DA1C67 /* HeapRootVisitor.h in Headers */, 7186A6EC13100BA5004479E1 /* HexNumber.h in Headers */, BC18C40F0E16F5CD00B34460 /* Identifier.h in Headers */, @@ -3021,6 +3106,19 @@ 0F0B83B514BCF86200885B4F /* MethodCallLinkInfo.h in Headers */, 0F0B83B714BCF8E100885B4F /* GlobalResolveInfo.h in Headers */, 0F0B83B914BCF95F00885B4F /* CallReturnOffsetToBytecodeOffset.h in Headers */, + 0F21C26814BE5F6800ADC64B /* JITDriver.h in Headers */, + 0F7B294A14C3CD29007C3DB1 /* DFGCCallHelpers.h in Headers */, + 0F7B294B14C3CD2F007C3DB1 /* DFGCapabilities.h in Headers */, + 0F7B294C14C3CD43007C3DB1 /* DFGByteCodeCache.h in Headers */, + 0F7B294D14C3CD4C007C3DB1 /* DFGCommon.h in Headers */, + 91A3905614C0F47200F67901 /* Uint8ClampedArray.h in Headers */, + F69E86C414C6E551002C2C62 /* NumberOfCores.h in Headers */, + 0F93329E14CA7DC50085F3C6 /* CallLinkStatus.h in Headers */, + 0F9332A014CA7DCD0085F3C6 /* GetByIdStatus.h in Headers */, + 0F9332A214CA7DD30085F3C6 /* MethodCallLinkStatus.h in Headers */, + 0F9332A414CA7DD90085F3C6 /* PutByIdStatus.h in Headers */, + 0F9332A514CA7DDD0085F3C6 /* StructureSet.h in Headers */, + 0F55F0F514D1063C00AC7649 /* AbstractPC.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3330,7 +3428,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - A70456B11427FB950037DA68 /* AllocationSpace.cpp in Sources */, 147F39BD107EC37600427A48 /* ArgList.cpp in Sources */, 147F39BE107EC37600427A48 /* Arguments.cpp in Sources */, 86D3B2C310156BDE002865E7 /* ARMAssembler.cpp in Sources */, @@ -3348,6 +3445,7 @@ 14280863107EC11A0013E7B2 /* BooleanConstructor.cpp in Sources */, 14280864107EC11A0013E7B2 /* BooleanObject.cpp in Sources */, 14280865107EC11A0013E7B2 /* BooleanPrototype.cpp in Sources */, + C240305514B404E60079EB64 /* BumpSpace.cpp in Sources */, A7A1F7AC0F252B3C00E184E2 /* ByteArray.cpp in Sources */, 148F21AA107EC53A0042EC2C /* BytecodeGenerator.cpp in Sources */, C22C52F513FAF6EF00B7DC0D /* cached-powers.cc in Sources */, @@ -3558,6 +3656,14 @@ 0F46808314BA573100BFE272 /* JITExceptions.cpp in Sources */, 0F0B83B014BCF71600885B4F /* CallLinkInfo.cpp in Sources */, 0F0B83B414BCF86000885B4F /* MethodCallLinkInfo.cpp in Sources */, + F69E86C314C6E551002C2C62 /* NumberOfCores.cpp in Sources */, + 0F93329D14CA7DC30085F3C6 /* CallLinkStatus.cpp in Sources */, + 0F93329F14CA7DCA0085F3C6 /* GetByIdStatus.cpp in Sources */, + 0F9332A114CA7DD10085F3C6 /* MethodCallLinkStatus.cpp in Sources */, + 0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */, + 0F55F0F414D1063900AC7649 /* AbstractPC.cpp in Sources */, + 86B5826714D2796C00A9C306 /* CodeProfile.cpp in Sources */, + 86B5826914D2797000A9C306 /* CodeProfiling.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Source/JavaScriptCore/Target.pri b/Source/JavaScriptCore/Target.pri index 6ea82d102..c61fb37f1 100644 --- a/Source/JavaScriptCore/Target.pri +++ b/Source/JavaScriptCore/Target.pri @@ -50,18 +50,22 @@ SOURCES += \ assembler/MacroAssemblerARM.cpp \ assembler/MacroAssemblerSH4.cpp \ bytecode/CallLinkInfo.cpp \ + bytecode/CallLinkStatus.cpp \ bytecode/CodeBlock.cpp \ bytecode/DFGExitProfile.cpp \ + bytecode/GetByIdStatus.cpp \ bytecode/JumpTable.cpp \ bytecode/MethodCallLinkInfo.cpp \ + bytecode/MethodCallLinkStatus.cpp \ bytecode/Opcode.cpp \ bytecode/PredictedType.cpp \ + bytecode/PutByIdStatus.cpp \ bytecode/SamplingTool.cpp \ bytecode/StructureStubInfo.cpp \ bytecode/ValueProfile.cpp \ bytecompiler/BytecodeGenerator.cpp \ bytecompiler/NodesCodegen.cpp \ - heap/AllocationSpace.cpp \ + heap/BumpSpace.cpp \ heap/ConservativeRoots.cpp \ heap/DFGCodeBlocks.cpp \ heap/HandleHeap.cpp \ @@ -96,6 +100,7 @@ SOURCES += \ dfg/DFGSpeculativeJIT32_64.cpp \ dfg/DFGSpeculativeJIT64.cpp \ dfg/DFGThunks.cpp \ + interpreter/AbstractPC.cpp \ interpreter/CallFrame.cpp \ interpreter/Interpreter.cpp \ interpreter/RegisterFile.cpp \ @@ -204,6 +209,8 @@ SOURCES += \ runtime/Structure.cpp \ runtime/TimeoutChecker.cpp \ runtime/UString.cpp \ + tools/CodeProfile.cpp \ + tools/CodeProfiling.cpp \ yarr/YarrJIT.cpp \ *sh4* { diff --git a/Source/JavaScriptCore/assembler/ARMAssembler.cpp b/Source/JavaScriptCore/assembler/ARMAssembler.cpp index 9e6c5e5fc..4ded0e88e 100644 --- a/Source/JavaScriptCore/assembler/ARMAssembler.cpp +++ b/Source/JavaScriptCore/assembler/ARMAssembler.cpp @@ -344,14 +344,14 @@ void ARMAssembler::doubleTransfer(bool isLoad, FPRegisterID srcDst, RegisterID b fdtr_u(isLoad, srcDst, ARMRegisters::S0, 0); } -PassRefPtr ARMAssembler::executableCopy(JSGlobalData& globalData) +PassRefPtr ARMAssembler::executableCopy(JSGlobalData& globalData, void* ownerUID) { // 64-bit alignment is required for next constant pool and JIT code as well m_buffer.flushWithoutBarrier(true); if (!m_buffer.isAligned(8)) bkpt(0); - RefPtr result = m_buffer.executableCopy(globalData); + RefPtr result = m_buffer.executableCopy(globalData, ownerUID); char* data = reinterpret_cast(result->start()); for (Jumps::Iterator iter = m_jumps.begin(); iter != m_jumps.end(); ++iter) { diff --git a/Source/JavaScriptCore/assembler/ARMAssembler.h b/Source/JavaScriptCore/assembler/ARMAssembler.h index 5792d2c0f..a659eefee 100644 --- a/Source/JavaScriptCore/assembler/ARMAssembler.h +++ b/Source/JavaScriptCore/assembler/ARMAssembler.h @@ -679,7 +679,7 @@ namespace JSC { return loadBranchTarget(ARMRegisters::pc, cc, useConstantPool); } - PassRefPtr executableCopy(JSGlobalData&); + PassRefPtr executableCopy(JSGlobalData&, void* ownerUID); #ifndef NDEBUG unsigned debugOffset() { return m_buffer.debugOffset(); } diff --git a/Source/JavaScriptCore/assembler/ARMv7Assembler.h b/Source/JavaScriptCore/assembler/ARMv7Assembler.h index 530ae0d0b..0b83776df 100644 --- a/Source/JavaScriptCore/assembler/ARMv7Assembler.h +++ b/Source/JavaScriptCore/assembler/ARMv7Assembler.h @@ -414,11 +414,6 @@ private: class ARMv7Assembler { public: - ~ARMv7Assembler() - { - ASSERT(m_jumpsToLink.isEmpty()); - } - typedef ARMRegisters::RegisterID RegisterID; typedef ARMRegisters::FPSingleRegisterID FPSingleRegisterID; typedef ARMRegisters::FPDoubleRegisterID FPDoubleRegisterID; diff --git a/Source/JavaScriptCore/assembler/AssemblerBuffer.h b/Source/JavaScriptCore/assembler/AssemblerBuffer.h index 498dd09ac..c6e0a1003 100644 --- a/Source/JavaScriptCore/assembler/AssemblerBuffer.h +++ b/Source/JavaScriptCore/assembler/AssemblerBuffer.h @@ -129,12 +129,12 @@ namespace JSC { return AssemblerLabel(m_index); } - PassRefPtr executableCopy(JSGlobalData& globalData) + PassRefPtr executableCopy(JSGlobalData& globalData, void* ownerUID) { if (!m_index) return 0; - RefPtr result = globalData.executableAllocator.allocate(globalData, m_index); + RefPtr result = globalData.executableAllocator.allocate(globalData, m_index, ownerUID); if (!result) return 0; diff --git a/Source/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h b/Source/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h index 0287d4829..68afa766b 100644 --- a/Source/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h +++ b/Source/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h @@ -195,10 +195,10 @@ public: putIntegralUnchecked(value.low); } - PassRefPtr executableCopy(JSGlobalData& globalData) + PassRefPtr executableCopy(JSGlobalData& globalData, void* ownerUID) { flushConstantPool(false); - return AssemblerBuffer::executableCopy(globalData); + return AssemblerBuffer::executableCopy(globalData, ownerUID); } void putShortWithConstantInt(uint16_t insn, uint32_t constant, bool isReusable = false) diff --git a/Source/JavaScriptCore/assembler/LinkBuffer.h b/Source/JavaScriptCore/assembler/LinkBuffer.h index 1be8af217..e8047e100 100644 --- a/Source/JavaScriptCore/assembler/LinkBuffer.h +++ b/Source/JavaScriptCore/assembler/LinkBuffer.h @@ -31,6 +31,9 @@ #define DUMP_LINK_STATISTICS 0 #define DUMP_CODE 0 +#define GLOBAL_THUNK_ID reinterpret_cast(static_cast(-1)) +#define REGEXP_CODE_ID reinterpret_cast(static_cast(-2)) + #include #include @@ -69,7 +72,7 @@ class LinkBuffer { #endif public: - LinkBuffer(JSGlobalData& globalData, MacroAssembler* masm) + LinkBuffer(JSGlobalData& globalData, MacroAssembler* masm, void* ownerUID) : m_size(0) , m_code(0) , m_assembler(masm) @@ -78,7 +81,7 @@ public: , m_completed(false) #endif { - linkCode(); + linkCode(ownerUID); } ~LinkBuffer() @@ -173,10 +176,7 @@ public: return applyOffset(label.m_label).m_offset; } - // Upon completion of all patching either 'finalizeCode()' or 'finalizeCodeAddendum()' should be called - // once to complete generation of the code. 'finalizeCode()' is suited to situations - // where the executable pool must also be retained, the lighter-weight 'finalizeCodeAddendum()' is - // suited to adding to an existing allocation. + // Upon completion of all patching 'finalizeCode()' should be called once to complete generation of the code. CodeRef finalizeCode() { performFinalization(); @@ -210,18 +210,17 @@ private: return src; } - // Keep this private! - the underlying code should only be obtained externally via - // finalizeCode() or finalizeCodeAddendum(). + // Keep this private! - the underlying code should only be obtained externally via finalizeCode(). void* code() { return m_code; } - void linkCode() + void linkCode(void* ownerUID) { ASSERT(!m_code); #if !ENABLE(BRANCH_COMPACTION) - m_executableMemory = m_assembler->m_assembler.executableCopy(*m_globalData); + m_executableMemory = m_assembler->m_assembler.executableCopy(*m_globalData, ownerUID); if (!m_executableMemory) return; m_code = m_executableMemory->start(); @@ -229,7 +228,7 @@ private: ASSERT(m_code); #else size_t initialSize = m_assembler->m_assembler.codeSize(); - m_executableMemory = m_globalData->executableAllocator.allocate(*m_globalData, initialSize); + m_executableMemory = m_globalData->executableAllocator.allocate(*m_globalData, initialSize, ownerUID); if (!m_executableMemory) return; m_code = (uint8_t*)m_executableMemory->start(); diff --git a/Source/JavaScriptCore/assembler/MIPSAssembler.h b/Source/JavaScriptCore/assembler/MIPSAssembler.h index da91a14f1..4471c1303 100644 --- a/Source/JavaScriptCore/assembler/MIPSAssembler.h +++ b/Source/JavaScriptCore/assembler/MIPSAssembler.h @@ -645,9 +645,9 @@ public: return m_buffer.codeSize(); } - PassRefPtr executableCopy(JSGlobalData& globalData) + PassRefPtr executableCopy(JSGlobalData& globalData, void* ownerUID) { - RefPtr result = m_buffer.executableCopy(globalData); + RefPtr result = m_buffer.executableCopy(globalData, ownerUID); if (!result) return 0; diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h b/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h index 82e8c4151..c59d1514a 100644 --- a/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h +++ b/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h @@ -52,7 +52,7 @@ #define ASSERT_VALID_CODE_OFFSET(offset) // Anything goes! #endif -#if CPU(X86) && OS(WIN) +#if CPU(X86) && OS(WINDOWS) #define CALLING_CONVENTION_IS_STDCALL 1 #ifndef CDECL #if COMPILER(MSVC) @@ -126,7 +126,9 @@ public: ASSERT_VALID_CODE_POINTER(m_value); } -#if CALLING_CONVENTION_IS_STDCALL +// MSVC doesn't seem to treat functions with different calling conventions as +// different types; these methods already defined for fastcall, below. +#if CALLING_CONVENTION_IS_STDCALL && !OS(WINDOWS) template FunctionPtr(returnType (CDECL *value)()) diff --git a/Source/JavaScriptCore/assembler/SH4Assembler.h b/Source/JavaScriptCore/assembler/SH4Assembler.h index 90e232a63..0709588a5 100644 --- a/Source/JavaScriptCore/assembler/SH4Assembler.h +++ b/Source/JavaScriptCore/assembler/SH4Assembler.h @@ -1513,9 +1513,9 @@ public: return reinterpret_cast(readPCrelativeAddress((*instructionPtr & 0xff), instructionPtr)); } - PassRefPtr executableCopy(JSGlobalData& globalData) + PassRefPtr executableCopy(JSGlobalData& globalData, void* ownerUID) { - return m_buffer.executableCopy(globalData); + return m_buffer.executableCopy(globalData, ownerUID); } void prefix(uint16_t pre) diff --git a/Source/JavaScriptCore/assembler/X86Assembler.h b/Source/JavaScriptCore/assembler/X86Assembler.h index cd1921819..3b9e122cd 100644 --- a/Source/JavaScriptCore/assembler/X86Assembler.h +++ b/Source/JavaScriptCore/assembler/X86Assembler.h @@ -1782,9 +1782,9 @@ public: return b.m_offset - a.m_offset; } - PassRefPtr executableCopy(JSGlobalData& globalData) + PassRefPtr executableCopy(JSGlobalData& globalData, void* ownerUID) { - return m_formatter.executableCopy(globalData); + return m_formatter.executableCopy(globalData, ownerUID); } #ifndef NDEBUG @@ -2132,9 +2132,9 @@ private: bool isAligned(int alignment) const { return m_buffer.isAligned(alignment); } void* data() const { return m_buffer.data(); } - PassRefPtr executableCopy(JSGlobalData& globalData) + PassRefPtr executableCopy(JSGlobalData& globalData, void* ownerUID) { - return m_buffer.executableCopy(globalData); + return m_buffer.executableCopy(globalData, ownerUID); } #ifndef NDEBUG diff --git a/Source/JavaScriptCore/bytecode/CallLinkInfo.h b/Source/JavaScriptCore/bytecode/CallLinkInfo.h index 8ec48e4e1..44d50a971 100644 --- a/Source/JavaScriptCore/bytecode/CallLinkInfo.h +++ b/Source/JavaScriptCore/bytecode/CallLinkInfo.h @@ -72,7 +72,7 @@ struct CallLinkInfo : public BasicRawSentinelNode { WriteBarrier lastSeenCallee; bool hasSeenShouldRepatch : 1; bool isDFG : 1; - CallType callType : 2; + CallType callType : 6; unsigned bytecodeIndex; bool isLinked() { return callee; } diff --git a/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp b/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp new file mode 100644 index 000000000..f3fd5bb27 --- /dev/null +++ b/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp @@ -0,0 +1,47 @@ +/* + * 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 "config.h" +#include "CallLinkStatus.h" + +#include "CodeBlock.h" + +namespace JSC { + +CallLinkStatus CallLinkStatus::computeFor(CodeBlock* profiledBlock, unsigned bytecodeIndex) +{ + UNUSED_PARAM(profiledBlock); + UNUSED_PARAM(bytecodeIndex); +#if ENABLE(JIT) && ENABLE(VALUE_PROFILER) + return CallLinkStatus( + profiledBlock->getCallLinkInfo(bytecodeIndex).lastSeenCallee.get(), + profiledBlock->couldTakeSlowCase(bytecodeIndex)); +#else + return CallLinkStatus(0, false); +#endif +} + +} // namespace JSC + diff --git a/Source/JavaScriptCore/bytecode/CallLinkStatus.h b/Source/JavaScriptCore/bytecode/CallLinkStatus.h new file mode 100644 index 000000000..e1c741016 --- /dev/null +++ b/Source/JavaScriptCore/bytecode/CallLinkStatus.h @@ -0,0 +1,66 @@ +/* + * 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. + */ + +#ifndef CallLinkStatus_h +#define CallLinkStatus_h + +namespace JSC { + +class JSFunction; +class CodeBlock; + +class CallLinkStatus { +public: + CallLinkStatus() + : m_callTarget(0) + , m_couldTakeSlowPath(false) + { + } + + CallLinkStatus(JSFunction* callTarget, bool couldTakeSlowPath) + : m_callTarget(callTarget) + , m_couldTakeSlowPath(couldTakeSlowPath) + { + } + + static CallLinkStatus computeFor(CodeBlock*, unsigned bytecodeIndex); + + bool isSet() const { return !!m_callTarget; } + + bool operator!() const { return !m_callTarget; } + + bool couldTakeSlowPath() const { return m_couldTakeSlowPath; } + + JSFunction* callTarget() const { return m_callTarget; } + +private: + JSFunction* m_callTarget; + bool m_couldTakeSlowPath; +}; + +} // namespace JSC + +#endif // CallLinkStatus_h + diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp index 47745268c..4a953266e 100644 --- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp @@ -78,7 +78,7 @@ static UString valueToSourceString(ExecState* exec, JSValue val) return "0"; if (val.isString()) - return makeUString("\"", escapeQuotes(val.toString(exec)), "\""); + return makeUString("\"", escapeQuotes(val.toString(exec)->value(exec)), "\""); return val.description(); } @@ -180,7 +180,16 @@ void CodeBlock::printGetByIdOp(ExecState* exec, int location, Vectoru.operand; int id0 = (++it)->u.operand; printf("[%4d] %s\t %s, %s, %s\n", location, op, registerName(exec, r0).data(), registerName(exec, r1).data(), idName(id0, m_identifiers[id0]).data()); - it += 4; + it += 5; +} + +void CodeBlock::printCallOp(ExecState* exec, int location, Vector::const_iterator& it, const char* op) const +{ + int func = (++it)->u.operand; + int argCount = (++it)->u.operand; + int registerOffset = (++it)->u.operand; + printf("[%4d] %s\t %s, %d, %d\n", location, op, registerName(exec, func).data(), argCount, registerOffset); + it += 2; } void CodeBlock::printPutByIdOp(ExecState* exec, int location, Vector::const_iterator& it, const char* op) const @@ -522,7 +531,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& } case op_convert_this: { int r0 = (++it)->u.operand; - printf("[%4d] convert_this %s\n", location, registerName(exec, r0).data()); + printf("[%4d] convert_this\t %s\n", location, registerName(exec, r0).data()); break; } case op_new_object: { @@ -734,6 +743,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int r0 = (++it)->u.operand; int id0 = (++it)->u.operand; printf("[%4d] resolve\t\t %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data()); + it++; break; } case op_resolve_skip: { @@ -741,13 +751,14 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int id0 = (++it)->u.operand; int skipLevels = (++it)->u.operand; printf("[%4d] resolve_skip\t %s, %s, %d\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), skipLevels); + it++; break; } case op_resolve_global: { int r0 = (++it)->u.operand; int id0 = (++it)->u.operand; printf("[%4d] resolve_global\t %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data()); - it += 2; + it += 3; break; } case op_resolve_global_dynamic: { @@ -757,6 +768,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& ++it; int depth = (++it)->u.operand; printf("[%4d] resolve_global_dynamic\t %s, %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), idName(id0, m_identifiers[id0]).data(), depth); + ++it; break; } case op_get_scoped_var: { @@ -764,6 +776,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int index = (++it)->u.operand; int skipLevels = (++it)->u.operand; printf("[%4d] get_scoped_var\t %s, %d, %d\n", location, registerName(exec, r0).data(), index, skipLevels); + it++; break; } case op_put_scoped_var: { @@ -777,6 +790,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int r0 = (++it)->u.operand; int index = (++it)->u.operand; printf("[%4d] get_global_var\t %s, %d\n", location, registerName(exec, r0).data(), index); + it++; break; } case op_put_global_var: { @@ -790,6 +804,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int id0 = (++it)->u.operand; int isStrict = (++it)->u.operand; printf("[%4d] resolve_base%s\t %s, %s\n", location, isStrict ? "_strict" : "", registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data()); + it++; break; } case op_ensure_property_exists: { @@ -803,6 +818,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int r1 = (++it)->u.operand; int id0 = (++it)->u.operand; printf("[%4d] resolve_with_base %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), idName(id0, m_identifiers[id0]).data()); + it++; break; } case op_resolve_with_this: { @@ -810,6 +826,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int r1 = (++it)->u.operand; int id0 = (++it)->u.operand; printf("[%4d] resolve_with_this %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), idName(id0, m_identifiers[id0]).data()); + it++; break; } case op_get_by_id: { @@ -885,18 +902,12 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& printPutByIdOp(exec, location, it, "put_by_id_generic"); break; } - case op_put_getter: { + case op_put_getter_setter: { int r0 = (++it)->u.operand; int id0 = (++it)->u.operand; int r1 = (++it)->u.operand; - printf("[%4d] put_getter\t %s, %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), registerName(exec, r1).data()); - break; - } - case op_put_setter: { - int r0 = (++it)->u.operand; - int id0 = (++it)->u.operand; - int r1 = (++it)->u.operand; - printf("[%4d] put_setter\t %s, %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), registerName(exec, r1).data()); + int r2 = (++it)->u.operand; + printf("[%4d] put_getter_setter\t %s, %s, %s, %s\n", location, registerName(exec, r0).data(), idName(id0, m_identifiers[id0]).data(), registerName(exec, r1).data(), registerName(exec, r2).data()); break; } case op_method_check: { @@ -915,6 +926,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int r1 = (++it)->u.operand; int r2 = (++it)->u.operand; printf("[%4d] get_by_val\t %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data()); + it++; break; } case op_get_argument_by_val: { @@ -922,6 +934,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int r1 = (++it)->u.operand; int r2 = (++it)->u.operand; printf("[%4d] get_argument_by_val\t %s, %s, %s\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data()); + ++it; break; } case op_get_by_pname: { @@ -1119,17 +1132,11 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& break; } case op_call: { - int func = (++it)->u.operand; - int argCount = (++it)->u.operand; - int registerOffset = (++it)->u.operand; - printf("[%4d] call\t\t %s, %d, %d\n", location, registerName(exec, func).data(), argCount, registerOffset); + printCallOp(exec, location, it, "call"); break; } case op_call_eval: { - int func = (++it)->u.operand; - int argCount = (++it)->u.operand; - int registerOffset = (++it)->u.operand; - printf("[%4d] call_eval\t %s, %d, %d\n", location, registerName(exec, func).data(), argCount, registerOffset); + printCallOp(exec, location, it, "call_eval"); break; } case op_call_varargs: { @@ -1148,7 +1155,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& } case op_tear_off_arguments: { int r0 = (++it)->u.operand; - printf("[%4d] tear_off_arguments\t %s\n", location, registerName(exec, r0).data()); + printf("[%4d] tear_off_arguments %s\n", location, registerName(exec, r0).data()); break; } case op_ret: { @@ -1159,6 +1166,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& case op_call_put_result: { int r0 = (++it)->u.operand; printf("[%4d] op_call_put_result\t\t %s\n", location, registerName(exec, r0).data()); + it++; break; } case op_ret_object_or_this: { @@ -1168,10 +1176,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& break; } case op_construct: { - int func = (++it)->u.operand; - int argCount = (++it)->u.operand; - int registerOffset = (++it)->u.operand; - printf("[%4d] construct\t %s, %d, %d\n", location, registerName(exec, func).data(), argCount, registerOffset); + printCallOp(exec, location, it, "construct"); break; } case op_strcat: { @@ -1446,6 +1451,9 @@ CodeBlock::CodeBlock(CopyParsedBlockTag, CodeBlock& other, SymbolTable* symTab) , m_speculativeFailCounter(0) , m_optimizationDelayCounter(0) , m_reoptimizationRetryCounter(0) +#if ENABLE(JIT) + , m_canCompileWithDFGState(CompileWithDFGUnset) +#endif { setNumParameters(other.numParameters()); optimizeAfterWarmUp(); @@ -2054,6 +2062,16 @@ void CodeBlock::createActivation(CallFrame* callFrame) callFrame->uncheckedR(activationRegister()) = JSValue(activation); callFrame->setScopeChain(callFrame->scopeChain()->push(activation)); } + +unsigned CodeBlock::addOrFindConstant(JSValue v) +{ + unsigned numberOfConstants = numberOfConstantRegisters(); + for (unsigned i = 0; i < numberOfConstants; ++i) { + if (getConstant(FirstConstantRegisterIndex + i) == v) + return i; + } + return addConstant(v); +} #if ENABLE(JIT) void CodeBlock::unlinkCalls() @@ -2154,17 +2172,17 @@ JSObject* FunctionCodeBlock::compileOptimized(ExecState* exec, ScopeChainNode* s return error; } -bool ProgramCodeBlock::canCompileWithDFG() +bool ProgramCodeBlock::canCompileWithDFGInternal() { return DFG::canCompileProgram(this); } -bool EvalCodeBlock::canCompileWithDFG() +bool EvalCodeBlock::canCompileWithDFGInternal() { return DFG::canCompileEval(this); } -bool FunctionCodeBlock::canCompileWithDFG() +bool FunctionCodeBlock::canCompileWithDFGInternal() { if (m_isConstructor) return DFG::canCompileFunctionForConstruct(this); diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h index c440c72e1..23d6a6b6d 100644 --- a/Source/JavaScriptCore/bytecode/CodeBlock.h +++ b/Source/JavaScriptCore/bytecode/CodeBlock.h @@ -94,7 +94,7 @@ namespace JSC { Heap* m_heap; public: - virtual ~CodeBlock(); + JS_EXPORT_PRIVATE virtual ~CodeBlock(); int numParameters() const { return m_numParameters; } void setNumParameters(int newValue); @@ -388,7 +388,22 @@ namespace JSC { virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*) = 0; virtual void jettison() = 0; virtual CodeBlock* replacement() = 0; - virtual bool canCompileWithDFG() = 0; + + enum CompileWithDFGState { + CompileWithDFGFalse, + CompileWithDFGTrue, + CompileWithDFGUnset + }; + + virtual bool canCompileWithDFGInternal() = 0; + bool canCompileWithDFG() + { + bool result = canCompileWithDFGInternal(); + m_canCompileWithDFGState = result ? CompileWithDFGTrue : CompileWithDFGFalse; + return result; + } + CompileWithDFGState canCompileWithDFGState() { return m_canCompileWithDFGState; } + bool hasOptimizedReplacement() { ASSERT(getJITType() == JITCode::BaselineJIT); @@ -521,6 +536,11 @@ namespace JSC { { ValueProfile* result = WTF::genericBinarySearch(m_valueProfiles, m_valueProfiles.size(), bytecodeOffset); ASSERT(result->m_bytecodeOffset != -1); + ASSERT(!hasInstructions() + || instructions()[bytecodeOffset + opcodeLength( + m_globalData->interpreter->getOpcodeID( + instructions()[ + bytecodeOffset].u.opcode)) - 1].u.profile == result); return result; } @@ -664,10 +684,22 @@ namespace JSC { return m_rareData && !!m_rareData->m_codeOrigins.size(); } - CodeOrigin codeOriginForReturn(ReturnAddressPtr returnAddress) + bool codeOriginForReturn(ReturnAddressPtr returnAddress, CodeOrigin& codeOrigin) { - ASSERT(hasCodeOrigins()); - return binarySearch(codeOrigins().begin(), codeOrigins().size(), getJITCode().offsetOf(returnAddress.value()))->codeOrigin; + if (!hasCodeOrigins()) + return false; + unsigned offset = getJITCode().offsetOf(returnAddress.value()); + CodeOriginAtCallReturnOffset* entry = binarySearch(codeOrigins().begin(), codeOrigins().size(), offset, WTF::KeyMustNotBePresentInArray); + if (entry->callReturnOffset != offset) + return false; + codeOrigin = entry->codeOrigin; + return true; + } + + CodeOrigin codeOrigin(unsigned index) + { + ASSERT(m_rareData); + return m_rareData->m_codeOrigins[index].codeOrigin; } bool addFrequentExitSite(const DFG::FrequentExitSite& site) @@ -686,11 +718,14 @@ namespace JSC { Identifier& identifier(int index) { return m_identifiers[index]; } size_t numberOfConstantRegisters() const { return m_constantRegisters.size(); } - void addConstant(JSValue v) + unsigned addConstant(JSValue v) { + unsigned result = m_constantRegisters.size(); m_constantRegisters.append(WriteBarrier()); m_constantRegisters.last().set(m_globalObject->globalData(), m_ownerExecutable.get(), v); + return result; } + unsigned addOrFindConstant(JSValue); WriteBarrier& constantRegister(int index) { return m_constantRegisters[index - FirstConstantRegisterIndex]; } ALWAYS_INLINE bool isConstantRegisterIndex(int index) const { return index >= FirstConstantRegisterIndex; } ALWAYS_INLINE JSValue getConstant(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex].get(); } @@ -780,7 +815,7 @@ namespace JSC { // Functions for controlling when tiered compilation kicks in. This // controls both when the optimizing compiler is invoked and when OSR // entry happens. Two triggers exist: the loop trigger and the return - // trigger. In either case, when an addition to m_executeCounter + // trigger. In either case, when an addition to m_jitExecuteCounter // causes it to become non-negative, the optimizing compiler is // invoked. This includes a fast check to see if this CodeBlock has // already been optimized (i.e. replacement() returns a CodeBlock @@ -821,14 +856,14 @@ namespace JSC { return Options::executionCounterValueForOptimizeAfterLongWarmUp << reoptimizationRetryCounter(); } - int32_t* addressOfExecuteCounter() + int32_t* addressOfJITExecuteCounter() { - return &m_executeCounter; + return &m_jitExecuteCounter; } - static ptrdiff_t offsetOfExecuteCounter() { return OBJECT_OFFSETOF(CodeBlock, m_executeCounter); } + static ptrdiff_t offsetOfJITExecuteCounter() { return OBJECT_OFFSETOF(CodeBlock, m_jitExecuteCounter); } - int32_t executeCounter() const { return m_executeCounter; } + int32_t jitExecuteCounter() const { return m_jitExecuteCounter; } unsigned optimizationDelayCounter() const { return m_optimizationDelayCounter; } @@ -837,7 +872,7 @@ namespace JSC { // expensive than executing baseline code. void optimizeNextInvocation() { - m_executeCounter = Options::executionCounterValueForOptimizeNextInvocation; + m_jitExecuteCounter = Options::executionCounterValueForOptimizeNextInvocation; } // Call this to prevent optimization from happening again. Note that @@ -847,7 +882,7 @@ namespace JSC { // the future as well. void dontOptimizeAnytimeSoon() { - m_executeCounter = Options::executionCounterValueForDontOptimizeAnytimeSoon; + m_jitExecuteCounter = Options::executionCounterValueForDontOptimizeAnytimeSoon; } // Call this to reinitialize the counter to its starting state, @@ -858,14 +893,14 @@ namespace JSC { // counter that this corresponds to is also available directly. void optimizeAfterWarmUp() { - m_executeCounter = counterValueForOptimizeAfterWarmUp(); + m_jitExecuteCounter = counterValueForOptimizeAfterWarmUp(); } // Call this to force an optimization trigger to fire only after // a lot of warm-up. void optimizeAfterLongWarmUp() { - m_executeCounter = counterValueForOptimizeAfterLongWarmUp(); + m_jitExecuteCounter = counterValueForOptimizeAfterLongWarmUp(); } // Call this to cause an optimization trigger to fire soon, but @@ -888,7 +923,7 @@ namespace JSC { // in the baseline code. void optimizeSoon() { - m_executeCounter = Options::executionCounterValueForOptimizeSoon << reoptimizationRetryCounter(); + m_jitExecuteCounter = Options::executionCounterValueForOptimizeSoon << reoptimizationRetryCounter(); } // The speculative JIT tracks its success rate, so that we can @@ -989,6 +1024,7 @@ namespace JSC { void printBinaryOp(ExecState*, int location, Vector::const_iterator&, const char* op) const; void printConditionalJump(ExecState*, const Vector::const_iterator&, Vector::const_iterator&, int location, const char* op) const; void printGetByIdOp(ExecState*, int location, Vector::const_iterator&, const char* op) const; + void printCallOp(ExecState*, int location, Vector::const_iterator&, const char* op) const; void printPutByIdOp(ExecState*, int location, Vector::const_iterator&, const char* op) const; #endif void visitStructures(SlotVisitor&, Instruction* vPC) const; @@ -1129,7 +1165,7 @@ namespace JSC { OwnPtr m_alternative; - int32_t m_executeCounter; + int32_t m_jitExecuteCounter; uint32_t m_speculativeSuccessCounter; uint32_t m_speculativeFailCounter; uint8_t m_optimizationDelayCounter; @@ -1169,6 +1205,9 @@ namespace JSC { friend void WTF::deleteOwnedPtr(RareData*); #endif OwnPtr m_rareData; +#if ENABLE(JIT) + CompileWithDFGState m_canCompileWithDFGState; +#endif }; // Program code is not marked by any function, so we make the global object @@ -1208,7 +1247,7 @@ namespace JSC { virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*); virtual void jettison(); virtual CodeBlock* replacement(); - virtual bool canCompileWithDFG(); + virtual bool canCompileWithDFGInternal(); #endif }; @@ -1242,7 +1281,7 @@ namespace JSC { virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*); virtual void jettison(); virtual CodeBlock* replacement(); - virtual bool canCompileWithDFG(); + virtual bool canCompileWithDFGInternal(); #endif private: @@ -1279,7 +1318,7 @@ namespace JSC { virtual JSObject* compileOptimized(ExecState*, ScopeChainNode*); virtual void jettison(); virtual CodeBlock* replacement(); - virtual bool canCompileWithDFG(); + virtual bool canCompileWithDFGInternal(); #endif }; diff --git a/Source/JavaScriptCore/bytecode/CodeOrigin.h b/Source/JavaScriptCore/bytecode/CodeOrigin.h index 7b6ce7d48..25a116c55 100644 --- a/Source/JavaScriptCore/bytecode/CodeOrigin.h +++ b/Source/JavaScriptCore/bytecode/CodeOrigin.h @@ -38,29 +38,37 @@ class ExecutableBase; class JSFunction; struct CodeOrigin { - uint32_t bytecodeIndex; + // Bytecode offset that you'd use to re-execute this instruction. + unsigned bytecodeIndex : 29; + // Bytecode offset corresponding to the opcode that gives the result (needed to handle + // op_call/op_call_put_result and op_method_check/op_get_by_id). + unsigned valueProfileOffset : 3; + InlineCallFrame* inlineCallFrame; CodeOrigin() : bytecodeIndex(std::numeric_limits::max()) + , valueProfileOffset(0) , inlineCallFrame(0) { } - explicit CodeOrigin(uint32_t bytecodeIndex) - : bytecodeIndex(bytecodeIndex) - , inlineCallFrame(0) - { - } - - explicit CodeOrigin(uint32_t bytecodeIndex, InlineCallFrame* inlineCallFrame) + explicit CodeOrigin(unsigned bytecodeIndex, InlineCallFrame* inlineCallFrame = 0, unsigned valueProfileOffset = 0) : bytecodeIndex(bytecodeIndex) + , valueProfileOffset(valueProfileOffset) , inlineCallFrame(inlineCallFrame) { + ASSERT(bytecodeIndex < (1u << 29)); + ASSERT(valueProfileOffset < (1u << 3)); } bool isSet() const { return bytecodeIndex != std::numeric_limits::max(); } + unsigned bytecodeIndexForValueProfile() const + { + return bytecodeIndex + valueProfileOffset; + } + // The inline depth is the depth of the inline stack, so 1 = not inlined, // 2 = inlined one deep, etc. unsigned inlineDepth() const; diff --git a/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp b/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp new file mode 100644 index 000000000..5eff1d4a0 --- /dev/null +++ b/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp @@ -0,0 +1,138 @@ +/* + * 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 "config.h" +#include "GetByIdStatus.h" + +#include "CodeBlock.h" + +namespace JSC { + +GetByIdStatus GetByIdStatus::computeFor(CodeBlock* profiledBlock, unsigned bytecodeIndex, Identifier& ident) +{ + UNUSED_PARAM(profiledBlock); + UNUSED_PARAM(bytecodeIndex); + UNUSED_PARAM(ident); +#if ENABLE(JIT) && ENABLE(VALUE_PROFILER) + // First check if it makes either calls, in which case we want to be super careful, or + // if it's not set at all, in which case we punt. + StructureStubInfo& stubInfo = profiledBlock->getStubInfo(bytecodeIndex); + if (!stubInfo.seen) + return GetByIdStatus(NoInformation, StructureSet(), notFound); + + PolymorphicAccessStructureList* list; + int listSize; + switch (stubInfo.accessType) { + case access_get_by_id_self_list: + list = stubInfo.u.getByIdSelfList.structureList; + listSize = stubInfo.u.getByIdSelfList.listSize; + break; + case access_get_by_id_proto_list: + list = stubInfo.u.getByIdProtoList.structureList; + listSize = stubInfo.u.getByIdProtoList.listSize; + break; + default: + list = 0; + listSize = 0; + break; + } + for (int i = 0; i < listSize; ++i) { + if (!list->list[i].isDirect) + return GetByIdStatus(MakesCalls, StructureSet(), notFound); + } + + // Next check if it takes slow case, in which case we want to be kind of careful. + if (profiledBlock->likelyToTakeSlowCase(bytecodeIndex)) + return GetByIdStatus(TakesSlowPath, StructureSet(), notFound); + + // Finally figure out if we can derive an access strategy. + GetByIdStatus result; + switch (stubInfo.accessType) { + case access_unset: + return GetByIdStatus(NoInformation, StructureSet(), notFound); + + case access_get_by_id_self: { + Structure* structure = stubInfo.u.getByIdSelf.baseObjectStructure.get(); + result.m_offset = structure->get(*profiledBlock->globalData(), ident); + + if (result.m_offset != notFound) + result.m_structureSet.add(structure); + + if (result.m_offset != notFound) + ASSERT(result.m_structureSet.size()); + break; + } + + case access_get_by_id_self_list: { + PolymorphicAccessStructureList* list = stubInfo.u.getByIdProtoList.structureList; + unsigned size = stubInfo.u.getByIdProtoList.listSize; + for (unsigned i = 0; i < size; ++i) { + ASSERT(list->list[i].isDirect); + + Structure* structure = list->list[i].base.get(); + if (result.m_structureSet.contains(structure)) + continue; + + size_t myOffset = structure->get(*profiledBlock->globalData(), ident); + + if (myOffset == notFound) { + result.m_offset = notFound; + break; + } + + if (!i) + result.m_offset = myOffset; + else if (result.m_offset != myOffset) { + result.m_offset = notFound; + break; + } + + result.m_structureSet.add(structure); + } + + if (result.m_offset != notFound) + ASSERT(result.m_structureSet.size()); + break; + } + + default: + ASSERT(result.m_offset == notFound); + break; + } + + if (result.m_offset == notFound) { + result.m_state = TakesSlowPath; + result.m_structureSet.clear(); + } else + result.m_state = SimpleDirect; + + return result; +#else // ENABLE(JIT) + return GetByIdStatus(NoInformation, StructureSet(), notFound); +#endif // ENABLE(JIT) +} + +} // namespace JSC + diff --git a/Source/JavaScriptCore/bytecode/GetByIdStatus.h b/Source/JavaScriptCore/bytecode/GetByIdStatus.h new file mode 100644 index 000000000..00e50e76d --- /dev/null +++ b/Source/JavaScriptCore/bytecode/GetByIdStatus.h @@ -0,0 +1,82 @@ +/* + * 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. + */ + +#ifndef GetByIdStatus_h +#define GetByIdStatus_h + +#include "StructureSet.h" +#include + +namespace JSC { + +class CodeBlock; +class Identifier; + +class GetByIdStatus { +public: + enum State { + NoInformation, // It's uncached so we have no information. + SimpleDirect, // It's cached for a direct access to a known object property. + TakesSlowPath, // It's known to often take slow path. + MakesCalls // It's known to take paths that make calls. + }; + + GetByIdStatus() + : m_state(NoInformation) + , m_offset(notFound) + { + } + + GetByIdStatus(State state, const StructureSet& structureSet, size_t offset) + : m_state(state) + , m_structureSet(structureSet) + , m_offset(offset) + { + ASSERT((state == SimpleDirect) == (offset != notFound)); + } + + static GetByIdStatus computeFor(CodeBlock*, unsigned bytecodeIndex, Identifier&); + + State state() const { return m_state; } + + bool isSet() const { return m_state != NoInformation; } + bool operator!() const { return !isSet(); } + bool isSimpleDirect() const { return m_state == SimpleDirect; } + bool takesSlowPath() const { return m_state == TakesSlowPath || m_state == MakesCalls; } + bool makesCalls() const { return m_state == MakesCalls; } + + const StructureSet& structureSet() const { return m_structureSet; } + size_t offset() const { return m_offset; } + +private: + State m_state; + StructureSet m_structureSet; + size_t m_offset; +}; + +} // namespace JSC + +#endif // PropertyAccessStatus_h + diff --git a/Source/JavaScriptCore/bytecode/Instruction.h b/Source/JavaScriptCore/bytecode/Instruction.h index 7e4413065..92118eeb2 100644 --- a/Source/JavaScriptCore/bytecode/Instruction.h +++ b/Source/JavaScriptCore/bytecode/Instruction.h @@ -48,6 +48,7 @@ namespace JSC { class JSCell; class Structure; class StructureChain; + struct ValueProfile; #if ENABLE(JIT) typedef MacroAssemblerCodeRef PolymorphicAccessStructureListStubRoutineType; @@ -99,6 +100,10 @@ namespace JSC { } } list[POLYMORPHIC_LIST_CACHE_SIZE]; + PolymorphicAccessStructureList() + { + } + PolymorphicAccessStructureList(JSGlobalData& globalData, JSCell* owner, PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, bool isDirect) { list[0].set(globalData, owner, stubRoutine, firstBase, isDirect); @@ -176,6 +181,8 @@ namespace JSC { } Instruction(PropertySlot::GetValueFunc getterFunc) { u.getterFunc = getterFunc; } + + Instruction(ValueProfile* profile) { u.profile = profile; } union { Opcode opcode; @@ -184,6 +191,7 @@ namespace JSC { WriteBarrierBase structureChain; WriteBarrierBase jsCell; PropertySlot::GetValueFunc getterFunc; + ValueProfile* profile; } u; private: diff --git a/Source/JavaScriptCore/bytecode/MethodCallLinkStatus.cpp b/Source/JavaScriptCore/bytecode/MethodCallLinkStatus.cpp new file mode 100644 index 000000000..e7d721c29 --- /dev/null +++ b/Source/JavaScriptCore/bytecode/MethodCallLinkStatus.cpp @@ -0,0 +1,61 @@ +/* + * 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 "config.h" +#include "MethodCallLinkStatus.h" + +#include "CodeBlock.h" + +namespace JSC { + +MethodCallLinkStatus MethodCallLinkStatus::computeFor(CodeBlock* profiledBlock, unsigned bytecodeIndex) +{ + UNUSED_PARAM(profiledBlock); + UNUSED_PARAM(bytecodeIndex); +#if ENABLE(JIT) && ENABLE(VALUE_PROFILER) + MethodCallLinkInfo& methodCall = profiledBlock->getMethodCallLinkInfo(bytecodeIndex); + + if (!methodCall.seen || !methodCall.cachedStructure) + return MethodCallLinkStatus(); + + if (methodCall.cachedPrototype.get() == profiledBlock->globalObject()->methodCallDummy()) { + return MethodCallLinkStatus( + methodCall.cachedStructure.get(), + 0, + methodCall.cachedFunction.get(), + 0); + } + + return MethodCallLinkStatus( + methodCall.cachedStructure.get(), + methodCall.cachedPrototypeStructure.get(), + methodCall.cachedFunction.get(), + methodCall.cachedPrototype.get()); +#else // ENABLE(JIT) + return MethodCallLinkStatus(); +#endif // ENABLE(JIT) +} + +} // namespace JSC diff --git a/Source/JavaScriptCore/bytecode/MethodCallLinkStatus.h b/Source/JavaScriptCore/bytecode/MethodCallLinkStatus.h new file mode 100644 index 000000000..c3d11a1d8 --- /dev/null +++ b/Source/JavaScriptCore/bytecode/MethodCallLinkStatus.h @@ -0,0 +1,87 @@ +/* + * 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. + */ + +#ifndef MethodCallLinkStatus_h +#define MethodCallLinkStatus_h + +namespace JSC { + +class CodeBlock; +class JSObject; +class Structure; + +class MethodCallLinkStatus { +public: + MethodCallLinkStatus() + : m_structure(0) + , m_prototypeStructure(0) + , m_function(0) + , m_prototype(0) + { + } + + MethodCallLinkStatus( + Structure* structure, + Structure* prototypeStructure, + JSObject* function, + JSObject* prototype) + : m_structure(structure) + , m_prototypeStructure(prototypeStructure) + , m_function(function) + , m_prototype(prototype) + { + if (!m_function) { + ASSERT(!m_structure); + ASSERT(!m_prototypeStructure); + ASSERT(!m_prototype); + } else + ASSERT(m_structure); + + ASSERT(!m_prototype == !m_prototypeStructure); + } + + static MethodCallLinkStatus computeFor(CodeBlock*, unsigned bytecodeIndex); + + bool isSet() const { return !!m_function; } + bool operator!() const { return !m_function; } + + bool needsPrototypeCheck() const { return !!m_prototype; } + + Structure* structure() { return m_structure; } + Structure* prototypeStructure() { return m_prototypeStructure; } + JSObject* function() const { return m_function; } + JSObject* prototype() const { return m_prototype; } + +private: + Structure* m_structure; + Structure* m_prototypeStructure; + JSObject* m_function; + JSObject* m_prototype; +}; + +} // namespace JSC + +#endif // MethodCallLinkStatus_h + diff --git a/Source/JavaScriptCore/bytecode/Opcode.h b/Source/JavaScriptCore/bytecode/Opcode.h index 4801e4c32..57633a338 100644 --- a/Source/JavaScriptCore/bytecode/Opcode.h +++ b/Source/JavaScriptCore/bytecode/Opcode.h @@ -95,45 +95,44 @@ namespace JSC { macro(op_is_function, 3) \ macro(op_in, 4) \ \ - macro(op_resolve, 3) \ - macro(op_resolve_skip, 4) \ - macro(op_resolve_global, 5) \ - macro(op_resolve_global_dynamic, 6) \ - macro(op_get_scoped_var, 4) \ + macro(op_resolve, 4) /* has value profiling */ \ + macro(op_resolve_skip, 5) /* has value profiling */ \ + macro(op_resolve_global, 6) /* has value profiling */ \ + macro(op_resolve_global_dynamic, 7) /* has value profiling */ \ + macro(op_get_scoped_var, 5) /* has value profiling */ \ macro(op_put_scoped_var, 4) \ - macro(op_get_global_var, 3) \ + macro(op_get_global_var, 4) /* has value profiling */ \ macro(op_put_global_var, 3) \ - macro(op_resolve_base, 4) \ + macro(op_resolve_base, 5) /* has value profiling */ \ macro(op_ensure_property_exists, 3) \ - macro(op_resolve_with_base, 4) \ - macro(op_resolve_with_this, 4) \ - macro(op_get_by_id, 8) \ - macro(op_get_by_id_self, 8) \ - macro(op_get_by_id_proto, 8) \ - macro(op_get_by_id_chain, 8) \ - macro(op_get_by_id_getter_self, 8) \ - macro(op_get_by_id_getter_proto, 8) \ - macro(op_get_by_id_getter_chain, 8) \ - macro(op_get_by_id_custom_self, 8) \ - macro(op_get_by_id_custom_proto, 8) \ - macro(op_get_by_id_custom_chain, 8) \ - macro(op_get_by_id_generic, 8) \ - macro(op_get_array_length, 8) \ - macro(op_get_string_length, 8) \ + macro(op_resolve_with_base, 5) /* has value profiling */ \ + macro(op_resolve_with_this, 5) /* has value profiling */ \ + macro(op_get_by_id, 9) /* has value profiling */ \ + macro(op_get_by_id_self, 9) /* has value profiling */ \ + macro(op_get_by_id_proto, 9) /* has value profiling */ \ + macro(op_get_by_id_chain, 9) /* has value profiling */ \ + macro(op_get_by_id_getter_self, 9) /* has value profiling */ \ + macro(op_get_by_id_getter_proto, 9) /* has value profiling */ \ + macro(op_get_by_id_getter_chain, 9) /* has value profiling */ \ + macro(op_get_by_id_custom_self, 9) /* has value profiling */ \ + macro(op_get_by_id_custom_proto, 9) /* has value profiling */ \ + macro(op_get_by_id_custom_chain, 9) /* has value profiling */ \ + macro(op_get_by_id_generic, 9) /* has value profiling */ \ + macro(op_get_array_length, 9) /* has value profiling */ \ + macro(op_get_string_length, 9) /* has value profiling */ \ macro(op_get_arguments_length, 4) \ macro(op_put_by_id, 9) \ macro(op_put_by_id_transition, 9) \ macro(op_put_by_id_replace, 9) \ macro(op_put_by_id_generic, 9) \ macro(op_del_by_id, 4) \ - macro(op_get_by_val, 4) \ - macro(op_get_argument_by_val, 4) \ + macro(op_get_by_val, 5) /* has value profiling */ \ + macro(op_get_argument_by_val, 5) /* must be the same size as op_get_by_val */ \ macro(op_get_by_pname, 7) \ macro(op_put_by_val, 4) \ macro(op_del_by_val, 4) \ macro(op_put_by_index, 4) \ - macro(op_put_getter, 4) \ - macro(op_put_setter, 4) \ + macro(op_put_getter_setter, 5) \ \ macro(op_jmp, 2) \ macro(op_jtrue, 3) \ @@ -170,7 +169,7 @@ namespace JSC { macro(op_tear_off_activation, 3) \ macro(op_tear_off_arguments, 2) \ macro(op_ret, 2) \ - macro(op_call_put_result, 2) \ + macro(op_call_put_result, 3) /* has value profiling */ \ macro(op_ret_object_or_this, 3) \ macro(op_method_check, 1) \ \ diff --git a/Source/JavaScriptCore/bytecode/PredictedType.cpp b/Source/JavaScriptCore/bytecode/PredictedType.cpp index 9356390a9..4b07ff446 100644 --- a/Source/JavaScriptCore/bytecode/PredictedType.cpp +++ b/Source/JavaScriptCore/bytecode/PredictedType.cpp @@ -92,6 +92,11 @@ const char* predictionToString(PredictedType value) ptr.strcat("Uint8array"); else isTop = false; + + if (value & PredictUint8ClampedArray) + ptr.strcat("Uint8clampedarray"); + else + isTop = false; if (value & PredictUint16Array) ptr.strcat("Uint16array"); @@ -184,6 +189,8 @@ PredictedType predictionFromClassInfo(const ClassInfo* classInfo) return PredictInt32Array; case TypedArrayUint8: return PredictUint8Array; + case TypedArrayUint8Clamped: + return PredictUint8ClampedArray; case TypedArrayUint16: return PredictUint16Array; case TypedArrayUint32: diff --git a/Source/JavaScriptCore/bytecode/PredictedType.h b/Source/JavaScriptCore/bytecode/PredictedType.h index 3ec03924a..47583361d 100644 --- a/Source/JavaScriptCore/bytecode/PredictedType.h +++ b/Source/JavaScriptCore/bytecode/PredictedType.h @@ -36,33 +36,34 @@ namespace JSC { class Structure; typedef uint32_t PredictedType; -static const PredictedType PredictNone = 0x00000000; // We don't know anything yet. -static const PredictedType PredictFinalObject = 0x00000001; // It's definitely a JSFinalObject. -static const PredictedType PredictArray = 0x00000002; // It's definitely a JSArray. -static const PredictedType PredictByteArray = 0x00000004; // It's definitely a JSByteArray or one of its subclasses. -static const PredictedType PredictFunction = 0x00000008; // It's definitely a JSFunction or one of its subclasses. -static const PredictedType PredictInt8Array = 0x00000010; // It's definitely an Int8Array or one of its subclasses. -static const PredictedType PredictInt16Array = 0x00000020; // It's definitely an Int16Array or one of its subclasses. -static const PredictedType PredictInt32Array = 0x00000040; // It's definitely an Int32Array or one of its subclasses. -static const PredictedType PredictUint8Array = 0x00000080; // It's definitely an Uint8Array or one of its subclasses. -static const PredictedType PredictUint16Array = 0x00000100; // It's definitely an Uint16Array or one of its subclasses. -static const PredictedType PredictUint32Array = 0x00000200; // It's definitely an Uint32Array or one of its subclasses. -static const PredictedType PredictFloat32Array = 0x00000400; // It's definitely an Uint16Array or one of its subclasses. -static const PredictedType PredictFloat64Array = 0x00000800; // It's definitely an Uint16Array or one of its subclasses. -static const PredictedType PredictObjectOther = 0x00001000; // It's definitely an object but not JSFinalObject, JSArray, JSByteArray, or JSFunction. -static const PredictedType PredictObjectMask = 0x00001fff; // Bitmask used for testing for any kind of object prediction. -static const PredictedType PredictString = 0x00002000; // It's definitely a JSString. -static const PredictedType PredictCellOther = 0x00004000; // It's definitely a JSCell but not a subclass of JSObject and definitely not a JSString. -static const PredictedType PredictCell = 0x00007fff; // It's definitely a JSCell. -static const PredictedType PredictInt32 = 0x00008000; // It's definitely an Int32. -static const PredictedType PredictDoubleReal = 0x00010000; // It's definitely a non-NaN double. -static const PredictedType PredictDoubleNaN = 0x00020000; // It's definitely a NaN. -static const PredictedType PredictDouble = 0x00030000; // It's either a non-NaN or a NaN double. -static const PredictedType PredictNumber = 0x00038000; // It's either an Int32 or a Double. -static const PredictedType PredictBoolean = 0x00040000; // It's definitely a Boolean. -static const PredictedType PredictOther = 0x40000000; // It's definitely none of the above. -static const PredictedType PredictTop = 0x7fffffff; // It can be any of the above. -static const PredictedType FixedIndexedStorageMask = PredictByteArray | PredictInt8Array | PredictInt16Array | PredictInt32Array | PredictUint8Array | PredictUint16Array | PredictUint32Array | PredictFloat32Array | PredictFloat64Array; +static const PredictedType PredictNone = 0x00000000; // We don't know anything yet. +static const PredictedType PredictFinalObject = 0x00000001; // It's definitely a JSFinalObject. +static const PredictedType PredictArray = 0x00000002; // It's definitely a JSArray. +static const PredictedType PredictByteArray = 0x00000004; // It's definitely a JSByteArray or one of its subclasses. +static const PredictedType PredictFunction = 0x00000008; // It's definitely a JSFunction or one of its subclasses. +static const PredictedType PredictInt8Array = 0x00000010; // It's definitely an Int8Array or one of its subclasses. +static const PredictedType PredictInt16Array = 0x00000020; // It's definitely an Int16Array or one of its subclasses. +static const PredictedType PredictInt32Array = 0x00000040; // It's definitely an Int32Array or one of its subclasses. +static const PredictedType PredictUint8Array = 0x00000080; // It's definitely an Uint8Array or one of its subclasses. +static const PredictedType PredictUint8ClampedArray = 0x00000100; // It's definitely an Uint8ClampedArray or one of its subclasses. +static const PredictedType PredictUint16Array = 0x00000200; // It's definitely an Uint16Array or one of its subclasses. +static const PredictedType PredictUint32Array = 0x00000400; // It's definitely an Uint32Array or one of its subclasses. +static const PredictedType PredictFloat32Array = 0x00000800; // It's definitely an Uint16Array or one of its subclasses. +static const PredictedType PredictFloat64Array = 0x00001000; // It's definitely an Uint16Array or one of its subclasses. +static const PredictedType PredictObjectOther = 0x00002000; // It's definitely an object but not JSFinalObject, JSArray, JSByteArray, or JSFunction. +static const PredictedType PredictObjectMask = 0x00003fff; // Bitmask used for testing for any kind of object prediction. +static const PredictedType PredictString = 0x00004000; // It's definitely a JSString. +static const PredictedType PredictCellOther = 0x00008000; // It's definitely a JSCell but not a subclass of JSObject and definitely not a JSString. +static const PredictedType PredictCell = 0x0000ffff; // It's definitely a JSCell. +static const PredictedType PredictInt32 = 0x00010000; // It's definitely an Int32. +static const PredictedType PredictDoubleReal = 0x00020000; // It's definitely a non-NaN double. +static const PredictedType PredictDoubleNaN = 0x00040000; // It's definitely a NaN. +static const PredictedType PredictDouble = 0x00060000; // It's either a non-NaN or a NaN double. +static const PredictedType PredictNumber = 0x00070000; // It's either an Int32 or a Double. +static const PredictedType PredictBoolean = 0x00080000; // It's definitely a Boolean. +static const PredictedType PredictOther = 0x40000000; // It's definitely none of the above. +static const PredictedType PredictTop = 0x7fffffff; // It can be any of the above. +static const PredictedType FixedIndexedStorageMask = PredictByteArray | PredictInt8Array | PredictInt16Array | PredictInt32Array | PredictUint8Array | PredictUint8ClampedArray | PredictUint16Array | PredictUint32Array | PredictFloat32Array | PredictFloat64Array; typedef bool (*PredictionChecker)(PredictedType); @@ -131,6 +132,11 @@ inline bool isUint8ArrayPrediction(PredictedType value) return value == PredictUint8Array; } +inline bool isUint8ClampedArrayPrediction(PredictedType value) +{ + return value == PredictUint8ClampedArray; +} + inline bool isUint16ArrayPrediction(PredictedType value) { return value == PredictUint16Array; @@ -161,6 +167,7 @@ inline bool isActionableMutableArrayPrediction(PredictedType value) #endif || isInt32ArrayPrediction(value) || isUint8ArrayPrediction(value) + || isUint8ClampedArrayPrediction(value) || isUint16ArrayPrediction(value) || isUint32ArrayPrediction(value) #if CPU(X86) || CPU(X86_64) diff --git a/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp b/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp new file mode 100644 index 000000000..45a5e614c --- /dev/null +++ b/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp @@ -0,0 +1,89 @@ +/* + * 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 "config.h" +#include "PutByIdStatus.h" + +#include "CodeBlock.h" +#include "Structure.h" +#include "StructureChain.h" + +namespace JSC { + +PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, unsigned bytecodeIndex, Identifier& ident) +{ + UNUSED_PARAM(profiledBlock); + UNUSED_PARAM(bytecodeIndex); + UNUSED_PARAM(ident); +#if ENABLE(JIT) && ENABLE(VALUE_PROFILER) + if (profiledBlock->likelyToTakeSlowCase(bytecodeIndex)) + return PutByIdStatus(TakesSlowPath, 0, 0, 0, notFound); + + StructureStubInfo& stubInfo = profiledBlock->getStubInfo(bytecodeIndex); + if (!stubInfo.seen) + return PutByIdStatus(NoInformation, 0, 0, 0, notFound); + + switch (stubInfo.accessType) { + case access_unset: + return PutByIdStatus(NoInformation, 0, 0, 0, notFound); + + case access_put_by_id_replace: { + size_t offset = stubInfo.u.putByIdReplace.baseObjectStructure->get( + *profiledBlock->globalData(), ident); + if (offset != notFound) { + return PutByIdStatus( + SimpleReplace, + stubInfo.u.putByIdReplace.baseObjectStructure.get(), + 0, 0, + offset); + } + return PutByIdStatus(TakesSlowPath, 0, 0, 0, notFound); + } + + case access_put_by_id_transition_normal: + case access_put_by_id_transition_direct: { + size_t offset = stubInfo.u.putByIdTransition.structure->get( + *profiledBlock->globalData(), ident); + if (offset != notFound) { + return PutByIdStatus( + SimpleTransition, + stubInfo.u.putByIdTransition.previousStructure.get(), + stubInfo.u.putByIdTransition.structure.get(), + stubInfo.u.putByIdTransition.chain.get(), + offset); + } + return PutByIdStatus(TakesSlowPath, 0, 0, 0, notFound); + } + + default: + return PutByIdStatus(TakesSlowPath, 0, 0, 0, notFound); + } +#else // ENABLE(JIT) + return PutByIdStatus(NoInformation, 0, 0, 0, notFound); +#endif // ENABLE(JIT) +} + +} // namespace JSC + diff --git a/Source/JavaScriptCore/bytecode/PutByIdStatus.h b/Source/JavaScriptCore/bytecode/PutByIdStatus.h new file mode 100644 index 000000000..b33f4d09c --- /dev/null +++ b/Source/JavaScriptCore/bytecode/PutByIdStatus.h @@ -0,0 +1,106 @@ +/* + * 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. + */ + +#ifndef PutByIdStatus_h +#define PutByIdStatus_h + +#include + +namespace JSC { + +class CodeBlock; +class Identifier; +class Structure; +class StructureChain; + +class PutByIdStatus { +public: + enum State { + // It's uncached so we have no information. + NoInformation, + // It's cached as a direct store into an object property for cases where the object + // already has the property. + SimpleReplace, + // It's cached as a transition from one structure that lacks the property to one that + // includes the property, and a direct store to this new property. + SimpleTransition, + // It's known to often take slow path. + TakesSlowPath + }; + + PutByIdStatus() + : m_state(NoInformation) + , m_oldStructure(0) + , m_newStructure(0) + , m_structureChain(0) + , m_offset(notFound) + { + } + + PutByIdStatus( + State state, + Structure* oldStructure, + Structure* newStructure, + StructureChain* structureChain, + size_t offset) + : m_state(state) + , m_oldStructure(oldStructure) + , m_newStructure(newStructure) + , m_structureChain(structureChain) + , m_offset(offset) + { + ASSERT((m_state == NoInformation || m_state == TakesSlowPath) == !m_oldStructure); + ASSERT((m_state != SimpleTransition) == !m_newStructure); + ASSERT((m_state != SimpleTransition) == !m_structureChain); + ASSERT((m_state == NoInformation || m_state == TakesSlowPath) == (m_offset == notFound)); + } + + static PutByIdStatus computeFor(CodeBlock*, unsigned bytecodeIndex, Identifier&); + + State state() const { return m_state; } + + bool isSet() const { return m_state != NoInformation; } + bool operator!() const { return m_state == NoInformation; } + bool isSimpleReplace() const { return m_state == SimpleReplace; } + bool isSimpleTransition() const { return m_state == SimpleTransition; } + bool takesSlowPath() const { return m_state == TakesSlowPath; } + + Structure* oldStructure() const { return m_oldStructure; } + Structure* newStructure() const { return m_newStructure; } + StructureChain* structureChain() const { return m_structureChain; } + size_t offset() const { return m_offset; } + +private: + State m_state; + Structure* m_oldStructure; + Structure* m_newStructure; + StructureChain* m_structureChain; + size_t m_offset; +}; + +} // namespace JSC + +#endif // PutByIdStatus_h + diff --git a/Source/JavaScriptCore/bytecode/SamplingTool.h b/Source/JavaScriptCore/bytecode/SamplingTool.h index b69ef026e..32a44ad69 100644 --- a/Source/JavaScriptCore/bytecode/SamplingTool.h +++ b/Source/JavaScriptCore/bytecode/SamplingTool.h @@ -45,8 +45,8 @@ namespace JSC { class SamplingFlags { public: - static void start(); - static void stop(); + JS_EXPORT_PRIVATE static void start(); + JS_EXPORT_PRIVATE static void stop(); #if ENABLE(SAMPLING_FLAGS) static void setFlag(unsigned flag) @@ -89,7 +89,7 @@ namespace JSC { #endif private: - static uint32_t s_flags; + JS_EXPORTDATA static uint32_t s_flags; #if ENABLE(SAMPLING_FLAGS) static uint64_t s_flagCounts[33]; #endif @@ -174,7 +174,7 @@ namespace JSC { class SamplingRegion { public: SamplingRegion(const char*) { } - void dump(); + JS_EXPORT_PRIVATE void dump(); }; #endif // ENABLE(SAMPLING_REGIONS) @@ -220,8 +220,8 @@ namespace JSC { static unsigned s_hertz; static ThreadIdentifier s_samplingThread; - static void start(unsigned hertz=10000); - static void stop(); + JS_EXPORT_PRIVATE static void start(unsigned hertz=10000); + JS_EXPORT_PRIVATE static void stop(); static void* threadStartFunc(void*); }; @@ -294,7 +294,7 @@ namespace JSC { memset(m_opcodeSamplesInCTIFunctions, 0, sizeof(m_opcodeSamplesInCTIFunctions)); } - void setup(); + JS_EXPORT_PRIVATE void setup(); void dump(ExecState*); void notifyOfScope(JSGlobalData&, ScriptExecutable* scope); diff --git a/Source/JavaScriptCore/bytecode/StructureSet.h b/Source/JavaScriptCore/bytecode/StructureSet.h new file mode 100644 index 000000000..344183b45 --- /dev/null +++ b/Source/JavaScriptCore/bytecode/StructureSet.h @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2011 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. + */ + +#ifndef StructureSet_h +#define StructureSet_h + +#include "PredictedType.h" +#include +#include + +namespace JSC { + +class Structure; + +namespace DFG { +class StructureAbstractValue; +} + +class StructureSet { +public: + StructureSet() { } + + StructureSet(Structure* structure) + { + m_structures.append(structure); + } + + void clear() + { + m_structures.clear(); + } + + void add(Structure* structure) + { + ASSERT(!contains(structure)); + m_structures.append(structure); + } + + bool addAll(const StructureSet& other) + { + bool changed = false; + for (size_t i = 0; i < other.size(); ++i) { + if (contains(other[i])) + continue; + add(other[i]); + changed = true; + } + return changed; + } + + void remove(Structure* structure) + { + for (size_t i = 0; i < m_structures.size(); ++i) { + if (m_structures[i] != structure) + continue; + + m_structures[i] = m_structures.last(); + m_structures.removeLast(); + return; + } + } + + bool contains(Structure* structure) const + { + for (size_t i = 0; i < m_structures.size(); ++i) { + if (m_structures[i] == structure) + return true; + } + return false; + } + + bool isSubsetOf(const StructureSet& other) const + { + for (size_t i = 0; i < m_structures.size(); ++i) { + if (!other.contains(m_structures[i])) + return false; + } + return true; + } + + bool isSupersetOf(const StructureSet& other) const + { + return other.isSubsetOf(*this); + } + + size_t size() const { return m_structures.size(); } + + Structure* at(size_t i) const { return m_structures.at(i); } + + Structure* operator[](size_t i) const { return at(i); } + + Structure* last() const { return m_structures.last(); } + + PredictedType predictionFromStructures() const + { + PredictedType result = PredictNone; + + for (size_t i = 0; i < m_structures.size(); ++i) + mergePrediction(result, predictionFromStructure(m_structures[i])); + + return result; + } + + bool operator==(const StructureSet& other) const + { + if (m_structures.size() != other.m_structures.size()) + return false; + + for (size_t i = 0; i < m_structures.size(); ++i) { + if (!other.contains(m_structures[i])) + return false; + } + + return true; + } + + void dump(FILE* out) + { + fprintf(out, "["); + for (size_t i = 0; i < m_structures.size(); ++i) { + if (i) + fprintf(out, ", "); + fprintf(out, "%p", m_structures[i]); + } + fprintf(out, "]"); + } + +private: + friend class DFG::StructureAbstractValue; + + Vector m_structures; +}; + +} // namespace JSC + +#endif // StructureSet_h diff --git a/Source/JavaScriptCore/bytecode/StructureStubInfo.h b/Source/JavaScriptCore/bytecode/StructureStubInfo.h index 5c7ee0bb8..d6b6092d0 100644 --- a/Source/JavaScriptCore/bytecode/StructureStubInfo.h +++ b/Source/JavaScriptCore/bytecode/StructureStubInfo.h @@ -28,6 +28,7 @@ #if ENABLE(JIT) +#include "CodeOrigin.h" #include "Instruction.h" #include "MacroAssembler.h" #include "Opcode.h" @@ -175,6 +176,8 @@ namespace JSC { int8_t seen; #if ENABLE(DFG_JIT) + CodeOrigin codeOrigin; + int8_t registersFlushed; int8_t baseGPR; #if USE(JSVALUE32_64) int8_t valueTagGPR; diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index bfb1618a6..3d363354e 100644 --- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2008 Cameron Zwarich + * Copyright (C) 2012 Igalia, S.L. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -116,6 +117,39 @@ namespace JSC { expected by the callee. */ +#ifndef NDEBUG +void ResolveResult::checkValidity() +{ + switch (m_type) { + case Register: + case ReadOnlyRegister: + ASSERT(m_local); + return; + case Lexical: + case ReadOnlyLexical: + case DynamicLexical: + case DynamicReadOnlyLexical: + ASSERT(m_index != missingSymbolMarker()); + return; + case Global: + case DynamicGlobal: + ASSERT(m_globalObject); + return; + case IndexedGlobal: + case ReadOnlyIndexedGlobal: + case DynamicIndexedGlobal: + case DynamicReadOnlyIndexedGlobal: + ASSERT(m_index != missingSymbolMarker()); + ASSERT(m_globalObject); + return; + case Dynamic: + return; + default: + ASSERT_NOT_REACHED(); + } +} +#endif + #ifndef NDEBUG static bool s_dumpsGeneratedCode = false; #endif @@ -217,7 +251,7 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, ScopeChainNode* s #ifndef NDEBUG , m_lastOpcodePosition(0) #endif - , m_stack(m_globalData->stack()) + , m_stack(wtfThreadData().stack()) , m_usesExceptions(false) , m_expressionTooDeep(false) { @@ -288,7 +322,7 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, ScopeChainN #ifndef NDEBUG , m_lastOpcodePosition(0) #endif - , m_stack(m_globalData->stack()) + , m_stack(wtfThreadData().stack()) , m_usesExceptions(false) , m_expressionTooDeep(false) { @@ -449,7 +483,7 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, ScopeChainNode* scopeCh #ifndef NDEBUG , m_lastOpcodePosition(0) #endif - , m_stack(m_globalData->stack()) + , m_stack(wtfThreadData().stack()) , m_usesExceptions(false) , m_expressionTooDeep(false) { @@ -503,42 +537,6 @@ void BytecodeGenerator::addParameter(const Identifier& ident, int parameterIndex m_codeBlock->addParameter(); } -RegisterID* BytecodeGenerator::registerFor(const Identifier& ident) -{ - if (ident == propertyNames().thisIdentifier) - return &m_thisRegister; - - if (m_codeType == GlobalCode) - return 0; - - if (!shouldOptimizeLocals()) - return 0; - - SymbolTableEntry entry = symbolTable().get(ident.impl()); - if (entry.isNull()) - return 0; - - if (ident == propertyNames().arguments) - createArgumentsIfNecessary(); - - return createLazyRegisterIfNecessary(®isterFor(entry.getIndex())); -} - -RegisterID* BytecodeGenerator::constRegisterFor(const Identifier& ident) -{ - if (m_codeType == EvalCode) - return 0; - - if (m_codeType == GlobalCode) - return 0; - - SymbolTableEntry entry = symbolTable().get(ident.impl()); - if (entry.isNull()) - return 0; - - return createLazyRegisterIfNecessary(®isterFor(entry.getIndex())); -} - bool BytecodeGenerator::willResolveToArguments(const Identifier& ident) { if (ident != propertyNames().arguments) @@ -668,6 +666,17 @@ void BytecodeGenerator::emitOpcode(OpcodeID opcodeID) m_lastOpcodeID = opcodeID; } +ValueProfile* BytecodeGenerator::emitProfiledOpcode(OpcodeID opcodeID) +{ +#if ENABLE(VALUE_PROFILER) + ValueProfile* result = m_codeBlock->addValueProfile(instructions().size()); +#else + ValueProfile* result = 0; +#endif + emitOpcode(opcodeID); + return result; +} + void BytecodeGenerator::emitLoopHint() { #if ENABLE(DFG_JIT) @@ -1159,59 +1168,109 @@ RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, JSValue v) return constantID; } -bool BytecodeGenerator::findScopedProperty(const Identifier& property, int& index, size_t& stackDepth, bool forWriting, bool& requiresDynamicChecks, JSObject*& globalObject) +ResolveResult BytecodeGenerator::resolve(const Identifier& property) { + if (property == propertyNames().thisIdentifier) + return ResolveResult::registerResolve(thisRegister(), ResolveResult::ReadOnlyFlag); + + // Check if the property should be allocated in a register. + if (m_codeType != GlobalCode && shouldOptimizeLocals()) { + SymbolTableEntry entry = symbolTable().get(property.impl()); + if (!entry.isNull()) { + if (property == propertyNames().arguments) + createArgumentsIfNecessary(); + unsigned flags = entry.isReadOnly() ? ResolveResult::ReadOnlyFlag : 0; + RegisterID* local = createLazyRegisterIfNecessary(®isterFor(entry.getIndex())); + return ResolveResult::registerResolve(local, flags); + } + } + // Cases where we cannot statically optimize the lookup. if (property == propertyNames().arguments || !canOptimizeNonLocals()) { - stackDepth = 0; - index = missingSymbolMarker(); - if (shouldOptimizeLocals() && m_codeType == GlobalCode) { ScopeChainIterator iter = m_scopeChain->begin(); - globalObject = iter->get(); + JSObject* globalObject = iter->get(); ASSERT((++iter) == m_scopeChain->end()); - } - return false; + return ResolveResult::globalResolve(globalObject); + } else + return ResolveResult::dynamicResolve(0); } - size_t depth = 0; - requiresDynamicChecks = false; ScopeChainIterator iter = m_scopeChain->begin(); ScopeChainIterator end = m_scopeChain->end(); + size_t depth = 0; + unsigned flags = 0; for (; iter != end; ++iter, ++depth) { JSObject* currentScope = iter->get(); - if (!currentScope->isVariableObject()) + if (!currentScope->isVariableObject()) { + flags |= ResolveResult::DynamicFlag; break; + } JSVariableObject* currentVariableObject = static_cast(currentScope); SymbolTableEntry entry = currentVariableObject->symbolTable().get(property.impl()); // Found the property if (!entry.isNull()) { - if (entry.isReadOnly() && forWriting) { - stackDepth = 0; - index = missingSymbolMarker(); - if (++iter == end) - globalObject = currentVariableObject; - return false; + if (entry.isReadOnly()) + flags |= ResolveResult::ReadOnlyFlag; + depth += m_codeBlock->needsFullScopeChain(); + if (++iter == end) { + if (flags & ResolveResult::DynamicFlag) + return ResolveResult::dynamicIndexedGlobalResolve(entry.getIndex(), depth, currentScope, flags); + return ResolveResult::indexedGlobalResolve(entry.getIndex(), currentScope, flags); } - stackDepth = depth + m_codeBlock->needsFullScopeChain(); - index = entry.getIndex(); - if (++iter == end) - globalObject = currentVariableObject; - return true; + return ResolveResult::lexicalResolve(entry.getIndex(), depth, flags); } bool scopeRequiresDynamicChecks = false; if (currentVariableObject->isDynamicScope(scopeRequiresDynamicChecks)) break; - requiresDynamicChecks |= scopeRequiresDynamicChecks; + if (scopeRequiresDynamicChecks) + flags |= ResolveResult::DynamicFlag; } + // Can't locate the property but we're able to avoid a few lookups. - stackDepth = depth + m_codeBlock->needsFullScopeChain(); - index = missingSymbolMarker(); JSObject* scope = iter->get(); - if (++iter == end) - globalObject = scope; - return true; + depth += m_codeBlock->needsFullScopeChain(); + if (++iter == end) { + if ((flags & ResolveResult::DynamicFlag) && depth) + return ResolveResult::dynamicGlobalResolve(depth, scope); + return ResolveResult::globalResolve(scope); + } + return ResolveResult::dynamicResolve(depth); +} + +ResolveResult BytecodeGenerator::resolveConstDecl(const Identifier& property) +{ + // Register-allocated const declarations. + if (m_codeType != EvalCode && m_codeType != GlobalCode) { + SymbolTableEntry entry = symbolTable().get(property.impl()); + if (!entry.isNull()) { + unsigned flags = entry.isReadOnly() ? ResolveResult::ReadOnlyFlag : 0; + RegisterID* local = createLazyRegisterIfNecessary(®isterFor(entry.getIndex())); + return ResolveResult::registerResolve(local, flags); + } + } + + // Const declarations in eval code or global code. + ScopeChainIterator iter = scopeChain()->begin(); + ScopeChainIterator end = scopeChain()->end(); + size_t depth = 0; + for (; iter != end; ++iter, ++depth) { + JSObject* currentScope = iter->get(); + if (!currentScope->isVariableObject()) + continue; + JSVariableObject* currentVariableObject = static_cast(currentScope); + SymbolTableEntry entry = currentVariableObject->symbolTable().get(property.impl()); + if (entry.isNull()) + continue; + if (++iter == end) + return ResolveResult::indexedGlobalResolve(entry.getIndex(), currentVariableObject, 0); + return ResolveResult::lexicalResolve(entry.getIndex(), depth + scopeDepth(), 0); + } + + // FIXME: While this code should only be hit in an eval block, it will assign + // to the wrong base if property exists in an intervening with scope. + return ResolveResult::dynamicResolve(scopeDepth()); } void BytecodeGenerator::emitCheckHasInstance(RegisterID* base) @@ -1237,246 +1296,222 @@ bool BytecodeGenerator::shouldAvoidResolveGlobal() return m_codeBlock->globalResolveInfoCount() > maxGlobalResolves && !m_labelScopes.size(); } -RegisterID* BytecodeGenerator::emitResolve(RegisterID* dst, const Identifier& property) +RegisterID* BytecodeGenerator::emitResolve(RegisterID* dst, const ResolveResult& resolveResult, const Identifier& property) { - size_t depth = 0; - int index = 0; - JSObject* globalObject = 0; - bool requiresDynamicChecks = false; - if (!findScopedProperty(property, index, depth, false, requiresDynamicChecks, globalObject) && !globalObject) { - // We can't optimise at all :-( - emitOpcode(op_resolve); - instructions().append(dst->index()); - instructions().append(addConstant(property)); - return dst; - } - if (shouldAvoidResolveGlobal()) { - globalObject = 0; - requiresDynamicChecks = true; - } - - if (globalObject) { - if (index != missingSymbolMarker() && !requiresDynamicChecks) { - // Directly index the property lookup across multiple scopes. - return emitGetScopedVar(dst, depth, index, globalObject); - } - + if (resolveResult.isStatic()) + return emitGetStaticVar(dst, resolveResult); + + if (resolveResult.isGlobal() && !shouldAvoidResolveGlobal()) { #if ENABLE(JIT) m_codeBlock->addGlobalResolveInfo(instructions().size()); #endif #if ENABLE(INTERPRETER) m_codeBlock->addGlobalResolveInstruction(instructions().size()); #endif - emitOpcode(requiresDynamicChecks ? op_resolve_global_dynamic : op_resolve_global); + bool dynamic = resolveResult.isDynamic() && resolveResult.depth(); + ValueProfile* profile = emitProfiledOpcode(dynamic ? op_resolve_global_dynamic : op_resolve_global); instructions().append(dst->index()); instructions().append(addConstant(property)); instructions().append(0); instructions().append(0); - if (requiresDynamicChecks) - instructions().append(depth); + if (dynamic) + instructions().append(resolveResult.depth()); + instructions().append(profile); return dst; } - - if (requiresDynamicChecks) { - // If we get here we have eval nested inside a |with| just give up - emitOpcode(op_resolve); + + if (resolveResult.type() == ResolveResult::Dynamic && resolveResult.depth()) { + // In this case we are at least able to drop a few scope chains from the + // lookup chain, although we still need to hash from then on. + ValueProfile* profile = emitProfiledOpcode(op_resolve_skip); instructions().append(dst->index()); instructions().append(addConstant(property)); + instructions().append(resolveResult.depth()); + instructions().append(profile); return dst; } - if (index != missingSymbolMarker()) { - // Directly index the property lookup across multiple scopes. - return emitGetScopedVar(dst, depth, index, globalObject); - } - - // In this case we are at least able to drop a few scope chains from the - // lookup chain, although we still need to hash from then on. - emitOpcode(op_resolve_skip); + ValueProfile* profile = emitProfiledOpcode(op_resolve); instructions().append(dst->index()); instructions().append(addConstant(property)); - instructions().append(depth); + instructions().append(profile); return dst; } -RegisterID* BytecodeGenerator::emitGetScopedVar(RegisterID* dst, size_t depth, int index, JSValue globalObject) +RegisterID* BytecodeGenerator::emitResolveBase(RegisterID* dst, const ResolveResult& resolveResult, const Identifier& property) { - if (globalObject) { - if (m_lastOpcodeID == op_put_global_var) { - int dstIndex; - int srcIndex; - retrieveLastUnaryOp(dstIndex, srcIndex); - - if (dstIndex == index && srcIndex == dst->index()) - return dst; - } + if (resolveResult.isGlobal() && !resolveResult.isDynamic()) + // Global object is the base + return emitLoad(dst, JSValue(resolveResult.globalObject())); - emitOpcode(op_get_global_var); - instructions().append(dst->index()); - instructions().append(index); - return dst; - } - - emitOpcode(op_get_scoped_var); + // We can't optimise at all :-( + ValueProfile* profile = emitProfiledOpcode(op_resolve_base); instructions().append(dst->index()); - instructions().append(index); - instructions().append(depth); + instructions().append(addConstant(property)); + instructions().append(false); + instructions().append(profile); return dst; } -RegisterID* BytecodeGenerator::emitPutScopedVar(size_t depth, int index, RegisterID* value, JSValue globalObject) +RegisterID* BytecodeGenerator::emitResolveBaseForPut(RegisterID* dst, const ResolveResult& resolveResult, const Identifier& property) { - if (globalObject) { - emitOpcode(op_put_global_var); - instructions().append(index); - instructions().append(value->index()); - return value; - } - emitOpcode(op_put_scoped_var); - instructions().append(index); - instructions().append(depth); - instructions().append(value->index()); - return value; -} + if (!m_codeBlock->isStrictMode()) + return emitResolveBase(dst, resolveResult, property); -RegisterID* BytecodeGenerator::emitResolveBase(RegisterID* dst, const Identifier& property) -{ - size_t depth = 0; - int index = 0; - JSObject* globalObject = 0; - bool requiresDynamicChecks = false; - findScopedProperty(property, index, depth, false, requiresDynamicChecks, globalObject); - if (!globalObject || requiresDynamicChecks) { - // We can't optimise at all :-( - emitOpcode(op_resolve_base); + if (resolveResult.isGlobal() && !resolveResult.isDynamic()) { + // Global object is the base + RefPtr result = emitLoad(dst, JSValue(resolveResult.globalObject())); + emitOpcode(op_ensure_property_exists); instructions().append(dst->index()); instructions().append(addConstant(property)); - instructions().append(false); - return dst; + return result.get(); } - // Global object is the base - return emitLoad(dst, JSValue(globalObject)); -} - -RegisterID* BytecodeGenerator::emitResolveBaseForPut(RegisterID* dst, const Identifier& property) -{ - if (!m_codeBlock->isStrictMode()) - return emitResolveBase(dst, property); - size_t depth = 0; - int index = 0; - JSObject* globalObject = 0; - bool requiresDynamicChecks = false; - findScopedProperty(property, index, depth, false, requiresDynamicChecks, globalObject); - if (!globalObject || requiresDynamicChecks) { - // We can't optimise at all :-( - emitOpcode(op_resolve_base); - instructions().append(dst->index()); - instructions().append(addConstant(property)); - instructions().append(true); - return dst; - } - - // Global object is the base - RefPtr result = emitLoad(dst, JSValue(globalObject)); - emitOpcode(op_ensure_property_exists); + // We can't optimise at all :-( + ValueProfile* profile = emitProfiledOpcode(op_resolve_base); instructions().append(dst->index()); instructions().append(addConstant(property)); - return result.get(); + instructions().append(true); + instructions().append(profile); + return dst; } -RegisterID* BytecodeGenerator::emitResolveWithBase(RegisterID* baseDst, RegisterID* propDst, const Identifier& property) +RegisterID* BytecodeGenerator::emitResolveWithBase(RegisterID* baseDst, RegisterID* propDst, const ResolveResult& resolveResult, const Identifier& property) { - size_t depth = 0; - int index = 0; - JSObject* globalObject = 0; - bool requiresDynamicChecks = false; - if (!findScopedProperty(property, index, depth, false, requiresDynamicChecks, globalObject) || !globalObject || requiresDynamicChecks) { - // We can't optimise at all :-( - emitOpcode(op_resolve_with_base); - instructions().append(baseDst->index()); - instructions().append(propDst->index()); - instructions().append(addConstant(property)); - return baseDst; - } + if (resolveResult.isGlobal() && !resolveResult.isDynamic()) { + // Global object is the base + emitLoad(baseDst, JSValue(resolveResult.globalObject())); - bool forceGlobalResolve = false; + if (resolveResult.isStatic()) { + // Directly index the property lookup across multiple scopes. + emitGetStaticVar(propDst, resolveResult); + return baseDst; + } - // Global object is the base - emitLoad(baseDst, JSValue(globalObject)); + if (shouldAvoidResolveGlobal()) { + ValueProfile* profile = emitProfiledOpcode(op_resolve); + instructions().append(propDst->index()); + instructions().append(addConstant(property)); + instructions().append(profile); + return baseDst; + } - if (index != missingSymbolMarker() && !forceGlobalResolve) { - // Directly index the property lookup across multiple scopes. - emitGetScopedVar(propDst, depth, index, globalObject); - return baseDst; - } - if (shouldAvoidResolveGlobal()) { - emitOpcode(op_resolve); - instructions().append(propDst->index()); - instructions().append(addConstant(property)); - return baseDst; - } #if ENABLE(JIT) - m_codeBlock->addGlobalResolveInfo(instructions().size()); + m_codeBlock->addGlobalResolveInfo(instructions().size()); #endif #if ENABLE(INTERPRETER) - m_codeBlock->addGlobalResolveInstruction(instructions().size()); + m_codeBlock->addGlobalResolveInstruction(instructions().size()); #endif - emitOpcode(requiresDynamicChecks ? op_resolve_global_dynamic : op_resolve_global); + ValueProfile* profile = emitProfiledOpcode(op_resolve_global); + instructions().append(propDst->index()); + instructions().append(addConstant(property)); + instructions().append(0); + instructions().append(0); + instructions().append(profile); + return baseDst; + } + + + + + ValueProfile* profile = emitProfiledOpcode(op_resolve_with_base); + instructions().append(baseDst->index()); instructions().append(propDst->index()); instructions().append(addConstant(property)); - instructions().append(0); - instructions().append(0); - if (requiresDynamicChecks) - instructions().append(depth); + instructions().append(profile); return baseDst; } -RegisterID* BytecodeGenerator::emitResolveWithThis(RegisterID* baseDst, RegisterID* propDst, const Identifier& property) +RegisterID* BytecodeGenerator::emitResolveWithThis(RegisterID* baseDst, RegisterID* propDst, const ResolveResult& resolveResult, const Identifier& property) { - size_t depth = 0; - int index = 0; - JSObject* globalObject = 0; - bool requiresDynamicChecks = false; - if (!findScopedProperty(property, index, depth, false, requiresDynamicChecks, globalObject) || !globalObject || requiresDynamicChecks) { + if (resolveResult.isStatic()) { + emitLoad(baseDst, jsUndefined()); + emitGetStaticVar(propDst, resolveResult); + return baseDst; + } + + if (resolveResult.type() == ResolveResult::Dynamic) { // We can't optimise at all :-( - emitOpcode(op_resolve_with_this); + ValueProfile* profile = emitProfiledOpcode(op_resolve_with_this); instructions().append(baseDst->index()); instructions().append(propDst->index()); instructions().append(addConstant(property)); + instructions().append(profile); return baseDst; } - bool forceGlobalResolve = false; - - // Global object is the base emitLoad(baseDst, jsUndefined()); + return emitResolve(propDst, resolveResult, property); +} - if (index != missingSymbolMarker() && !forceGlobalResolve) { - // Directly index the property lookup across multiple scopes. - emitGetScopedVar(propDst, depth, index, globalObject); - return baseDst; +RegisterID* BytecodeGenerator::emitGetStaticVar(RegisterID* dst, const ResolveResult& resolveResult) +{ + ValueProfile* profile = 0; + + switch (resolveResult.type()) { + case ResolveResult::Register: + case ResolveResult::ReadOnlyRegister: + if (dst == ignoredResult()) + return 0; + return moveToDestinationIfNeeded(dst, resolveResult.local()); + + case ResolveResult::Lexical: + case ResolveResult::ReadOnlyLexical: + profile = emitProfiledOpcode(op_get_scoped_var); + instructions().append(dst->index()); + instructions().append(resolveResult.index()); + instructions().append(resolveResult.depth()); + instructions().append(profile); + return dst; + + case ResolveResult::IndexedGlobal: + case ResolveResult::ReadOnlyIndexedGlobal: + if (m_lastOpcodeID == op_put_global_var) { + int dstIndex; + int srcIndex; + retrieveLastUnaryOp(dstIndex, srcIndex); + if (dstIndex == resolveResult.index() && srcIndex == dst->index()) + return dst; + } + + profile = emitProfiledOpcode(op_get_global_var); + instructions().append(dst->index()); + instructions().append(resolveResult.index()); + instructions().append(profile); + return dst; + + default: + ASSERT_NOT_REACHED(); + return 0; } - if (shouldAvoidResolveGlobal()) { - emitOpcode(op_resolve); - instructions().append(propDst->index()); - instructions().append(addConstant(property)); - return baseDst; +} + +RegisterID* BytecodeGenerator::emitPutStaticVar(const ResolveResult& resolveResult, RegisterID* value) +{ + switch (resolveResult.type()) { + case ResolveResult::Register: + case ResolveResult::ReadOnlyRegister: + return moveToDestinationIfNeeded(resolveResult.local(), value); + + case ResolveResult::Lexical: + case ResolveResult::ReadOnlyLexical: + emitOpcode(op_put_scoped_var); + instructions().append(resolveResult.index()); + instructions().append(resolveResult.depth()); + instructions().append(value->index()); + return value; + + case ResolveResult::IndexedGlobal: + case ResolveResult::ReadOnlyIndexedGlobal: + emitOpcode(op_put_global_var); + instructions().append(resolveResult.index()); + instructions().append(value->index()); + return value; + + default: + ASSERT_NOT_REACHED(); + return 0; } -#if ENABLE(JIT) - m_codeBlock->addGlobalResolveInfo(instructions().size()); -#endif -#if ENABLE(INTERPRETER) - m_codeBlock->addGlobalResolveInstruction(instructions().size()); -#endif - emitOpcode(requiresDynamicChecks ? op_resolve_global_dynamic : op_resolve_global); - instructions().append(propDst->index()); - instructions().append(addConstant(property)); - instructions().append(0); - instructions().append(0); - if (requiresDynamicChecks) - instructions().append(depth); - return baseDst; } void BytecodeGenerator::emitMethodCheck() @@ -1490,7 +1525,7 @@ RegisterID* BytecodeGenerator::emitGetById(RegisterID* dst, RegisterID* base, co m_codeBlock->addPropertyAccessInstruction(instructions().size()); #endif - emitOpcode(op_get_by_id); + ValueProfile* profile = emitProfiledOpcode(op_get_by_id); instructions().append(dst->index()); instructions().append(base->index()); instructions().append(addConstant(property)); @@ -1498,6 +1533,7 @@ RegisterID* BytecodeGenerator::emitGetById(RegisterID* dst, RegisterID* base, co instructions().append(0); instructions().append(0); instructions().append(0); + instructions().append(profile); return dst; } @@ -1547,22 +1583,13 @@ RegisterID* BytecodeGenerator::emitDirectPutById(RegisterID* base, const Identif return value; } -RegisterID* BytecodeGenerator::emitPutGetter(RegisterID* base, const Identifier& property, RegisterID* value) +void BytecodeGenerator::emitPutGetterSetter(RegisterID* base, const Identifier& property, RegisterID* getter, RegisterID* setter) { - emitOpcode(op_put_getter); + emitOpcode(op_put_getter_setter); instructions().append(base->index()); instructions().append(addConstant(property)); - instructions().append(value->index()); - return value; -} - -RegisterID* BytecodeGenerator::emitPutSetter(RegisterID* base, const Identifier& property, RegisterID* value) -{ - emitOpcode(op_put_setter); - instructions().append(base->index()); - instructions().append(addConstant(property)); - instructions().append(value->index()); - return value; + instructions().append(getter->index()); + instructions().append(setter->index()); } RegisterID* BytecodeGenerator::emitDeleteById(RegisterID* dst, RegisterID* base, const Identifier& property) @@ -1576,11 +1603,12 @@ RegisterID* BytecodeGenerator::emitDeleteById(RegisterID* dst, RegisterID* base, RegisterID* BytecodeGenerator::emitGetArgumentByVal(RegisterID* dst, RegisterID* base, RegisterID* property) { - emitOpcode(op_get_argument_by_val); + ValueProfile* profile = emitProfiledOpcode(op_get_argument_by_val); instructions().append(dst->index()); ASSERT(base->index() == m_codeBlock->argumentsRegister()); instructions().append(base->index()); instructions().append(property->index()); + instructions().append(profile); return dst; } @@ -1599,10 +1627,11 @@ RegisterID* BytecodeGenerator::emitGetByVal(RegisterID* dst, RegisterID* base, R return dst; } } - emitOpcode(op_get_by_val); + ValueProfile* profile = emitProfiledOpcode(op_get_by_val); instructions().append(dst->index()); instructions().append(base->index()); instructions().append(property->index()); + instructions().append(profile); return dst; } @@ -1824,8 +1853,9 @@ RegisterID* BytecodeGenerator::emitCall(OpcodeID opcodeID, RegisterID* dst, Regi instructions().append(0); instructions().append(0); if (dst != ignoredResult()) { - emitOpcode(op_call_put_result); + ValueProfile* profile = emitProfiledOpcode(op_call_put_result); instructions().append(dst->index()); // dst + instructions().append(profile); } if (m_shouldEmitProfileHooks) { @@ -1853,8 +1883,9 @@ RegisterID* BytecodeGenerator::emitCallVarargs(RegisterID* dst, RegisterID* func instructions().append(arguments->index()); instructions().append(firstFreeRegister->index()); if (dst != ignoredResult()) { - emitOpcode(op_call_put_result); + ValueProfile* profile = emitProfiledOpcode(op_call_put_result); instructions().append(dst->index()); + instructions().append(profile); } if (m_shouldEmitProfileHooks) { emitOpcode(op_profile_did_call); @@ -1926,8 +1957,9 @@ RegisterID* BytecodeGenerator::emitConstruct(RegisterID* dst, RegisterID* func, instructions().append(0); instructions().append(0); if (dst != ignoredResult()) { - emitOpcode(op_call_put_result); + ValueProfile* profile = emitProfiledOpcode(op_call_put_result); instructions().append(dst->index()); // dst + instructions().append(profile); } if (m_shouldEmitProfileHooks) { @@ -2362,7 +2394,7 @@ void BytecodeGenerator::setIsNumericCompareFunction(bool isNumericCompareFunctio bool BytecodeGenerator::isArgumentNumber(const Identifier& ident, int argumentNumber) { - RegisterID* registerID = registerFor(ident); + RegisterID* registerID = resolve(ident).local(); if (!registerID || registerID->index() >= 0) return 0; return registerID->index() == CallFrame::argumentOffset(argumentNumber); diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h index 3ff5f2343..c9ec5d852 100644 --- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h +++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h @@ -1,6 +1,7 @@ /* * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2008 Cameron Zwarich + * Copyright (C) 2012 Igalia, S.L. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -85,6 +86,144 @@ namespace JSC { RefPtr propertyRegister; }; + class ResolveResult { + public: + enum Flags { + // The property is locally bound, in a register. + RegisterFlag = 0x1, + // We need to traverse the scope chain at runtime, checking for + // non-strict eval and/or `with' nodes. + DynamicFlag = 0x2, + // The property was resolved to a definite location, and the + // identifier is not needed any more. + StaticFlag = 0x4, + // Once we have the base object, the property will be located at a + // known index. + IndexedFlag = 0x8, + // Skip some number of objects in the scope chain, given by "depth". + ScopedFlag = 0x10, + // The resolved binding is immutable. + ReadOnlyFlag = 0x20, + // The base object is the global object. + GlobalFlag = 0x40 + }; + enum Type { + // The property is local, and stored in a register. + Register = RegisterFlag | StaticFlag, + // A read-only local, created by "const". + ReadOnlyRegister = RegisterFlag | ReadOnlyFlag | StaticFlag, + // The property is statically scoped free variable. Its coordinates + // are in "index" and "depth". + Lexical = IndexedFlag | ScopedFlag | StaticFlag, + // A read-only Lexical, created by "const". + ReadOnlyLexical = IndexedFlag | ScopedFlag | ReadOnlyFlag | StaticFlag, + // The property was not bound lexically, so at runtime we should + // look directly in the global object. + Global = GlobalFlag, + // Like Global, but we could actually resolve the property to a + // DontDelete property in the global object, for instance, any + // binding created with "var" at the top level. At runtime we'll + // just index into the global object. + IndexedGlobal = IndexedFlag | GlobalFlag | StaticFlag, + // Like IndexedGlobal, but the property is also read-only, like NaN, + // Infinity, or undefined. + ReadOnlyIndexedGlobal = IndexedFlag | ReadOnlyFlag | GlobalFlag | StaticFlag, + // The property could not be resolved statically, due to the + // presence of `with' blocks. At runtime we'll have to walk the + // scope chain. ScopedFlag is set to indicate that "depth" will + // hold some number of nodes to skip in the scope chain, before + // beginning the search. + Dynamic = DynamicFlag | ScopedFlag, + // The property was located as a statically scoped free variable, + // but while traversing the scope chain, there was an intermediate + // activation that used non-strict `eval'. At runtime we'll have to + // check for the absence of this property in those intervening + // scopes. + DynamicLexical = DynamicFlag | IndexedFlag | ScopedFlag, + // Like ReadOnlyLexical, but with intervening non-strict `eval'. + DynamicReadOnlyLexical = DynamicFlag | IndexedFlag | ScopedFlag | ReadOnlyFlag, + // Like Global, but with intervening non-strict `eval'. As with + // Dynamic, ScopeFlag is set to indicate that "depth" does indeed + // store a number of frames to skip before doing the dynamic checks. + DynamicGlobal = DynamicFlag | GlobalFlag | ScopedFlag, + // Like IndexedGlobal, but with intervening non-strict `eval'. + DynamicIndexedGlobal = DynamicFlag | IndexedFlag | GlobalFlag | ScopedFlag, + // Like ReadOnlyIndexedGlobal, but with intervening non-strict + // `eval'. + DynamicReadOnlyIndexedGlobal = DynamicFlag | IndexedFlag | ReadOnlyFlag | GlobalFlag | ScopedFlag, + }; + + static ResolveResult registerResolve(RegisterID *local, unsigned flags) + { + return ResolveResult(Register | flags, local, missingSymbolMarker(), 0, 0); + } + static ResolveResult dynamicResolve(size_t depth) + { + return ResolveResult(Dynamic, 0, missingSymbolMarker(), depth, 0); + } + static ResolveResult lexicalResolve(int index, size_t depth, unsigned flags) + { + unsigned type = (flags & DynamicFlag) ? DynamicLexical : Lexical; + return ResolveResult(type | flags, 0, index, depth, 0); + } + static ResolveResult indexedGlobalResolve(int index, JSObject *globalObject, unsigned flags) + { + return ResolveResult(IndexedGlobal | flags, 0, index, 0, globalObject); + } + static ResolveResult dynamicIndexedGlobalResolve(int index, size_t depth, JSObject *globalObject, unsigned flags) + { + return ResolveResult(DynamicIndexedGlobal | flags, 0, index, depth, globalObject); + } + static ResolveResult globalResolve(JSObject *globalObject) + { + return ResolveResult(Global, 0, missingSymbolMarker(), 0, globalObject); + } + static ResolveResult dynamicGlobalResolve(size_t dynamicDepth, JSObject *globalObject) + { + return ResolveResult(DynamicGlobal, 0, missingSymbolMarker(), dynamicDepth, globalObject); + } + + unsigned type() const { return m_type; } + // Returns the register corresponding to a local variable, or 0 if no + // such register exists. Registers returned by ResolveResult::local() do + // not require explicit reference counting. + RegisterID* local() const { return m_local; } + int index() const { ASSERT (isIndexed() || isRegister()); return m_index; } + size_t depth() const { ASSERT(isScoped()); return m_depth; } + JSObject* globalObject() const { ASSERT(isGlobal()); ASSERT(m_globalObject); return m_globalObject; } + + bool isRegister() const { return m_type & RegisterFlag; } + bool isDynamic() const { return m_type & DynamicFlag; } + bool isStatic() const { return m_type & StaticFlag; } + bool isIndexed() const { return m_type & IndexedFlag; } + bool isScoped() const { return m_type & ScopedFlag; } + bool isReadOnly() const { return (m_type & ReadOnlyFlag) && !isDynamic(); } + bool isGlobal() const { return m_type & GlobalFlag; } + + private: + ResolveResult(unsigned type, RegisterID* local, int index, size_t depth, JSObject* globalObject) + : m_type(type) + , m_index(index) + , m_local(local) + , m_depth(depth) + , m_globalObject(globalObject) + { +#ifndef NDEBUG + checkValidity(); +#endif + } + +#ifndef NDEBUG + void checkValidity(); +#endif + + unsigned m_type; + int m_index; // Index in scope, if IndexedFlag is set + RegisterID* m_local; // Local register, if RegisterFlag is set + size_t m_depth; // Depth in scope chain, if ScopedFlag is set + JSObject* m_globalObject; // If GlobalFlag is set. + }; + class BytecodeGenerator { WTF_MAKE_FAST_ALLOCATED; public: @@ -107,11 +246,6 @@ namespace JSC { JSObject* generate(); - // Returns the register corresponding to a local variable, or 0 if no - // such register exists. Registers returned by registerFor do not - // require explicit reference counting. - RegisterID* registerFor(const Identifier&); - bool isArgumentNumber(const Identifier&, int); void setIsNumericCompareFunction(bool isNumericCompareFunction); @@ -119,17 +253,11 @@ namespace JSC { bool willResolveToArguments(const Identifier&); RegisterID* uncheckedRegisterForArguments(); - // Behaves as registerFor does, but ignores dynamic scope as + // Resolve an identifier, given the current compile-time scope chain. + ResolveResult resolve(const Identifier&); + // Behaves as resolve does, but ignores dynamic scope as // dynamic scope should not interfere with const initialisation - RegisterID* constRegisterFor(const Identifier&); - - // Searches the scope chain in an attempt to statically locate the requested - // property. Returns false if for any reason the property cannot be safely - // optimised at all. Otherwise it will return the index and depth of the - // VariableObject that defines the property. If the property cannot be found - // statically, depth will contain the depth of the scope chain where dynamic - // lookup must begin. - bool findScopedProperty(const Identifier&, int& index, size_t& depth, bool forWriting, bool& includesDynamicScopes, JSObject*& globalObject); + ResolveResult resolveConstDecl(const Identifier&); // Returns the register storing "this" RegisterID* thisRegister() { return &m_thisRegister; } @@ -274,7 +402,7 @@ namespace JSC { return dst; } - return PassRefPtr(emitNode(n)); + return emitNode(n); } RegisterID* emitLoad(RegisterID* dst, bool); @@ -309,14 +437,14 @@ namespace JSC { RegisterID* emitTypeOf(RegisterID* dst, RegisterID* src) { return emitUnaryOp(op_typeof, dst, src); } RegisterID* emitIn(RegisterID* dst, RegisterID* property, RegisterID* base) { return emitBinaryOp(op_in, dst, property, base, OperandTypes()); } - RegisterID* emitResolve(RegisterID* dst, const Identifier& property); - RegisterID* emitGetScopedVar(RegisterID* dst, size_t skip, int index, JSValue globalObject); - RegisterID* emitPutScopedVar(size_t skip, int index, RegisterID* value, JSValue globalObject); + RegisterID* emitGetStaticVar(RegisterID* dst, const ResolveResult&); + RegisterID* emitPutStaticVar(const ResolveResult&, RegisterID* value); - RegisterID* emitResolveBase(RegisterID* dst, const Identifier& property); - RegisterID* emitResolveBaseForPut(RegisterID* dst, const Identifier& property); - RegisterID* emitResolveWithBase(RegisterID* baseDst, RegisterID* propDst, const Identifier& property); - RegisterID* emitResolveWithThis(RegisterID* baseDst, RegisterID* propDst, const Identifier& property); + RegisterID* emitResolve(RegisterID* dst, const ResolveResult&, const Identifier& property); + RegisterID* emitResolveBase(RegisterID* dst, const ResolveResult&, const Identifier& property); + RegisterID* emitResolveBaseForPut(RegisterID* dst, const ResolveResult&, const Identifier& property); + RegisterID* emitResolveWithBase(RegisterID* baseDst, RegisterID* propDst, const ResolveResult&, const Identifier& property); + RegisterID* emitResolveWithThis(RegisterID* baseDst, RegisterID* propDst, const ResolveResult&, const Identifier& property); void emitMethodCheck(); @@ -330,8 +458,7 @@ namespace JSC { RegisterID* emitPutByVal(RegisterID* base, RegisterID* property, RegisterID* value); RegisterID* emitDeleteByVal(RegisterID* dst, RegisterID* base, RegisterID* property); RegisterID* emitPutByIndex(RegisterID* base, unsigned index, RegisterID* value); - RegisterID* emitPutGetter(RegisterID* base, const Identifier& property, RegisterID* value); - RegisterID* emitPutSetter(RegisterID* base, const Identifier& property, RegisterID* value); + void emitPutGetterSetter(RegisterID* base, const Identifier& property, RegisterID* getter, RegisterID* setter); RegisterID* emitCall(RegisterID* dst, RegisterID* func, CallArguments&, unsigned divot, unsigned startOffset, unsigned endOffset); RegisterID* emitCallEval(RegisterID* dst, RegisterID* func, CallArguments&, unsigned divot, unsigned startOffset, unsigned endOffset); @@ -409,6 +536,7 @@ namespace JSC { private: void emitOpcode(OpcodeID); + ValueProfile* emitProfiledOpcode(OpcodeID); void retrieveLastBinaryOp(int& dstIndex, int& src1Index, int& src2Index); void retrieveLastUnaryOp(int& dstIndex, int& srcIndex); ALWAYS_INLINE void rewindBinaryOp(); @@ -466,12 +594,12 @@ namespace JSC { FunctionExecutable* makeFunction(ExecState* exec, FunctionBodyNode* body) { - return FunctionExecutable::create(exec, body->ident(), body->source(), body->usesArguments(), body->parameters(), body->isStrictMode(), body->lineNo(), body->lastLine()); + return FunctionExecutable::create(exec, body->ident(), body->inferredName(), body->source(), body->usesArguments(), body->parameters(), body->isStrictMode(), body->lineNo(), body->lastLine()); } FunctionExecutable* makeFunction(JSGlobalData* globalData, FunctionBodyNode* body) { - return FunctionExecutable::create(*globalData, body->ident(), body->source(), body->usesArguments(), body->parameters(), body->isStrictMode(), body->lineNo(), body->lastLine()); + return FunctionExecutable::create(*globalData, body->ident(), body->inferredName(), body->source(), body->usesArguments(), body->parameters(), body->isStrictMode(), body->lineNo(), body->lastLine()); } JSString* addStringConstant(const Identifier&); diff --git a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp index a0127d8d7..46ec698de 100644 --- a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp +++ b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp @@ -5,6 +5,7 @@ * Copyright (C) 2007 Cameron Zwarich (cwzwarich@uwaterloo.ca) * Copyright (C) 2007 Maks Orlovich * Copyright (C) 2007 Eric Seidel + * Copyright (C) 2012 Igalia, S.L. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -146,14 +147,15 @@ bool ResolveNode::isPure(BytecodeGenerator& generator) const RegisterID* ResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) { - if (RegisterID* local = generator.registerFor(m_ident)) { + ResolveResult resolveResult = generator.resolve(m_ident); + if (RegisterID* local = resolveResult.local()) { if (dst == generator.ignoredResult()) return 0; return generator.moveToDestinationIfNeeded(dst, local); } generator.emitExpressionInfo(m_startOffset + m_ident.length(), m_ident.length(), 0); - return generator.emitResolve(generator.finalDestination(dst), m_ident); + return generator.emitResolve(generator.finalDestination(dst), resolveResult, m_ident); } // ------------------------------ ArrayNode ------------------------------------ @@ -236,27 +238,79 @@ RegisterID* PropertyListNode::emitBytecode(BytecodeGenerator& generator, Registe generator.emitNewObject(newObj.get()); - for (PropertyListNode* p = this; p; p = p->m_next) { - RegisterID* value = generator.emitNode(p->m_node->m_assign); - - switch (p->m_node->m_type) { - case PropertyNode::Constant: { - generator.emitDirectPutById(newObj.get(), p->m_node->name(), value); - break; - } - case PropertyNode::Getter: { - generator.emitPutGetter(newObj.get(), p->m_node->name(), value); - break; + // Fast case: this loop just handles regular value properties. + PropertyListNode* p = this; + for (; p && p->m_node->m_type == PropertyNode::Constant; p = p->m_next) + generator.emitDirectPutById(newObj.get(), p->m_node->name(), generator.emitNode(p->m_node->m_assign)); + + // Were there any get/set properties? + if (p) { + typedef std::pair GetterSetterPair; + typedef HashMap GetterSetterMap; + GetterSetterMap map; + + // Build a map, pairing get/set values together. + for (PropertyListNode* q = p; q; q = q->m_next) { + PropertyNode* node = q->m_node; + if (node->m_type == PropertyNode::Constant) + continue; + + GetterSetterPair pair(node, 0); + std::pair result = map.add(node->name().impl(), pair); + if (!result.second) + result.first->second.second = node; + } + + // Iterate over the remaining properties in the list. + for (; p; p = p->m_next) { + PropertyNode* node = p->m_node; + RegisterID* value = generator.emitNode(node->m_assign); + + // Handle regular values. + if (node->m_type == PropertyNode::Constant) { + generator.emitDirectPutById(newObj.get(), node->name(), value); + continue; } - case PropertyNode::Setter: { - generator.emitPutSetter(newObj.get(), p->m_node->name(), value); - break; + + // This is a get/set property, find its entry in the map. + ASSERT(node->m_type == PropertyNode::Getter || node->m_type == PropertyNode::Setter); + GetterSetterMap::iterator it = map.find(node->name().impl()); + ASSERT(it != map.end()); + GetterSetterPair& pair = it->second; + + // Was this already generated as a part of its partner? + if (pair.second == node) + continue; + + // Generate the paired node now. + RefPtr getterReg; + RefPtr setterReg; + + if (node->m_type == PropertyNode::Getter) { + getterReg = value; + if (pair.second) { + ASSERT(pair.second->m_type == PropertyNode::Setter); + setterReg = generator.emitNode(pair.second->m_assign); + } else { + setterReg = generator.newTemporary(); + generator.emitLoad(setterReg.get(), jsUndefined()); + } + } else { + ASSERT(node->m_type == PropertyNode::Setter); + setterReg = value; + if (pair.second) { + ASSERT(pair.second->m_type == PropertyNode::Getter); + getterReg = generator.emitNode(pair.second->m_assign); + } else { + getterReg = generator.newTemporary(); + generator.emitLoad(getterReg.get(), jsUndefined()); + } } - default: - ASSERT_NOT_REACHED(); + + generator.emitPutGetterSetter(newObj.get(), node->name(), getterReg.get(), setterReg.get()); } } - + return generator.moveToDestinationIfNeeded(dst, newObj.get()); } @@ -346,7 +400,7 @@ RegisterID* EvalFunctionCallNode::emitBytecode(BytecodeGenerator& generator, Reg RefPtr func = generator.tempDestination(dst); CallArguments callArguments(generator, m_args); generator.emitExpressionInfo(divot() - startOffset() + 4, 4, 0); - generator.emitResolveWithThis(callArguments.thisRegister(), func.get(), generator.propertyNames().eval); + generator.emitResolveWithThis(callArguments.thisRegister(), func.get(), generator.resolve(generator.propertyNames().eval), generator.propertyNames().eval); return generator.emitCallEval(generator.finalDestination(dst, func.get()), func.get(), callArguments, divot(), startOffset(), endOffset()); } @@ -364,19 +418,19 @@ RegisterID* FunctionCallValueNode::emitBytecode(BytecodeGenerator& generator, Re RegisterID* FunctionCallResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) { - if (RefPtr local = generator.registerFor(m_ident)) { + ResolveResult resolveResult = generator.resolve(m_ident); + + if (RegisterID* local = resolveResult.local()) { + RefPtr func = generator.emitMove(generator.tempDestination(dst), local); CallArguments callArguments(generator, m_args); generator.emitLoad(callArguments.thisRegister(), jsUndefined()); - return generator.emitCall(generator.finalDestinationOrIgnored(dst, callArguments.thisRegister()), local.get(), callArguments, divot(), startOffset(), endOffset()); + return generator.emitCall(generator.finalDestinationOrIgnored(dst, callArguments.thisRegister()), func.get(), callArguments, divot(), startOffset(), endOffset()); } - int index = 0; - size_t depth = 0; - JSObject* globalObject = 0; - bool requiresDynamicChecks = false; - if (generator.findScopedProperty(m_ident, index, depth, false, requiresDynamicChecks, globalObject) && index != missingSymbolMarker() && !requiresDynamicChecks) { - RefPtr func = generator.emitGetScopedVar(generator.newTemporary(), depth, index, globalObject); + if (resolveResult.isStatic()) { + RefPtr func = generator.newTemporary(); CallArguments callArguments(generator, m_args); + generator.emitGetStaticVar(func.get(), resolveResult); generator.emitLoad(callArguments.thisRegister(), jsUndefined()); return generator.emitCall(generator.finalDestinationOrIgnored(dst, func.get()), func.get(), callArguments, divot(), startOffset(), endOffset()); } @@ -384,8 +438,9 @@ RegisterID* FunctionCallResolveNode::emitBytecode(BytecodeGenerator& generator, RefPtr func = generator.newTemporary(); CallArguments callArguments(generator, m_args); int identifierStart = divot() - startOffset(); + generator.emitExpressionInfo(identifierStart + m_ident.length(), m_ident.length(), 0); - generator.emitResolveWithThis(callArguments.thisRegister(), func.get(), m_ident); + generator.emitResolveWithThis(callArguments.thisRegister(), func.get(), resolveResult, m_ident); return generator.emitCall(generator.finalDestinationOrIgnored(dst, func.get()), func.get(), callArguments, divot(), startOffset(), endOffset()); } @@ -505,6 +560,7 @@ RegisterID* ApplyFunctionCallDotNode::emitBytecode(BytecodeGenerator& generator, RefPtr profileHookRegister; if (generator.shouldEmitProfileHooks()) profileHookRegister = generator.newTemporary(); + RefPtr realFunction = generator.emitMove(generator.tempDestination(dst), base.get()); RefPtr thisRegister = generator.emitNode(m_args->m_listNode->m_expr); RefPtr argsRegister; ArgumentListNode* args = m_args->m_listNode->m_next; @@ -518,7 +574,7 @@ RegisterID* ApplyFunctionCallDotNode::emitBytecode(BytecodeGenerator& generator, while ((args = args->m_next)) generator.emitNode(args->m_expr); - generator.emitCallVarargs(finalDestinationOrIgnored.get(), base.get(), thisRegister.get(), argsRegister.get(), generator.newTemporary(), profileHookRegister.get(), divot(), startOffset(), endOffset()); + generator.emitCallVarargs(finalDestinationOrIgnored.get(), realFunction.get(), thisRegister.get(), argsRegister.get(), generator.newTemporary(), profileHookRegister.get(), divot(), startOffset(), endOffset()); } generator.emitJump(end.get()); } @@ -548,24 +604,21 @@ static RegisterID* emitPostIncOrDec(BytecodeGenerator& generator, RegisterID* ds RegisterID* PostfixResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) { - if (RegisterID* local = generator.registerFor(m_ident)) { - if (generator.isLocalConstant(m_ident)) { + ResolveResult resolveResult = generator.resolve(m_ident); + + if (RegisterID* local = resolveResult.local()) { + if (resolveResult.isReadOnly()) { if (dst == generator.ignoredResult()) return 0; return generator.emitToJSNumber(generator.finalDestination(dst), local); } - if (dst == generator.ignoredResult()) return emitPreIncOrDec(generator, local, m_operator); return emitPostIncOrDec(generator, generator.finalDestination(dst), local, m_operator); } - int index = 0; - size_t depth = 0; - JSObject* globalObject = 0; - bool requiresDynamicChecks = false; - if (generator.findScopedProperty(m_ident, index, depth, true, requiresDynamicChecks, globalObject) && index != missingSymbolMarker() && !requiresDynamicChecks) { - RefPtr value = generator.emitGetScopedVar(generator.newTemporary(), depth, index, globalObject); + if (resolveResult.isStatic() && !resolveResult.isReadOnly()) { + RefPtr value = generator.emitGetStaticVar(generator.newTemporary(), resolveResult); RegisterID* oldValue; if (dst == generator.ignoredResult()) { oldValue = 0; @@ -573,13 +626,13 @@ RegisterID* PostfixResolveNode::emitBytecode(BytecodeGenerator& generator, Regis } else { oldValue = emitPostIncOrDec(generator, generator.finalDestination(dst), value.get(), m_operator); } - generator.emitPutScopedVar(depth, index, value.get(), globalObject); + generator.emitPutStaticVar(resolveResult, value.get()); return oldValue; } - + generator.emitExpressionInfo(divot(), startOffset(), endOffset()); RefPtr value = generator.newTemporary(); - RefPtr base = generator.emitResolveWithBase(generator.newTemporary(), value.get(), m_ident); + RefPtr base = generator.emitResolveWithBase(generator.newTemporary(), value.get(), resolveResult, m_ident); RegisterID* oldValue; if (dst == generator.ignoredResult()) { oldValue = 0; @@ -651,11 +704,12 @@ RegisterID* PostfixErrorNode::emitBytecode(BytecodeGenerator& generator, Registe RegisterID* DeleteResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) { - if (generator.registerFor(m_ident)) + ResolveResult resolveResult = generator.resolve(m_ident); + if (resolveResult.isRegister()) return generator.emitLoad(generator.finalDestination(dst), false); generator.emitExpressionInfo(divot(), startOffset(), endOffset()); - RegisterID* base = generator.emitResolveBase(generator.tempDestination(dst), m_ident); + RegisterID* base = generator.emitResolveBase(generator.tempDestination(dst), resolveResult, m_ident); return generator.emitDeleteById(generator.finalDestination(dst, base), base, m_ident); } @@ -706,13 +760,14 @@ RegisterID* VoidNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst RegisterID* TypeOfResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) { - if (RegisterID* local = generator.registerFor(m_ident)) { + ResolveResult resolveResult = generator.resolve(m_ident); + if (RegisterID* local = resolveResult.local()) { if (dst == generator.ignoredResult()) return 0; return generator.emitTypeOf(generator.finalDestination(dst), local); } - RefPtr scratch = generator.emitResolveBase(generator.tempDestination(dst), m_ident); + RefPtr scratch = generator.emitResolveBase(generator.tempDestination(dst), resolveResult, m_ident); generator.emitGetById(scratch.get(), scratch.get(), m_ident); if (dst == generator.ignoredResult()) return 0; @@ -735,32 +790,28 @@ RegisterID* TypeOfValueNode::emitBytecode(BytecodeGenerator& generator, Register RegisterID* PrefixResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) { - if (RegisterID* local = generator.registerFor(m_ident)) { + ResolveResult resolveResult = generator.resolve(m_ident); + if (RegisterID* local = resolveResult.local()) { if (generator.isLocalConstant(m_ident)) { if (dst == generator.ignoredResult()) return 0; RefPtr r0 = generator.emitLoad(generator.finalDestination(dst), (m_operator == OpPlusPlus) ? 1.0 : -1.0); return generator.emitBinaryOp(op_add, r0.get(), local, r0.get(), OperandTypes()); } - emitPreIncOrDec(generator, local, m_operator); return generator.moveToDestinationIfNeeded(dst, local); } - int index = 0; - size_t depth = 0; - JSObject* globalObject = 0; - bool requiresDynamicChecks = false; - if (generator.findScopedProperty(m_ident, index, depth, true, requiresDynamicChecks, globalObject) && index != missingSymbolMarker() && !requiresDynamicChecks) { - RefPtr propDst = generator.emitGetScopedVar(generator.tempDestination(dst), depth, index, globalObject); + if (resolveResult.isStatic() && !resolveResult.isReadOnly()) { + RefPtr propDst = generator.emitGetStaticVar(generator.tempDestination(dst), resolveResult); emitPreIncOrDec(generator, propDst.get(), m_operator); - generator.emitPutScopedVar(depth, index, propDst.get(), globalObject); + generator.emitPutStaticVar(resolveResult, propDst.get()); return generator.moveToDestinationIfNeeded(dst, propDst.get()); } generator.emitExpressionInfo(divot(), startOffset(), endOffset()); RefPtr propDst = generator.tempDestination(dst); - RefPtr base = generator.emitResolveWithBase(generator.newTemporary(), propDst.get(), m_ident); + RefPtr base = generator.emitResolveWithBase(generator.newTemporary(), propDst.get(), resolveResult, m_ident); emitPreIncOrDec(generator, propDst.get(), m_operator); generator.emitPutById(base.get(), m_ident, propDst.get()); return generator.moveToDestinationIfNeeded(dst, propDst.get()); @@ -1148,10 +1199,11 @@ static ALWAYS_INLINE RegisterID* emitReadModifyAssignment(BytecodeGenerator& gen RegisterID* ReadModifyResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) { - if (RegisterID* local = generator.registerFor(m_ident)) { - if (generator.isLocalConstant(m_ident)) { + ResolveResult resolveResult = generator.resolve(m_ident); + + if (RegisterID *local = resolveResult.local()) { + if (resolveResult.isReadOnly()) return emitReadModifyAssignment(generator, generator.finalDestination(dst), local, m_right, m_operator, OperandTypes(ResultType::unknownType(), m_right->resultDescriptor())); - } if (generator.leftHandSideNeedsCopy(m_rightHasAssignments, m_right->isPure(generator))) { RefPtr result = generator.newTemporary(); @@ -1165,20 +1217,16 @@ RegisterID* ReadModifyResolveNode::emitBytecode(BytecodeGenerator& generator, Re return generator.moveToDestinationIfNeeded(dst, result); } - int index = 0; - size_t depth = 0; - JSObject* globalObject = 0; - bool requiresDynamicChecks = false; - if (generator.findScopedProperty(m_ident, index, depth, true, requiresDynamicChecks, globalObject) && index != missingSymbolMarker() && !requiresDynamicChecks) { - RefPtr src1 = generator.emitGetScopedVar(generator.tempDestination(dst), depth, index, globalObject); + if (resolveResult.isStatic() && !resolveResult.isReadOnly()) { + RefPtr src1 = generator.emitGetStaticVar(generator.tempDestination(dst), resolveResult); RegisterID* result = emitReadModifyAssignment(generator, generator.finalDestination(dst, src1.get()), src1.get(), m_right, m_operator, OperandTypes(ResultType::unknownType(), m_right->resultDescriptor())); - generator.emitPutScopedVar(depth, index, result, globalObject); + generator.emitPutStaticVar(resolveResult, result); return result; } RefPtr src1 = generator.tempDestination(dst); generator.emitExpressionInfo(divot() - startOffset() + m_ident.length(), m_ident.length(), 0); - RefPtr base = generator.emitResolveWithBase(generator.newTemporary(), src1.get(), m_ident); + RefPtr base = generator.emitResolveWithBase(generator.newTemporary(), src1.get(), resolveResult, m_ident); RegisterID* result = emitReadModifyAssignment(generator, generator.finalDestination(dst, src1.get()), src1.get(), m_right, m_operator, OperandTypes(ResultType::unknownType(), m_right->resultDescriptor()), this); return generator.emitPutById(base.get(), m_ident, result); } @@ -1187,27 +1235,24 @@ RegisterID* ReadModifyResolveNode::emitBytecode(BytecodeGenerator& generator, Re RegisterID* AssignResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) { - if (RegisterID* local = generator.registerFor(m_ident)) { - if (generator.isLocalConstant(m_ident)) + ResolveResult resolveResult = generator.resolve(m_ident); + + if (RegisterID *local = resolveResult.local()) { + if (resolveResult.isReadOnly()) return generator.emitNode(dst, m_right); - RegisterID* result = generator.emitNode(local, m_right); return generator.moveToDestinationIfNeeded(dst, result); } - int index = 0; - size_t depth = 0; - JSObject* globalObject = 0; - bool requiresDynamicChecks = false; - if (generator.findScopedProperty(m_ident, index, depth, true, requiresDynamicChecks, globalObject) && index != missingSymbolMarker() && !requiresDynamicChecks) { + if (resolveResult.isStatic() && !resolveResult.isReadOnly()) { if (dst == generator.ignoredResult()) dst = 0; RegisterID* value = generator.emitNode(dst, m_right); - generator.emitPutScopedVar(depth, index, value, globalObject); + generator.emitPutStaticVar(resolveResult, value); return value; } - RefPtr base = generator.emitResolveBaseForPut(generator.newTemporary(), m_ident); + RefPtr base = generator.emitResolveBaseForPut(generator.newTemporary(), resolveResult, m_ident); if (dst == generator.ignoredResult()) dst = 0; RegisterID* value = generator.emitNode(dst, m_right); @@ -1295,8 +1340,10 @@ RegisterID* CommaNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds RegisterID* ConstDeclNode::emitCodeSingle(BytecodeGenerator& generator) { + ResolveResult resolveResult = generator.resolveConstDecl(m_ident); + // FIXME: This code does not match the behavior of const in Firefox. - if (RegisterID* local = generator.constRegisterFor(m_ident)) { + if (RegisterID* local = resolveResult.local()) { if (!m_init) return local; @@ -1305,27 +1352,15 @@ RegisterID* ConstDeclNode::emitCodeSingle(BytecodeGenerator& generator) RefPtr value = m_init ? generator.emitNode(m_init) : generator.emitLoad(0, jsUndefined()); - ScopeChainIterator iter = generator.scopeChain()->begin(); - ScopeChainIterator end = generator.scopeChain()->end(); - size_t depth = 0; - for (; iter != end; ++iter, ++depth) { - JSObject* currentScope = iter->get(); - if (!currentScope->isVariableObject()) - continue; - JSVariableObject* currentVariableObject = static_cast(currentScope); - SymbolTableEntry entry = currentVariableObject->symbolTable().get(m_ident.impl()); - if (entry.isNull()) - continue; - - return generator.emitPutScopedVar(generator.scopeDepth() + depth, entry.getIndex(), value.get(), currentVariableObject->isGlobalObject() ? currentVariableObject : 0); - } - + if (resolveResult.isStatic()) + return generator.emitPutStaticVar(resolveResult, value.get()); + if (generator.codeType() != EvalCode) return value.get(); // FIXME: While this code should only be hit in an eval block, it will assign // to the wrong base if m_ident exists in an intervening with scope. - RefPtr base = generator.emitResolveBase(generator.newTemporary(), m_ident); + RefPtr base = generator.emitResolveBase(generator.newTemporary(), resolveResult, m_ident); return generator.emitPutById(base.get(), m_ident, value.get()); } @@ -1596,11 +1631,12 @@ RegisterID* ForInNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds bool optimizedForinAccess = false; if (m_lexpr->isResolveNode()) { const Identifier& ident = static_cast(m_lexpr)->identifier(); - propertyName = generator.registerFor(ident); + ResolveResult resolveResult = generator.resolve(ident); + propertyName = resolveResult.local(); if (!propertyName) { propertyName = generator.newTemporary(); RefPtr protect = propertyName; - RegisterID* base = generator.emitResolveBaseForPut(generator.newTemporary(), ident); + RegisterID* base = generator.emitResolveBaseForPut(generator.newTemporary(), resolveResult, ident); generator.emitExpressionInfo(divot(), startOffset(), endOffset()); generator.emitPutById(base, ident, propertyName); @@ -1933,13 +1969,7 @@ RegisterID* TryNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) // Uncaught exception path: the catch block. RefPtr