Changeset 174478 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- Oct 8, 2014, 1:54:24 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r174473 r174478 1 2014-10-08 Oliver Hunt <[email protected]> 2 3 Make sure arguments tearoff is performed through the environment record if necessary 4 https://bugs.webkit.org/show_bug.cgi?id=137538 5 6 Reviewed by Michael Saboff. 7 8 Fairly simple change. If we have a lexical record we need to pull the unmodified 9 arguments object from the record and then use the standard op_tear_off_arguments 10 instruction on the temporary. 11 12 * bytecompiler/BytecodeGenerator.cpp: 13 (JSC::BytecodeGenerator::emitGetOwnScope): 14 (JSC::BytecodeGenerator::emitReturn): 15 * bytecompiler/BytecodeGenerator.h: 16 1 17 2014-10-08 [email protected] <[email protected]> 2 18 -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r174401 r174478 1300 1300 } 1301 1301 1302 1303 RegisterID* BytecodeGenerator::emitGetOwnScope(RegisterID* dst, const Identifier& identifier, OwnScopeLookupRules) 1304 { 1305 emitOpcode(op_resolve_scope); 1306 instructions().append(kill(dst)); 1307 instructions().append(addConstant(identifier)); 1308 instructions().append(LocalClosureVar); 1309 // This should be m_localScopeDepth if we aren't doing 1310 // resolution during emitReturn() 1311 instructions().append(0); 1312 instructions().append(0); 1313 return dst; 1314 } 1315 1302 1316 RegisterID* BytecodeGenerator::emitResolveConstantLocal(RegisterID* dst, const Identifier& identifier, ResolveScopeInfo& info) 1303 1317 { … … 1907 1921 { 1908 1922 if (m_codeBlock->usesArguments() && m_codeBlock->numParameters() != 1 && !isStrictMode()) { 1923 RefPtr<RegisterID> scratchRegister; 1924 int argumentsIndex = unmodifiedArgumentsRegister(m_codeBlock->argumentsRegister()).offset(); 1925 if (m_lexicalEnvironmentRegister && m_codeType == FunctionCode) { 1926 scratchRegister = newTemporary(); 1927 emitGetOwnScope(scratchRegister.get(), propertyNames().arguments, OwnScopeForReturn); 1928 ResolveScopeInfo scopeInfo(unmodifiedArgumentsRegister(m_codeBlock->argumentsRegister()).offset()); 1929 emitGetFromScope(scratchRegister.get(), scratchRegister.get(), propertyNames().arguments, ThrowIfNotFound, scopeInfo); 1930 argumentsIndex = scratchRegister->index(); 1931 } 1909 1932 emitOpcode(op_tear_off_arguments); 1910 instructions().append( unmodifiedArgumentsRegister(m_codeBlock->argumentsRegister()).offset());1933 instructions().append(argumentsIndex); 1911 1934 instructions().append(m_lexicalEnvironmentRegister ? m_lexicalEnvironmentRegister->index() : emitLoad(0, JSValue())->index()); 1912 1935 } -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r174401 r174478 660 660 RegisterID* initializeCapturedVariable(RegisterID* dst, const Identifier&, RegisterID*); 661 661 662 // We'll may want a non-return mode in future, but currently 663 // this is only used during emitReturn(). emitReturn() occurs 664 // with the novel state of having popped off all the local scope 665 // nodes, but not actually modify any internal stack depth tracking. 666 enum OwnScopeLookupRules { OwnScopeForReturn }; 667 RegisterID* emitGetOwnScope(RegisterID* dst, const Identifier&, OwnScopeLookupRules); 668 662 669 public: 663 670 JSString* addStringConstant(const Identifier&);
Note:
See TracChangeset
for help on using the changeset viewer.