Changeset 149527 in webkit
- Timestamp:
- May 3, 2013, 11:46:45 AM (13 years ago)
- Location:
- branches/dfgFourthTier
- Files:
-
- 81 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/sputnik/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A2-expected.txt (modified) (1 diff)
-
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.10_String.prototype.match/S15.5.4.10_A1_T3-expected.txt (modified) (1 diff)
-
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.11_String.prototype.replace/S15.5.4.11_A1_T3-expected.txt (modified) (1 diff)
-
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A1_T3-expected.txt (modified) (1 diff)
-
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.13_String.prototype.slice/S15.5.4.13_A1_T3-expected.txt (modified) (1 diff)
-
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T3-expected.txt (modified) (1 diff)
-
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T3-expected.txt (modified) (1 diff)
-
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.6_String.prototype.concat/S15.5.4.6_A1_T3-expected.txt (modified) (1 diff)
-
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A1_T3-expected.txt (modified) (1 diff)
-
LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T3-expected.txt (modified) (1 diff)
-
Source/JavaScriptCore/API/JSCallbackFunction.cpp (modified) (1 diff)
-
Source/JavaScriptCore/API/JSCallbackObjectFunctions.h (modified) (1 diff)
-
Source/JavaScriptCore/API/JSContextRef.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/API/JSObjectRef.cpp (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/bytecode/CodeBlock.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/bytecode/CodeOrigin.h (modified) (4 diffs)
-
Source/JavaScriptCore/bytecode/Opcode.h (modified) (1 diff)
-
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGAbstractState.cpp (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/dfg/DFGCapabilities.h (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGFixupPhase.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/dfg/DFGGraph.h (modified) (2 diffs)
-
Source/JavaScriptCore/dfg/DFGNodeType.h (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGOperations.cpp (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGOperations.h (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/interpreter/Interpreter.cpp (modified) (4 diffs)
-
Source/JavaScriptCore/interpreter/Interpreter.h (modified) (1 diff)
-
Source/JavaScriptCore/jit/JIT.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/jit/JIT.h (modified) (2 diffs)
-
Source/JavaScriptCore/jit/JITOpcodes.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/jit/JITOpcodes32_64.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/jit/JITStubs.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/jit/JITStubs.h (modified) (1 diff)
-
Source/JavaScriptCore/llint/LLIntData.cpp (modified) (1 diff)
-
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (modified) (1 diff)
-
Source/JavaScriptCore/llint/LLIntSlowPaths.h (modified) (1 diff)
-
Source/JavaScriptCore/llint/LowLevelInterpreter.asm (modified) (1 diff)
-
Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm (modified) (1 diff)
-
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (modified) (1 diff)
-
Source/JavaScriptCore/profiler/ProfileGenerator.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/CallData.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/ClassInfo.h (modified) (2 diffs)
-
Source/JavaScriptCore/runtime/Completion.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/DatePrototype.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSActivation.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSActivation.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSCJSValue.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSCJSValue.h (modified) (3 diffs)
-
Source/JavaScriptCore/runtime/JSCJSValueInlines.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSCell.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSCell.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSGlobalObject.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSGlobalObject.h (modified) (2 diffs)
-
Source/JavaScriptCore/runtime/JSNameScope.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSNameScope.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSObject.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/runtime/JSObject.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSScope.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSString.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSString.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/PropertySlot.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/runtime/StrictEvalActivation.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/StrictEvalActivation.h (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/WebCore.order (modified) (1 diff)
-
Source/WebCore/bindings/js/JSErrorHandler.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/JSMainThreadExecState.h (modified) (1 diff)
-
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (modified) (1 diff)
-
Source/WebCore/bridge/NP_jsobject.cpp (modified) (1 diff)
-
Source/WebKit/mac/ChangeLog (modified) (1 diff)
-
Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm (modified) (2 diffs)
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/dfgFourthTier/LayoutTests/ChangeLog
r147604 r149527 1 2013-05-03 Geoffrey Garen <ggaren@apple.com> 2 3 Rationalized 'this' value conversion 4 https://bugs.webkit.org/show_bug.cgi?id=115542 5 6 Reviewed by Filip Pizlo. 7 8 We pass these tests now: 9 10 * sputnik/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A2-expected.txt: 11 * sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.10_String.prototype.match/S15.5.4.10_A1_T3-expected.txt: 12 * sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.11_String.prototype.replace/S15.5.4.11_A1_T3-expected.txt: 13 * sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A1_T3-expected.txt: 14 * sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.13_String.prototype.slice/S15.5.4.13_A1_T3-expected.txt: 15 * sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T3-expected.txt: 16 * sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T3-expected.txt: 17 * sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.6_String.prototype.concat/S15.5.4.6_A1_T3-expected.txt: 18 * sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A1_T3-expected.txt: 19 * sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T3-expected.txt: 20 1 21 2013-04-03 Filip Pizlo <fpizlo@apple.com> 2 22 -
branches/dfgFourthTier/LayoutTests/sputnik/Conformance/11_Expressions/11.1_Primary_Expressions/11.1.1_The_this_Keyword/S11.1.1_A2-expected.txt
r108729 r149527 1 1 S11.1.1_A2 2 2 3 FAIL SputnikError: #1: this.toString() === toString(). Actual: [object Window] 3 PASS 4 4 5 5 TEST COMPLETE -
branches/dfgFourthTier/LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.10_String.prototype.match/S15.5.4.10_A1_T3-expected.txt
r91344 r149527 1 1 S15.5.4.10_A1_T3 2 2 3 FAIL TypeError: Type error 3 PASS 4 4 5 5 TEST COMPLETE -
branches/dfgFourthTier/LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.11_String.prototype.replace/S15.5.4.11_A1_T3-expected.txt
r91344 r149527 1 1 S15.5.4.11_A1_T3 2 2 3 FAIL TypeError: Type error 3 PASS 4 4 5 5 TEST COMPLETE -
branches/dfgFourthTier/LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A1_T3-expected.txt
r91344 r149527 1 1 S15.5.4.12_A1_T3 2 2 3 FAIL TypeError: Type error 3 PASS 4 4 5 5 TEST COMPLETE -
branches/dfgFourthTier/LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.13_String.prototype.slice/S15.5.4.13_A1_T3-expected.txt
r91344 r149527 1 1 S15.5.4.13_A1_T3 2 2 3 FAIL TypeError: Type error 3 PASS 4 4 5 5 TEST COMPLETE -
branches/dfgFourthTier/LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T3-expected.txt
r91344 r149527 1 1 S15.5.4.14_A1_T3 2 2 3 FAIL TypeError: Type error 3 PASS 4 4 5 5 TEST COMPLETE -
branches/dfgFourthTier/LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T3-expected.txt
r91344 r149527 1 1 S15.5.4.15_A1_T3 2 2 3 FAIL TypeError: Type error 3 PASS 4 4 5 5 TEST COMPLETE -
branches/dfgFourthTier/LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.6_String.prototype.concat/S15.5.4.6_A1_T3-expected.txt
r91344 r149527 1 1 S15.5.4.6_A1_T3 2 2 3 FAIL TypeError: Type error 3 PASS 4 4 5 5 TEST COMPLETE -
branches/dfgFourthTier/LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A1_T3-expected.txt
r91344 r149527 1 1 S15.5.4.7_A1_T3 2 2 3 FAIL TypeError: Type error 3 PASS 4 4 5 5 TEST COMPLETE -
branches/dfgFourthTier/LayoutTests/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A1_T3-expected.txt
r91344 r149527 1 1 S15.5.4.8_A1_T3 2 2 3 FAIL TypeError: Type error 3 PASS 4 4 5 5 TEST COMPLETE -
branches/dfgFourthTier/Source/JavaScriptCore/API/JSCallbackFunction.cpp
r148697 r149527 68 68 JSContextRef execRef = toRef(exec); 69 69 JSObjectRef functionRef = toRef(exec->callee()); 70 JSObjectRef thisObjRef = toRef( exec->hostThisValue().toThisObject(exec));70 JSObjectRef thisObjRef = toRef(jsCast<JSObject*>(exec->hostThisValue().toThis(exec, NotStrictMode))); 71 71 72 72 int argumentCount = static_cast<int>(exec->argumentCount()); -
branches/dfgFourthTier/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r148697 r149527 431 431 JSContextRef execRef = toRef(exec); 432 432 JSObjectRef functionRef = toRef(exec->callee()); 433 JSObjectRef thisObjRef = toRef( exec->hostThisValue().toThisObject(exec));433 JSObjectRef thisObjRef = toRef(jsCast<JSObject*>(exec->hostThisValue().toThis(exec, NotStrictMode))); 434 434 435 435 for (JSClassRef jsClass = jsCast<JSCallbackObject<Parent>*>(toJS(functionRef))->classRef(); jsClass; jsClass = jsClass->parentClass) { -
branches/dfgFourthTier/Source/JavaScriptCore/API/JSContextRef.cpp
r148697 r149527 107 107 if (!globalObjectClass) { 108 108 JSGlobalObject* globalObject = JSGlobalObject::create(*vm, JSGlobalObject::createStructure(*vm, jsNull())); 109 globalObject->setGlobalThis(*vm, JSProxy::create(*vm, JSProxy::createStructure(*vm, globalObject, globalObject->prototype()), globalObject)); 109 110 return JSGlobalContextRetain(toGlobalRef(globalObject->globalExec())); 110 111 } … … 154 155 APIEntryShim entryShim(exec); 155 156 156 // It is necessary to call toThisObject to get the wrapper object when used with WebCore. 157 return toRef(exec->lexicalGlobalObject()->methodTable()->toThisObject(exec->lexicalGlobalObject(), exec)); 157 return toRef(jsCast<JSObject*>(exec->lexicalGlobalObject()->methodTable()->toThis(exec->lexicalGlobalObject(), exec, NotStrictMode))); 158 158 } 159 159 -
branches/dfgFourthTier/Source/JavaScriptCore/API/JSObjectRef.cpp
r148697 r149527 455 455 jsThisObject = exec->globalThisValue(); 456 456 457 jsThisObject = jsThisObject->methodTable()->toThisObject(jsThisObject, exec);458 459 457 MarkedArgumentBuffer argList; 460 458 for (size_t i = 0; i < argumentCount; i++) -
branches/dfgFourthTier/Source/JavaScriptCore/ChangeLog
r149518 r149527 1 2013-05-03 Geoffrey Garen <ggaren@apple.com> 2 3 Rationalized 'this' value conversion 4 https://bugs.webkit.org/show_bug.cgi?id=115542 5 6 Reviewed by Filip Pizlo. 7 8 This fixes a bunch of Sputnik tests. 9 10 The new model is that the callee always performs 'this' value conversion. 11 12 My ultimate goal is to break up resolve_with_this into single-result 13 opcodes. This step avoids having to add a new kind of convert_this for 14 call sites. 15 16 * API/JSCallbackFunction.cpp: 17 (JSC::JSCallbackFunction::call): Perform 'this' value conversion for 18 our callee, since it may observe 'this'. 19 20 * API/JSCallbackObjectFunctions.h: 21 (JSC::::call): Ditto. 22 23 * API/JSContextRef.cpp: 24 (JSGlobalContextCreateInGroup): Use a proxy 'this' object in global scope 25 even when we're not in the browser. This eliminates some odd cases where 26 API clients used to be able to get a direct reference to an environment 27 record. Now, any reference to an environment record unambiguously means 28 that the VM resolved that record in the scope chain. 29 30 (JSContextGetGlobalObject): Removed an incorrect comment. Now that JSC 31 participates in the proxy 'this' object scheme, the behavior is not 32 WebCore-only. 33 34 * JavaScriptCore.order: Order! 35 36 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def: 37 * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in: 38 What are the chances that this will work? 39 40 * bytecode/CodeBlock.cpp: 41 (JSC::CodeBlock::dumpBytecode): 42 (JSC::CodeBlock::CodeBlock): Renamed convert_this to to_this, to match our 43 other conversion opcodes. 44 45 * bytecode/CodeOrigin.h: 46 (CodeOrigin): 47 (InlineCallFrame): 48 (JSC::CodeOrigin::codeOriginOwner): Use the more precise type for our 49 executable, so compilation can discover where we're in strict mode. 50 51 * bytecode/Opcode.h: 52 (JSC::padOpcodeName): Updated for rename. 53 54 * bytecompiler/BytecodeGenerator.cpp: 55 (JSC::BytecodeGenerator::BytecodeGenerator): Always emit to_this when 56 'this' is in use -- strict mode still needs to convert environment 57 records to 'undefined'. 58 59 * dfg/DFGAbstractState.cpp: 60 (JSC::DFG::AbstractState::executeEffects): 61 * dfg/DFGByteCodeParser.cpp: 62 (JSC::DFG::ByteCodeParser::parseBlock): 63 * dfg/DFGCapabilities.h: 64 (JSC::DFG::canCompileOpcode): Updated for renames. 65 66 * dfg/DFGFixupPhase.cpp: 67 (JSC::DFG::FixupPhase::fixupNode): Tightened up this code to consider 68 strict mode (a new requirement) and to consider the global object (which 69 was always a requirement). 70 71 * dfg/DFGGraph.h: 72 (JSC::DFG::Graph::globalThisObjectFor): 73 (JSC::DFG::Graph::executableFor): 74 * dfg/DFGNodeType.h: 75 * dfg/DFGOperations.cpp: 76 * dfg/DFGOperations.h: 77 * dfg/DFGPredictionPropagationPhase.cpp: 78 (JSC::DFG::PredictionPropagationPhase::propagate): 79 * dfg/DFGSpeculativeJIT32_64.cpp: 80 (JSC::DFG::SpeculativeJIT::compile): 81 * dfg/DFGSpeculativeJIT64.cpp: 82 (JSC::DFG::SpeculativeJIT::compile): Ditto. 83 84 * interpreter/Interpreter.cpp: 85 (JSC::eval): 86 (JSC::Interpreter::execute): 87 (JSC::Interpreter::executeCall): 88 * interpreter/Interpreter.h: Don't ASSERT about 'this' -- it's our job 89 to fix it up if needed. 90 91 * jit/JIT.cpp: 92 (JSC::JIT::privateCompileMainPass): 93 (JSC::JIT::privateCompileSlowCases): 94 * jit/JIT.h: 95 (JIT): 96 * jit/JITOpcodes.cpp: 97 (JSC::JIT::emit_op_to_this): 98 (JSC::JIT::emitSlow_op_to_this): 99 * jit/JITOpcodes32_64.cpp: 100 (JSC::JIT::emit_op_to_this): 101 (JSC::JIT::emitSlow_op_to_this): 102 * jit/JITStubs.cpp: 103 (JSC::DEFINE_STUB_FUNCTION): 104 * jit/JITStubs.h: Removed special case code for various kinds of 105 conversions. The baseline fast path is now only final objects. It hurt 106 my brain to think through how to keep the other fast paths working, and 107 our benchmarks do not object. 108 109 * llint/LLIntData.cpp: 110 (JSC::LLInt::Data::performAssertions): 111 * llint/LLIntSlowPaths.cpp: 112 (JSC::LLInt::LLINT_SLOW_PATH_DECL): 113 * llint/LLIntSlowPaths.h: 114 * llint/LowLevelInterpreter.asm: 115 * llint/LowLevelInterpreter32_64.asm: 116 * llint/LowLevelInterpreter64.asm: 117 * profiler/ProfileGenerator.cpp: 118 (JSC::ProfileGenerator::addParentForConsoleStart): 119 * runtime/CallData.cpp: 120 (JSC::call): 121 * runtime/ClassInfo.h: 122 (MethodTable): 123 (JSC): 124 * runtime/Completion.cpp: 125 (JSC::evaluate): 126 * runtime/DatePrototype.cpp: 127 (JSC::dateProtoFuncToJSON): 128 * runtime/JSActivation.cpp: 129 (JSC::JSActivation::toThis): 130 * runtime/JSActivation.h: 131 (JSActivation): 132 * runtime/JSCJSValue.cpp: 133 (JSC::JSValue::toThisSlowCase): 134 * runtime/JSCJSValue.h: 135 (JSValue): 136 * runtime/JSCJSValueInlines.h: 137 (JSC::JSValue::toThis): 138 * runtime/JSCell.cpp: 139 (JSC::JSCell::toThis): 140 * runtime/JSCell.h: 141 (JSCell): 142 * runtime/JSGlobalObject.cpp: 143 (JSC::JSGlobalObject::toThis): 144 * runtime/JSGlobalObject.h: 145 (JSGlobalObject): 146 * runtime/JSNameScope.cpp: 147 (JSC::JSNameScope::toThis): 148 * runtime/JSNameScope.h: 149 (JSNameScope): 150 * runtime/JSObject.cpp: 151 (JSC::JSObject::put): 152 (JSC::JSObject::toThis): 153 * runtime/JSObject.h: 154 (JSObject): 155 * runtime/JSScope.cpp: 156 (JSC::JSScope::resolveWithThis): 157 * runtime/JSString.cpp: 158 (JSC::JSString::toThis): 159 * runtime/JSString.h: 160 (JSString): 161 * runtime/PropertySlot.cpp: 162 (JSC::PropertySlot::functionGetter): 163 * runtime/SparseArrayValueMap.cpp: 164 (JSC::SparseArrayEntry::get): 165 (JSC::SparseArrayEntry::put): 166 * runtime/StrictEvalActivation.cpp: 167 (JSC::StrictEvalActivation::toThis): 168 * runtime/StrictEvalActivation.h: 169 (StrictEvalActivation): Filled out runtime support for converting 'this' 170 values as needed, according to the strictness of the caller. 171 1 172 2013-05-02 Filip Pizlo <fpizlo@apple.com> 2 173 -
branches/dfgFourthTier/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r149516 r149527 718 718 break; 719 719 } 720 case op_ convert_this: {721 int r0 = (++it)->u.operand; 722 out.printf("[%4d] convert_this\t %s", location, registerName(r0).data());720 case op_to_this: { 721 int r0 = (++it)->u.operand; 722 out.printf("[%4d] to_this\t %s", location, registerName(r0).data()); 723 723 ++it; // Skip value profile. 724 724 break; … … 1831 1831 // fallthrough 1832 1832 } 1833 case op_ convert_this:1833 case op_to_this: 1834 1834 case op_get_by_id: 1835 1835 case op_call_put_result: -
branches/dfgFourthTier/Source/JavaScriptCore/bytecode/CodeOrigin.h
r149516 r149527 40 40 struct InlineCallFrame; 41 41 class ExecState; 42 class ExecutableBase;42 class ScriptExecutable; 43 43 class JSFunction; 44 44 … … 83 83 // If the code origin corresponds to inlined code, gives you the heap object that 84 84 // would have owned the code if it had not been inlined. Otherwise returns 0. 85 ExecutableBase* codeOriginOwner() const;85 ScriptExecutable* codeOriginOwner() const; 86 86 87 87 unsigned stackOffset() const; … … 101 101 struct InlineCallFrame { 102 102 Vector<ValueRecovery> arguments; 103 WriteBarrier< ExecutableBase> executable;103 WriteBarrier<ScriptExecutable> executable; 104 104 WriteBarrier<JSFunction> callee; // This may be null, indicating that this is a closure call and that the JSFunction and JSScope are already on the stack. 105 105 CodeOrigin caller; … … 150 150 } 151 151 152 inline ExecutableBase* CodeOrigin::codeOriginOwner() const152 inline ScriptExecutable* CodeOrigin::codeOriginOwner() const 153 153 { 154 154 if (!inlineCallFrame) -
branches/dfgFourthTier/Source/JavaScriptCore/bytecode/Opcode.h
r145000 r149527 47 47 macro(op_create_this, 4) \ 48 48 macro(op_get_callee, 3) \ 49 macro(op_ convert_this, 3) \49 macro(op_to_this, 3) \ 50 50 \ 51 51 macro(op_new_object, 4) \ -
branches/dfgFourthTier/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r149248 r149527 470 470 if (isConstructor()) { 471 471 emitCreateThis(&m_thisRegister); 472 } else if ( !codeBlock->isStrictMode() && (functionBody->usesThis() || codeBlock->usesEval() || m_shouldEmitDebugHooks)) {473 UnlinkedValueProfile profile = emitProfiledOpcode(op_ convert_this);472 } else if (functionBody->usesThis() || codeBlock->usesEval() || m_shouldEmitDebugHooks) { 473 UnlinkedValueProfile profile = emitProfiledOpcode(op_to_this); 474 474 instructions().append(kill(&m_thisRegister)); 475 475 instructions().append(profile); -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
r149516 r149527 1128 1128 break; 1129 1129 1130 case ConvertThis: {1130 case ToThis: { 1131 1131 AbstractValue& source = forNode(node->child1()); 1132 1132 AbstractValue& destination = forNode(node); -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r149516 r149527 2018 2018 NEXT_OPCODE(op_enter); 2019 2019 2020 case op_ convert_this: {2020 case op_to_this: { 2021 2021 Node* op1 = getThis(); 2022 if (op1->op() != ConvertThis) {2022 if (op1->op() != ToThis) { 2023 2023 CodeBlockLocker locker(m_inlineStackTop->m_profiledBlock->m_lock); 2024 2024 ValueProfile* profile = … … 2034 2034 || !profile->m_singletonValue.isCell() 2035 2035 || profile->m_singletonValue.asCell()->classInfo() != &Structure::s_info) 2036 setThis(addToGraph( ConvertThis, op1));2036 setThis(addToGraph(ToThis, op1)); 2037 2037 else { 2038 2038 addToGraph( … … 2042 2042 } 2043 2043 } 2044 NEXT_OPCODE(op_ convert_this);2044 NEXT_OPCODE(op_to_this); 2045 2045 } 2046 2046 -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGCapabilities.h
r145000 r149527 87 87 switch (opcodeID) { 88 88 case op_enter: 89 case op_ convert_this:89 case op_to_this: 90 90 case op_create_this: 91 91 case op_get_callee: -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r149516 r149527 661 661 } 662 662 663 case ConvertThis: { 663 case ToThis: { 664 ECMAMode ecmaMode = m_graph.executableFor(node->codeOrigin)->isStrictMode() ? StrictMode : NotStrictMode; 665 664 666 if (isOtherSpeculation(node->child1()->prediction())) { 667 if (ecmaMode == StrictMode) { 668 setUseKindAndUnboxIfProfitable<OtherUse>(node->child1()); 669 node->convertToIdentity(); 670 break; 671 } 672 665 673 m_insertionSet.insertNode( 666 674 m_indexInBlock, SpecNone, Phantom, node->codeOrigin, … … 671 679 } 672 680 673 if (is ObjectSpeculation(node->child1()->prediction())) {681 if (isFinalObjectSpeculation(node->child1()->prediction())) { 674 682 setUseKindAndUnboxIfProfitable<ObjectUse>(node->child1()); 675 683 node->convertToIdentity(); -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGGraph.h
r149516 r149527 358 358 { 359 359 JSGlobalObject* object = globalObjectFor(codeOrigin); 360 return object->methodTable()->toThisObject(object, 0);361 } 362 363 ExecutableBase* executableFor(InlineCallFrame* inlineCallFrame)360 return jsCast<JSObject*>(object->methodTable()->toThis(object, object->globalExec(), NotStrictMode)); 361 } 362 363 ScriptExecutable* executableFor(InlineCallFrame* inlineCallFrame) 364 364 { 365 365 if (!inlineCallFrame) … … 369 369 } 370 370 371 ExecutableBase* executableFor(const CodeOrigin& codeOrigin)371 ScriptExecutable* executableFor(const CodeOrigin& codeOrigin) 372 372 { 373 373 return executableFor(codeOrigin.inlineCallFrame); -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGNodeType.h
r148347 r149527 50 50 \ 51 51 /* Nodes for handling functions (both as call and as construct). */\ 52 macro( ConvertThis, NodeResultJS) \52 macro(ToThis, NodeResultJS) \ 53 53 macro(CreateThis, NodeResultJS) /* Note this is not MustGenerate since we're returning it anyway. */ \ 54 54 macro(GetCallee, NodeResultJS) \ -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGOperations.cpp
r149516 r149527 341 341 extern "C" { 342 342 343 EncodedJSValue DFG_OPERATION operation ConvertThis(ExecState* exec, EncodedJSValue encodedOp)344 { 345 VM* vm = &exec->vm(); 346 NativeCallFrameTracer tracer(vm, exec); 347 348 return JSValue::encode(JSValue::decode(encodedOp).toThis Object(exec));343 EncodedJSValue DFG_OPERATION operationToThis(ExecState* exec, EncodedJSValue encodedOp) 344 { 345 VM* vm = &exec->vm(); 346 NativeCallFrameTracer tracer(vm, exec); 347 348 return JSValue::encode(JSValue::decode(encodedOp).toThis(exec, exec->codeBlock()->isStrictMode() ? StrictMode : NotStrictMode)); 349 349 } 350 350 -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGOperations.h
r149516 r149527 129 129 JSCell* DFG_OPERATION operationNewObject(ExecState*, Structure*) WTF_INTERNAL; 130 130 JSCell* DFG_OPERATION operationCreateThis(ExecState*, JSObject* constructor, int32_t inlineCapacity) WTF_INTERNAL; 131 EncodedJSValue DFG_OPERATION operation ConvertThis(ExecState*, EncodedJSValue encodedOp1) WTF_INTERNAL;131 EncodedJSValue DFG_OPERATION operationToThis(ExecState*, EncodedJSValue encodedOp1) WTF_INTERNAL; 132 132 EncodedJSValue DFG_OPERATION operationValueAdd(ExecState*, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) WTF_INTERNAL; 133 133 EncodedJSValue DFG_OPERATION operationValueAddNotNumber(ExecState*, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) WTF_INTERNAL; -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
r146382 r149527 370 370 } 371 371 372 case ConvertThis: {372 case ToThis: { 373 373 SpeculatedType prediction = node->child1()->prediction(); 374 374 if (prediction) { -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r149516 r149527 3686 3686 } 3687 3687 3688 case ConvertThis: {3688 case ToThis: { 3689 3689 ASSERT(node->child1().useKind() == UntypedUse); 3690 3690 … … 3697 3697 GPRResult2 resultTag(this); 3698 3698 GPRResult resultPayload(this); 3699 callOperation(operation ConvertThis, resultTag.gpr(), resultPayload.gpr(), thisValueTagGPR, thisValuePayloadGPR);3699 callOperation(operationToThis, resultTag.gpr(), resultPayload.gpr(), thisValueTagGPR, thisValuePayloadGPR); 3700 3700 3701 3701 cellResult(resultPayload.gpr(), node); -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r149516 r149527 3599 3599 } 3600 3600 3601 case ConvertThis: {3601 case ToThis: { 3602 3602 ASSERT(node->child1().useKind() == UntypedUse); 3603 3603 JSValueOperand thisValue(this, node->child1()); … … 3607 3607 3608 3608 GPRResult result(this); 3609 callOperation(operation ConvertThis, result.gpr(), thisValueGPR);3609 callOperation(operationToThis, result.gpr(), thisValueGPR); 3610 3610 3611 3611 cellResult(result.gpr(), node); -
branches/dfgFourthTier/Source/JavaScriptCore/interpreter/Interpreter.cpp
r148697 r149527 256 256 257 257 JSValue thisValue = callerFrame->thisValue(); 258 ASSERT(isValidThisObject(thisValue, callFrame));259 258 Interpreter* interpreter = callFrame->vm().interpreter; 260 259 return interpreter->execute(eval, callFrame, thisValue, callerScopeChain); … … 838 837 VM& vm = *scope->vm(); 839 838 840 ASSERT(isValidThisObject(thisObj, callFrame));841 839 ASSERT(!vm.exception); 842 840 ASSERT(!vm.isCollectorBusy()); … … 1000 998 { 1001 999 VM& vm = callFrame->vm(); 1002 ASSERT(isValidThisObject(thisValue, callFrame));1003 1000 ASSERT(!callFrame->hadException()); 1004 1001 ASSERT(!vm.isCollectorBusy()); … … 1249 1246 1250 1247 ASSERT(scope->vm() == &callFrame->vm()); 1251 ASSERT(isValidThisObject(thisValue, callFrame));1252 1248 ASSERT(!vm.exception); 1253 1249 ASSERT(!vm.isCollectorBusy()); -
branches/dfgFourthTier/Source/JavaScriptCore/interpreter/Interpreter.h
r148697 r149527 284 284 }; 285 285 286 // This value must not be an object that would require this conversion (WebCore's global object).287 inline bool isValidThisObject(JSValue thisValue, ExecState* exec)288 {289 return !thisValue.isObject() || thisValue.toThisObject(exec) == thisValue;290 }291 292 286 JSValue eval(CallFrame*); 293 287 CallFrame* loadVarargs(CallFrame*, JSStack*, JSValue thisValue, JSValue arguments, int firstFreeRegister); -
branches/dfgFourthTier/Source/JavaScriptCore/jit/JIT.cpp
r149518 r149527 266 266 DEFINE_OP(op_get_callee) 267 267 DEFINE_OP(op_create_this) 268 DEFINE_OP(op_ convert_this)268 DEFINE_OP(op_to_this) 269 269 DEFINE_OP(op_init_lazy_reg) 270 270 DEFINE_OP(op_create_arguments) … … 480 480 DEFINE_SLOWCASE_OP(op_call_varargs) 481 481 DEFINE_SLOWCASE_OP(op_construct) 482 DEFINE_SLOWCASE_OP(op_ convert_this)482 DEFINE_SLOWCASE_OP(op_to_this) 483 483 DEFINE_SLOWCASE_OP(op_create_this) 484 484 DEFINE_SLOWCASE_OP(op_div) -
branches/dfgFourthTier/Source/JavaScriptCore/jit/JIT.h
r148697 r149527 654 654 void emit_op_get_callee(Instruction*); 655 655 void emit_op_create_this(Instruction*); 656 void emit_op_ convert_this(Instruction*);656 void emit_op_to_this(Instruction*); 657 657 void emit_op_create_arguments(Instruction*); 658 658 void emit_op_debug(Instruction*); … … 768 768 void emitSlow_op_call_varargs(Instruction*, Vector<SlowCaseEntry>::iterator&); 769 769 void emitSlow_op_construct(Instruction*, Vector<SlowCaseEntry>::iterator&); 770 void emitSlow_op_ convert_this(Instruction*, Vector<SlowCaseEntry>::iterator&);770 void emitSlow_op_to_this(Instruction*, Vector<SlowCaseEntry>::iterator&); 771 771 void emitSlow_op_create_this(Instruction*, Vector<SlowCaseEntry>::iterator&); 772 772 void emitSlow_op_div(Instruction*, Vector<SlowCaseEntry>::iterator&); -
branches/dfgFourthTier/Source/JavaScriptCore/jit/JITOpcodes.cpp
r148697 r149527 910 910 } 911 911 912 void JIT::emit_op_ convert_this(Instruction* currentInstruction)912 void JIT::emit_op_to_this(Instruction* currentInstruction) 913 913 { 914 914 emitGetVirtualRegister(currentInstruction[1].u.operand, regT1); 915 915 916 916 emitJumpSlowCaseIfNotJSCell(regT1); 917 if (shouldEmitProfiling()) {918 loadPtr(Address(regT1, JSCell::structureOffset()), regT0);917 loadPtr(Address(regT1, JSCell::structureOffset()), regT0); 918 if (shouldEmitProfiling()) 919 919 emitValueProfilingSite(); 920 } 921 addSlowCase(branch Ptr(Equal, Address(regT1, JSCell::structureOffset()), TrustedImmPtr(m_vm->stringStructure.get())));920 921 addSlowCase(branch8(NotEqual, Address(regT0, Structure::typeInfoTypeOffset()), TrustedImm32(FinalObjectType))); 922 922 } 923 923 … … 975 975 // Slow cases 976 976 977 void JIT::emitSlow_op_convert_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 978 { 979 void* globalThis = m_codeBlock->globalObject()->globalThis(); 980 981 linkSlowCase(iter); 982 if (shouldEmitProfiling()) 983 move(TrustedImm64((JSValue::encode(jsUndefined()))), regT0); 984 Jump isNotUndefined = branch64(NotEqual, regT1, TrustedImm64(JSValue::encode(jsUndefined()))); 985 emitValueProfilingSite(); 986 move(TrustedImm64(JSValue::encode(JSValue(static_cast<JSCell*>(globalThis)))), regT0); 987 emitPutVirtualRegister(currentInstruction[1].u.operand, regT0); 988 emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_convert_this)); 989 990 linkSlowCase(iter); 991 if (shouldEmitProfiling()) 992 move(TrustedImm64(JSValue::encode(m_vm->stringStructure.get())), regT0); 993 isNotUndefined.link(this); 994 emitValueProfilingSite(); 995 JITStubCall stubCall(this, cti_op_convert_this); 977 void JIT::emitSlow_op_to_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 978 { 979 linkSlowCase(iter); 980 linkSlowCase(iter); 981 JITStubCall stubCall(this, cti_op_to_this); 996 982 stubCall.addArgument(regT1); 997 983 stubCall.call(currentInstruction[1].u.operand); -
branches/dfgFourthTier/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r148697 r149527 1197 1197 } 1198 1198 1199 void JIT::emit_op_ convert_this(Instruction* currentInstruction)1199 void JIT::emit_op_to_this(Instruction* currentInstruction) 1200 1200 { 1201 1201 unsigned thisRegister = currentInstruction[1].u.operand; … … 1204 1204 1205 1205 addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::CellTag))); 1206 loadPtr(Address(regT2, JSCell::structureOffset()), regT0); 1206 1207 if (shouldEmitProfiling()) { 1207 loadPtr(Address(regT2, JSCell::structureOffset()), regT0);1208 1208 move(regT3, regT1); 1209 1209 emitValueProfilingSite(); 1210 1210 } 1211 addSlowCase(branchPtr(Equal, Address(regT2, JSCell::structureOffset()), TrustedImmPtr(m_vm->stringStructure.get()))); 1212 } 1213 1214 void JIT::emitSlow_op_convert_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1215 { 1216 void* globalThis = m_codeBlock->globalObject()->globalThis(); 1211 addSlowCase(branch8(NotEqual, Address(regT0, Structure::typeInfoTypeOffset()), TrustedImm32(FinalObjectType))); 1212 } 1213 1214 void JIT::emitSlow_op_to_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1215 { 1217 1216 unsigned thisRegister = currentInstruction[1].u.operand; 1218 1217 1219 1218 linkSlowCase(iter); 1220 if (shouldEmitProfiling()) { 1221 move(TrustedImm32(JSValue::UndefinedTag), regT1); 1222 move(TrustedImm32(0), regT0); 1223 } 1224 Jump isNotUndefined = branch32(NotEqual, regT3, TrustedImm32(JSValue::UndefinedTag)); 1225 emitValueProfilingSite(); 1226 move(TrustedImmPtr(globalThis), regT0); 1227 move(TrustedImm32(JSValue::CellTag), regT1); 1228 emitStore(thisRegister, regT1, regT0); 1229 emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_convert_this)); 1230 1231 linkSlowCase(iter); 1232 if (shouldEmitProfiling()) { 1233 move(TrustedImm32(JSValue::CellTag), regT1); 1234 move(TrustedImmPtr(m_vm->stringStructure.get()), regT0); 1235 } 1236 isNotUndefined.link(this); 1237 emitValueProfilingSite(); 1238 JITStubCall stubCall(this, cti_op_convert_this); 1219 linkSlowCase(iter); 1220 JITStubCall stubCall(this, cti_op_to_this); 1239 1221 stubCall.addArgument(regT3, regT2); 1240 1222 stubCall.call(thisRegister); -
branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.cpp
r148804 r149527 1327 1327 } 1328 1328 1329 DEFINE_STUB_FUNCTION(EncodedJSValue, op_ convert_this)1329 DEFINE_STUB_FUNCTION(EncodedJSValue, op_to_this) 1330 1330 { 1331 1331 STUB_INIT_STACK_FRAME(stackFrame); … … 1334 1334 CallFrame* callFrame = stackFrame.callFrame; 1335 1335 1336 ASSERT(v1.isPrimitive()); 1337 1338 JSObject* result = v1.toThisObject(callFrame); 1336 JSValue result = v1.toThis(callFrame, callFrame->codeBlock()->isStrictMode() ? StrictMode : NotStrictMode); 1339 1337 CHECK_FOR_EXCEPTION_AT_END(); 1340 1338 return JSValue::encode(result); -
branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.h
r148697 r149527 331 331 EncodedJSValue JIT_STUB cti_op_check_has_instance(STUB_ARGS_DECLARATION) WTF_INTERNAL; 332 332 EncodedJSValue JIT_STUB cti_op_create_this(STUB_ARGS_DECLARATION) WTF_INTERNAL; 333 EncodedJSValue JIT_STUB cti_op_ convert_this(STUB_ARGS_DECLARATION) WTF_INTERNAL;333 EncodedJSValue JIT_STUB cti_op_to_this(STUB_ARGS_DECLARATION) WTF_INTERNAL; 334 334 EncodedJSValue JIT_STUB cti_op_create_arguments(STUB_ARGS_DECLARATION) WTF_INTERNAL; 335 335 EncodedJSValue JIT_STUB cti_op_del_by_id(STUB_ARGS_DECLARATION) WTF_INTERNAL; -
branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntData.cpp
r148697 r149527 105 105 ASSERT(StringType == 5); 106 106 ASSERT(ObjectType == 17); 107 ASSERT(FinalObjectType == 18); 107 108 ASSERT(MasqueradesAsUndefined == 1); 108 109 ASSERT(ImplementsHasInstance == 2); -
branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r148804 r149527 492 492 } 493 493 494 LLINT_SLOW_PATH_DECL(slow_path_ convert_this)494 LLINT_SLOW_PATH_DECL(slow_path_to_this) 495 495 { 496 496 LLINT_BEGIN(); 497 497 JSValue v1 = LLINT_OP(1).jsValue(); 498 ASSERT(v1.isPrimitive());499 498 #if ENABLE(VALUE_PROFILER) 500 pc[OPCODE_LENGTH(op_ convert_this) - 1].u.profile->m_buckets[0] =499 pc[OPCODE_LENGTH(op_to_this) - 1].u.profile->m_buckets[0] = 501 500 JSValue::encode(v1.structureOrUndefined()); 502 501 #endif 503 LLINT_RETURN(v1.toThis Object(exec));502 LLINT_RETURN(v1.toThis(exec, exec->codeBlock()->isStrictMode() ? StrictMode : NotStrictMode)); 504 503 } 505 504 -
branches/dfgFourthTier/Source/JavaScriptCore/llint/LLIntSlowPaths.h
r133688 r149527 119 119 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_create_arguments); 120 120 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_create_this); 121 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_ convert_this);121 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_to_this); 122 122 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_object); 123 123 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_array); -
branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r148697 r149527 101 101 const StringType = 5 102 102 const ObjectType = 17 103 const FinalObjectType = 18 103 104 104 105 # Type flags constants. -
branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r148697 r149527 387 387 388 388 389 _llint_op_ convert_this:390 traceExecution() 391 loadi 4[PC], t0 392 bineq TagOffset[cfr, t0, 8], CellTag, .op ConvertThisSlow389 _llint_op_to_this: 390 traceExecution() 391 loadi 4[PC], t0 392 bineq TagOffset[cfr, t0, 8], CellTag, .opToThisSlow 393 393 loadi PayloadOffset[cfr, t0, 8], t0 394 394 loadp JSCell::m_structure[t0], t0 395 bb b Structure::m_typeInfo + TypeInfo::m_type[t0], ObjectType, .opConvertThisSlow395 bbneq Structure::m_typeInfo + TypeInfo::m_type[t0], FinalObjectType, .opToThisSlow 396 396 loadi 8[PC], t1 397 397 valueProfile(CellTag, t0, t1) 398 398 dispatch(3) 399 399 400 .op ConvertThisSlow:401 callSlowPath(_llint_slow_path_ convert_this)400 .opToThisSlow: 401 callSlowPath(_llint_slow_path_to_this) 402 402 dispatch(3) 403 403 -
branches/dfgFourthTier/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r148697 r149527 267 267 268 268 269 _llint_op_ convert_this:269 _llint_op_to_this: 270 270 traceExecution() 271 271 loadisFromInstruction(1, t0) 272 272 loadq [cfr, t0, 8], t0 273 btqnz t0, tagMask, .op ConvertThisSlow273 btqnz t0, tagMask, .opToThisSlow 274 274 loadp JSCell::m_structure[t0], t0 275 bb b Structure::m_typeInfo + TypeInfo::m_type[t0], ObjectType, .opConvertThisSlow275 bbneq Structure::m_typeInfo + TypeInfo::m_type[t0], FinalObjectType, .opToThisSlow 276 276 loadpFromInstruction(2, t1) 277 277 valueProfile(t0, t1) 278 278 dispatch(3) 279 279 280 .op ConvertThisSlow:281 callSlowPath(_llint_slow_path_ convert_this)280 .opToThisSlow: 281 callSlowPath(_llint_slow_path_to_this) 282 282 dispatch(3) 283 283 -
branches/dfgFourthTier/Source/JavaScriptCore/profiler/ProfileGenerator.cpp
r139541 r149527 65 65 66 66 exec->interpreter()->retrieveLastCaller(exec, lineNumber, sourceID, sourceURL, function); 67 m_currentNode = ProfileNode::create(exec, LegacyProfiler::createCallIdentifier(exec, function ? function.toThisObject(exec) : 0, sourceURL, lineNumber), m_head.get(), m_head.get());67 m_currentNode = ProfileNode::create(exec, LegacyProfiler::createCallIdentifier(exec, function, sourceURL, lineNumber), m_head.get(), m_head.get()); 68 68 m_head->insertNode(m_currentNode.get()); 69 69 } -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/CallData.cpp
r139541 r149527 37 37 { 38 38 ASSERT(callType == CallTypeJS || callType == CallTypeHost); 39 ASSERT(isValidThisObject(thisValue, exec));40 39 return exec->interpreter()->executeCall(exec, asObject(functionObject), callType, callData, thisValue, args); 41 40 } -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/ClassInfo.h
r134898 r149527 67 67 GetOwnPropertySlotByIndexFunctionPtr getOwnPropertySlotByIndex; 68 68 69 typedef JS Object* (*ToThisObjectFunctionPtr)(JSCell*, ExecState*);70 ToThis ObjectFunctionPtr toThisObject;69 typedef JSValue (*ToThisFunctionPtr)(JSCell*, ExecState*, ECMAMode); 70 ToThisFunctionPtr toThis; 71 71 72 72 typedef JSValue (*DefaultValueFunctionPtr)(const JSObject*, ExecState*, PreferredPrimitiveType); … … 129 129 &ClassName::getOwnPropertySlot, \ 130 130 &ClassName::getOwnPropertySlotByIndex, \ 131 &ClassName::toThis Object, \131 &ClassName::toThis, \ 132 132 &ClassName::defaultValue, \ 133 133 &ClassName::getOwnPropertyNames, \ -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/Completion.cpp
r148697 r149527 72 72 if (!thisValue || thisValue.isUndefinedOrNull()) 73 73 thisValue = exec->dynamicGlobalObject(); 74 JSObject* thisObj = thisValue.toThisObject(exec);74 JSObject* thisObj = jsCast<JSObject*>(thisValue.toThis(exec, NotStrictMode)); 75 75 JSValue result = exec->interpreter()->execute(program, exec, thisObj); 76 76 -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/DatePrototype.cpp
r148697 r149527 1108 1108 { 1109 1109 JSValue thisValue = exec->hostThisValue(); 1110 JSObject* object = thisValue.toThisObject(exec);1110 JSObject* object = jsCast<JSObject*>(thisValue.toThis(exec, NotStrictMode)); 1111 1111 if (exec->hadException()) 1112 1112 return JSValue::encode(jsNull()); -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSActivation.cpp
r149248 r149527 237 237 } 238 238 239 JSObject* JSActivation::toThisObject(JSCell*, ExecState* exec) 240 { 239 JSValue JSActivation::toThis(JSCell*, ExecState* exec, ECMAMode ecmaMode) 240 { 241 if (ecmaMode == StrictMode) 242 return jsUndefined(); 241 243 return exec->globalThisValue(); 242 244 } -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSActivation.h
r148697 r149527 74 74 static bool deleteProperty(JSCell*, ExecState*, PropertyName); 75 75 76 static JS Object* toThisObject(JSCell*, ExecState*);76 static JSValue toThis(JSCell*, ExecState*, ECMAMode); 77 77 78 78 void tearOff(VM&); -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSCJSValue.cpp
r148697 r149527 81 81 } 82 82 83 JS Object* JSValue::toThisObjectSlowCase(ExecState* exec) const83 JSValue JSValue::toThisSlowCase(ExecState* exec, ECMAMode ecmaMode) const 84 84 { 85 85 ASSERT(!isCell()); 86 87 if (ecmaMode == StrictMode) 88 return *this; 86 89 87 90 if (isInt32() || isDouble()) -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSCJSValue.h
r148697 r149527 73 73 74 74 enum PreferredPrimitiveType { NoPreference, PreferNumber, PreferString }; 75 75 enum ECMAMode { StrictMode, NotStrictMode }; 76 76 77 77 typedef int64_t EncodedJSValue; … … 246 246 void putByIndex(ExecState*, unsigned propertyName, JSValue, bool shouldThrow); 247 247 248 JS Object* toThisObject(ExecState*) const;248 JSValue toThis(ExecState*, ECMAMode) const; 249 249 250 250 static bool equal(ExecState*, JSValue v1, JSValue v2); … … 276 276 JS_EXPORT_PRIVATE WTF::String toWTFStringSlowCase(ExecState*) const; 277 277 JS_EXPORT_PRIVATE JSObject* toObjectSlowCase(ExecState*, JSGlobalObject*) const; 278 JS_EXPORT_PRIVATE JS Object* toThisObjectSlowCase(ExecState*) const;278 JS_EXPORT_PRIVATE JSValue toThisSlowCase(ExecState*, ECMAMode) const; 279 279 280 280 #if USE(JSVALUE32_64) -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSCJSValueInlines.h
r143232 r149527 615 615 } 616 616 617 inline JS Object* JSValue::toThisObject(ExecState* exec) const618 { 619 return isCell() ? asCell()->methodTable()->toThis Object(asCell(), exec) : toThisObjectSlowCase(exec);617 inline JSValue JSValue::toThis(ExecState* exec, ECMAMode ecmaMode) const 618 { 619 return isCell() ? asCell()->methodTable()->toThis(asCell(), exec, ecmaMode) : toThisSlowCase(exec, ecmaMode); 620 620 } 621 621 -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSCell.cpp
r145945 r149527 134 134 } 135 135 136 JSObject* JSCell::toThisObject(JSCell* cell, ExecState* exec) 137 { 136 JSValue JSCell::toThis(JSCell* cell, ExecState* exec, ECMAMode ecmaMode) 137 { 138 if (ecmaMode == StrictMode) 139 return cell; 138 140 return cell->toObject(exec, exec->lexicalGlobalObject()); 139 141 } -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSCell.h
r148697 r149527 113 113 static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned propertyName); 114 114 115 static JS Object* toThisObject(JSCell*, ExecState*);115 static JSValue toThis(JSCell*, ExecState*, ECMAMode); 116 116 117 117 void zap() { *reinterpret_cast<uintptr_t**>(this) = 0; } -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r148697 r149527 536 536 } 537 537 538 JSObject* JSGlobalObject::toThisObject(JSCell* cell, ExecState*) 539 { 540 return jsCast<JSGlobalObject*>(cell)->globalThis(); 538 JSValue JSGlobalObject::toThis(JSCell*, ExecState* exec, ECMAMode ecmaMode) 539 { 540 if (ecmaMode == StrictMode) 541 return jsUndefined(); 542 return exec->globalThisValue(); 541 543 } 542 544 -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSGlobalObject.h
r148697 r149527 378 378 VM& vm() const { return *Heap::heap(this)->vm(); } 379 379 JSObject* globalThis() const; 380 JS_EXPORT_PRIVATE void setGlobalThis(VM&, JSObject* globalThis); 380 381 381 382 static Structure* createStructure(VM& vm, JSValue prototype) … … 420 421 JS_EXPORT_PRIVATE void addStaticGlobals(GlobalPropertyInfo*, int count); 421 422 422 JS_EXPORT_PRIVATE static JSC::JSObject* toThisObject(JSC::JSCell*, JSC::ExecState*); 423 424 JS_EXPORT_PRIVATE void setGlobalThis(VM&, JSObject* globalThis); 423 JS_EXPORT_PRIVATE static JSC::JSValue toThis(JSC::JSCell*, JSC::ExecState*, ECMAMode); 425 424 426 425 private: -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSNameScope.cpp
r140594 r149527 45 45 } 46 46 47 JS Object* JSNameScope::toThisObject(JSCell*, ExecState* exec)47 JSValue JSNameScope::toThis(JSCell*, ExecState* exec, ECMAMode ecmaMode) 48 48 { 49 if (ecmaMode == StrictMode) 50 return jsUndefined(); 49 51 return exec->globalThisValue(); 50 52 } -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSNameScope.h
r148697 r149527 53 53 static void visitChildren(JSCell*, SlotVisitor&); 54 54 bool isDynamicScope(bool& requiresDynamicChecks) const; 55 static JS Object* toThisObject(JSCell*, ExecState*);55 static JSValue toThis(JSCell*, ExecState*, ECMAMode); 56 56 static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&); 57 57 static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSObject.cpp
r148697 r149527 397 397 args.append(value); 398 398 399 // If this is WebCore's global object then we need to substitute the shell. 400 call(exec, setterFunc, callType, callData, thisObject->methodTable()->toThisObject(thisObject, exec), args); 399 call(exec, setterFunc, callType, callData, thisObject, args); 401 400 return; 402 401 } else … … 1551 1550 } 1552 1551 1553 JS Object* JSObject::toThisObject(JSCell* cell, ExecState*)1552 JSValue JSObject::toThis(JSCell* cell, ExecState*, ECMAMode) 1554 1553 { 1555 1554 return jsCast<JSObject*>(cell); -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSObject.h
r148697 r149527 489 489 // NOTE: JSObject and its subclasses must be able to gracefully handle ExecState* = 0, 490 490 // because this call may come from inside the compiler. 491 JS_EXPORT_PRIVATE static JS Object* toThisObject(JSCell*, ExecState*);491 JS_EXPORT_PRIVATE static JSValue toThis(JSCell*, ExecState*, ECMAMode); 492 492 493 493 bool getPropertySpecificValue(ExecState*, PropertyName, JSCell*& specificFunction) const; -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSScope.cpp
r148804 r149527 537 537 return JSValue(); 538 538 ASSERT(value); 539 *base = propertyBase->structure()->typeInfo().isEnvironmentRecord() ? jsUndefined() :JSValue(propertyBase);539 *base = JSValue(propertyBase); 540 540 return value; 541 541 } -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSString.cpp
r148697 r149527 272 272 } 273 273 274 JSObject* JSString::toThisObject(JSCell* cell, ExecState* exec) 275 { 274 JSValue JSString::toThis(JSCell* cell, ExecState* exec, ECMAMode ecmaMode) 275 { 276 if (ecmaMode == StrictMode) 277 return cell; 276 278 return StringObject::create(exec, exec->lexicalGlobalObject(), jsCast<JSString*>(cell)); 277 279 } -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/JSString.h
r148697 r149527 201 201 friend class LLIntOffsetsExtractor; 202 202 203 static JS Object* toThisObject(JSCell*, ExecState*);203 static JSValue toThis(JSCell*, ExecState*, ECMAMode); 204 204 205 205 // Actually getPropertySlot, not getOwnPropertySlot (see JSCell). -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/PropertySlot.cpp
r139541 r149527 36 36 CallData callData; 37 37 CallType callType = m_data.getterFunc->methodTable()->getCallData(m_data.getterFunc, callData); 38 return call(exec, m_data.getterFunc, callType, callData, m_thisValue .isObject() ? m_thisValue.toThisObject(exec) : m_thisValue, exec->emptyList());38 return call(exec, m_data.getterFunc, callType, callData, m_thisValue, exec->emptyList()); 39 39 } 40 40 -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
r148697 r149527 161 161 CallData callData; 162 162 CallType callType = getter->methodTable()->getCallData(getter, callData); 163 return call(exec, getter, callType, callData, array ->methodTable()->toThisObject(array, exec), exec->emptyList());163 return call(exec, getter, callType, callData, array, exec->emptyList()); 164 164 } 165 165 … … 191 191 MarkedArgumentBuffer args; 192 192 args.append(value); 193 if (thisValue.isObject())194 thisValue = asObject(thisValue)->methodTable()->toThisObject(asObject(thisValue), exec);195 193 call(exec, setter, callType, callData, thisValue, args); 196 194 } -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/StrictEvalActivation.cpp
r148697 r149527 50 50 } 51 51 52 JS Object* StrictEvalActivation::toThisObject(JSCell*, ExecState* exec)52 JSValue StrictEvalActivation::toThis(JSCell*, ExecState* exec, ECMAMode ecmaMode) 53 53 { 54 if (ecmaMode == StrictMode) 55 return jsUndefined(); 54 56 return exec->globalThisValue(); 55 57 } -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/StrictEvalActivation.h
r148697 r149527 43 43 44 44 static bool deleteProperty(JSCell*, ExecState*, PropertyName); 45 static JS Object* toThisObject(JSCell*, ExecState*);45 static JSValue toThis(JSCell*, ExecState*, ECMAMode); 46 46 47 47 static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) -
branches/dfgFourthTier/Source/WebCore/ChangeLog
r149351 r149527 1 2013-05-03 Geoffrey Garen <ggaren@apple.com> 2 3 Rationalized 'this' value conversion 4 https://bugs.webkit.org/show_bug.cgi?id=115542 5 6 Reviewed by Filip Pizlo. 7 8 Updated to match JSC requirement that the callee performs 'this' value 9 conversion. 10 11 * WebCore.order: 12 * bindings/js/JSErrorHandler.cpp: 13 (WebCore::JSErrorHandler::handleEvent): 14 * bindings/js/JSInjectedScriptHostCustom.cpp: 15 (WebCore::JSInjectedScriptHost::internalConstructorName): 16 * bindings/js/JSMainThreadExecState.h: 17 (WebCore::JSMainThreadExecState::call): 18 * bindings/scripts/CodeGeneratorJS.pm: 19 (GenerateImplementation): 20 * bridge/NP_jsobject.cpp: 21 (_NPN_Invoke): 22 1 23 2013-04-29 Filip Pizlo <fpizlo@apple.com> 2 24 -
branches/dfgFourthTier/Source/WebCore/WebCore.order
r148697 r149527 2803 2803 __ZN7WebCore13ScriptElement13executeScriptERKNS_16ScriptSourceCodeE 2804 2804 __ZNK7WebCore21ContentSecurityPolicy17allowInlineScriptEv 2805 __ZNK7WebCore15JSDOMWindowBase12toThisObjectEPN3JSC9ExecStateE2806 2805 __ZN7WebCore16JSDOMWindowShell18getOwnPropertySlotEPN3JSC9ExecStateERKNS1_10IdentifierERNS1_12PropertySlotE 2807 2806 __ZN7WebCore16JSDOMWindowShell17putWithAttributesEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueEj -
branches/dfgFourthTier/Source/WebCore/bindings/js/JSErrorHandler.cpp
r148697 r149527 93 93 DynamicGlobalObjectScope globalObjectScope(vm, vm.dynamicGlobalObject ? vm.dynamicGlobalObject : globalObject); 94 94 95 JSValue thisValue = globalObject->methodTable()->toThisObject(globalObject, exec);96 97 95 vm.timeoutChecker.start(); 98 96 JSValue returnValue = scriptExecutionContext->isDocument() 99 ? JSMainThreadExecState::call(exec, jsFunction, callType, callData, thisValue, args)100 : JSC::call(exec, jsFunction, callType, callData, thisValue, args);97 ? JSMainThreadExecState::call(exec, jsFunction, callType, callData, globalObject, args) 98 : JSC::call(exec, jsFunction, callType, callData, globalObject, args); 101 99 vm.timeoutChecker.stop(); 102 100 -
branches/dfgFourthTier/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
r148697 r149527 113 113 return jsUndefined(); 114 114 115 JSObject* thisObject = exec->argument(0).toThisObject(exec);115 JSObject* thisObject = jsCast<JSObject*>(exec->argument(0).toThis(exec, NotStrictMode)); 116 116 String result = thisObject->methodTable()->className(thisObject); 117 117 return jsStringWithCache(exec, result); -
branches/dfgFourthTier/Source/WebCore/bindings/js/JSMainThreadExecState.h
r130021 r149527 51 51 { 52 52 JSMainThreadExecState currentState(exec); 53 // Ensure DOM global object is unwrapped to the shell.54 if (thisValue.isObject())55 thisValue = thisValue.toThisObject(exec);56 53 return JSC::call(exec, functionObject, callType, callData, thisValue, args); 57 54 }; -
branches/dfgFourthTier/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r148697 r149527 2311 2311 } else { 2312 2312 if ($interfaceName eq "DOMWindow") { 2313 push(@implContent, " $className* castedThis = toJSDOMWindow(exec->hostThisValue().toThis Object(exec));\n");2313 push(@implContent, " $className* castedThis = toJSDOMWindow(exec->hostThisValue().toThis(exec, NotStrictMode));\n"); 2314 2314 push(@implContent, " if (!castedThis)\n"); 2315 2315 push(@implContent, " return throwVMTypeError(exec);\n"); 2316 2316 } elsif ($interface->extendedAttributes->{"IsWorkerContext"}) { 2317 push(@implContent, " $className* castedThis = to${className}(exec->hostThisValue().toThis Object(exec));\n");2317 push(@implContent, " $className* castedThis = to${className}(exec->hostThisValue().toThis(exec, NotStrictMode));\n"); 2318 2318 push(@implContent, " if (!castedThis)\n"); 2319 2319 push(@implContent, " return throwVMTypeError(exec);\n"); -
branches/dfgFourthTier/Source/WebCore/bridge/NP_jsobject.cpp
r130612 r149527 235 235 MarkedArgumentBuffer argList; 236 236 getListFromVariantArgs(exec, args, argCount, rootObject, argList); 237 JSValue resultV = JSC::call(exec, function, callType, callData, obj->imp ->methodTable()->toThisObject(obj->imp, exec), argList);237 JSValue resultV = JSC::call(exec, function, callType, callData, obj->imp, argList); 238 238 239 239 // Convert and return the result of the function call. -
branches/dfgFourthTier/Source/WebKit/mac/ChangeLog
r148697 r149527 1 2013-05-03 Geoffrey Garen <ggaren@apple.com> 2 3 Rationalized 'this' value conversion 4 https://bugs.webkit.org/show_bug.cgi?id=115542 5 6 Reviewed by Filip Pizlo. 7 8 Updated to match JSC requirement that the callee performs 'this' value 9 conversion. 10 11 * Plugins/Hosted/NetscapePluginInstanceProxy.mm: 12 (WebKit::NetscapePluginInstanceProxy::invoke): 13 (WebKit::NetscapePluginInstanceProxy::invokeDefault): 14 1 15 2013-04-18 Geoffrey Garen <ggaren@apple.com> 2 16 -
branches/dfgFourthTier/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
r148697 r149527 914 914 demarshalValues(exec, argumentsData, argumentsLength, argList); 915 915 916 JSValue value = call(exec, function, callType, callData, object ->methodTable()->toThisObject(object, exec), argList);916 JSValue value = call(exec, function, callType, callData, object, argList); 917 917 918 918 marshalValue(exec, value, resultData, resultLength); … … 946 946 demarshalValues(exec, argumentsData, argumentsLength, argList); 947 947 948 JSValue value = call(exec, object, callType, callData, object ->methodTable()->toThisObject(object, exec), argList);948 JSValue value = call(exec, object, callType, callData, object, argList); 949 949 950 950 marshalValue(exec, value, resultData, resultLength); -
branches/dfgFourthTier/Source/WebKit2/ChangeLog
r148697 r149527 1 2013-05-03 Geoffrey Garen <ggaren@apple.com> 2 3 Rationalized 'this' value conversion 4 https://bugs.webkit.org/show_bug.cgi?id=115542 5 6 Reviewed by Filip Pizlo. 7 8 Updated to match JSC requirement that the callee performs 'this' value 9 conversion. 10 11 * WebProcess/Plugins/Netscape/NPJSObject.cpp: 12 (WebKit::NPJSObject::invoke): 13 1 14 2013-04-18 Geoffrey Garen <ggaren@apple.com> 2 15 -
branches/dfgFourthTier/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp
r148697 r149527 294 294 295 295 exec->vm().timeoutChecker.start(); 296 JSValue value = JSC::call(exec, function, callType, callData, m_jsObject ->methodTable()->toThisObject(m_jsObject.get(), exec), argumentList);296 JSValue value = JSC::call(exec, function, callType, callData, m_jsObject.get(), argumentList); 297 297 exec->vm().timeoutChecker.stop(); 298 298
Note:
See TracChangeset
for help on using the changeset viewer.