Skip to content

Instantly share code, notes, and snippets.

@gskachkov
Last active November 29, 2015 00:56
Show Gist options
  • Save gskachkov/e104f7222417cdb589d9 to your computer and use it in GitHub Desktop.
Save gskachkov/e104f7222417cdb589d9 to your computer and use it in GitHub Desktop.
Release scope register
#AiCT8I:[0x10708f100->0x10709b300, NoneFunctionCall, 147 (StrictMode)]: 147 m_instructions; 1176 bytes; 1 parameter(s); 20 callee register(s); 6 variable(s)
[ 0] enter
[ 1] get_scope loc3
[ 3] mov loc4, loc3
[ 6] resolve_scope loc6, loc3, this(@id0), <ClosureVar>, 0, 0x10704b740
[ 13] mov loc7, loc6
[ 16] get_from_scope this, loc7, this(@id0), 1049603<DoNotThrowIfNotFound|ClosureVar|NotInitialization>, 1 predicting None
[ 24] resolve_scope loc8, loc3, inArrowFuction(@id1), <ClosureVar>, 0, 0x10704b740
[ 31] get_from_scope loc9, loc8, inArrowFuction(@id1), 1027<ThrowIfNotFound|ClosureVar|NotInitialization>, 0 predicting None
[ 39] jfalse loc9, 106(->145)
[ 42] get_from_scope loc8, loc7, PrivateSymbol.derivedConstructor(@id2), 1027<ThrowIfNotFound|ClosureVar|NotInitialization>, 3 predicting None
[ 50] get_by_id loc8, loc8, __proto__(@id3) predicting None
[ 59] get_from_scope loc11, loc7, PrivateSymbol.newTargetLocal(@id4), 1027<ThrowIfNotFound|ClosureVar|NotInitialization>, 2 predicting None
[ 67] mov loc5, loc11
[ 70] mov loc10, loc5
[ 73] construct loc8, loc8, 1, 16 status(Could Take Slow Path, maxNumArguments = 1) predicting None
[ 82] mov this, loc8
[ 85] put_to_scope loc7, this(@id0), this, 1049603<DoNotThrowIfNotFound|ClosureVar|NotInitialization>, <structure>, 1
[ 92] resolve_scope loc14, loc3, testCase(@id5), <GlobalVar>, 2, 0x107043700
[ 99] get_from_scope loc8, loc14, testCase(@id5), 1025<ThrowIfNotFound|GlobalVar|NotInitialization>, 121463576 predicting None
[ 107] op_check_tdz this
[ 109] get_by_id loc13, this, idValue(@id6) predicting None
[ 118] resolve_scope loc12, loc3, testValue(@id7), <GlobalVar>, 2, 0x107043700
[ 125] get_from_scope loc12, loc12, testValue(@id7), 1025<ThrowIfNotFound|GlobalVar|NotInitialization>, 121510224 predicting None
[ 133] mov loc11, String (atomic) (identifier): Error: super() should create this and put value into idValue property, ID: 4(const1)
[ 136] call loc8, loc8, 4, 20 status(Could Take Slow Path, maxNumArguments = 1) Original; predicting None
[ 145] ret Undefined(const2)
arrow#Bv985Q:[0x1055d7100->0x10549ac00, NoneFunctionCall, 67 (StrictMode)]: 67 m_instructions; 536 bytes; 1 parameter(s); 14 callee register(s); 6 variable(s)
[ 0] enter
[ 1] get_scope loc3
[ 3] mov loc4, loc3
[ 6] resolve_scope loc6, loc3, this(@id0), <ClosureVar>, 0, 0x10544ab70
[ 13] get_from_scope loc6, loc6, PrivateSymbol.derivedConstructor(@id1), 1027<ThrowIfNotFound|ClosureVar|NotInitialization>, 2 predicting None
[ 21] get_by_id loc7, loc6, __proto__(@id2) predicting None
[ 30] get_from_scope loc9, loc6, PrivateSymbol.newTargetLocal(@id3), 1027<ThrowIfNotFound|ClosureVar|NotInitialization>, 1 predicting None
[ 38] mov loc5, loc9
[ 41] mov loc8, loc5
[ 44] construct loc7, loc7, 1, 14 status(Could Take Slow Path, maxNumArguments = 1) predicting None
[ 53] mov this, loc7
[ 56] put_to_scope loc6, this(@id0), this, 1049603<DoNotThrowIfNotFound|ClosureVar|NotInitialization>, <structure>, 0
[ 63] ret loc7
[ 65] ret Undefined(const1)
RegisterID* BytecodeGenerator::emitLoadArrowFunctionLexicalEnvironment()
{
ASSERT(m_codeBlock->isArrowFunction() || m_codeBlock->isArrowFunctionContext() || constructorKind() == ConstructorKind::Derived);
if (!m_resolvedArrowFunctionScopeContextRegister)
m_resolvedArrowFunctionScopeContextRegister = emitResolveScope(nullptr, variable(propertyNames().thisIdentifier, ThisResolutionType::Scoped));
return m_resolvedArrowFunctionScopeContextRegister.get();
}
RegisterID* BytecodeGenerator::emitLoadArrowFunctionLexicalEnvironment()
{
ASSERT(m_codeBlock->isArrowFunction() || m_codeBlock->isArrowFunctionContext() || constructorKind() == ConstructorKind::Derived);
if (!m_resolvedArrowFunctionScopeContextRegister) {
RefPtr<RegisterID> temp = emitResolveScope(nullptr, variable(propertyNames().thisIdentifier, ThisResolutionType::Scoped));
m_resolvedArrowFunctionScopeContextRegister = emitMove(newTemporary(), temp.get());
m_resolvedArrowFunctionScopeContextRegister->ref();
}
return m_resolvedArrowFunctionScopeContextRegister.get();
}
@gskachkov
Copy link
Author

AiCT8I:[0x10708f100->0x10709b300, NoneFunctionCall, 147 (StrictMode)]: 147 m_instructions; 1176 bytes; 1 parameter(s); 20 callee register(s); 6 variable(s)

[ 0] enter
[ 1] get_scope loc3
[ 3] mov loc4, loc3
[ 6] resolve_scope loc6, loc3, this(@id0), , 0, 0x10704b740
[ 13] mov loc7, loc6
[ 16] get_from_scope this, loc7, this(@id0), 1049603<DoNotThrowIfNotFound|ClosureVar|NotInitialization>, 1 predicting None
[ 24] resolve_scope loc8, loc3, inArrowFuction(@id1), , 0, 0x10704b740
[ 31] get_from_scope loc9, loc8, inArrowFuction(@id1), 1027<ThrowIfNotFound|ClosureVar|NotInitialization>, 0 predicting None
[ 39] jfalse loc9, 106(->145)
[ 42] get_from_scope loc8, loc7, PrivateSymbol.derivedConstructor(@id2), 1027<ThrowIfNotFound|ClosureVar|NotInitialization>, 3 predicting None
[ 50] get_by_id loc8, loc8, proto(@id3) predicting None
[ 59] get_from_scope loc11, loc7, PrivateSymbol.newTargetLocal(@ID4), 1027<ThrowIfNotFound|ClosureVar|NotInitialization>, 2 predicting None
[ 67] mov loc5, loc11
[ 70] mov loc10, loc5
[ 73] construct loc8, loc8, 1, 16 status(Could Take Slow Path, maxNumArguments = 1) predicting None
[ 82] mov this, loc8
[ 85] put_to_scope loc7, this(@id0), this, 1049603<DoNotThrowIfNotFound|ClosureVar|NotInitialization>, , 1
[ 92] resolve_scope loc14, loc3, testCase(@id5), , 2, 0x107043700
[ 99] get_from_scope loc8, loc14, testCase(@id5), 1025<ThrowIfNotFound|GlobalVar|NotInitialization>, 121463576 predicting None
[ 107] op_check_tdz this
[ 109] get_by_id loc13, this, idValue(@id6) predicting None
[ 118] resolve_scope loc12, loc3, testValue(@id7), , 2, 0x107043700
[ 125] get_from_scope loc12, loc12, testValue(@id7), 1025<ThrowIfNotFound|GlobalVar|NotInitialization>, 121510224 predicting None
[ 133] mov loc11, String (atomic) (identifier): Error: super() should create this and put value into idValue property, ID: 4(const1)
[ 136] call loc8, loc8, 4, 20 status(Could Take Slow Path, maxNumArguments = 1) Original; predicting None
[ 145] ret Undefined(const2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment