Changeset 174478 in webkit for trunk/Source/JavaScriptCore/bytecompiler
- Timestamp:
- Oct 8, 2014, 1:54:24 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore/bytecompiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.