diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/CommonSlowPaths.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/CommonSlowPaths.h | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/Source/JavaScriptCore/runtime/CommonSlowPaths.h b/Source/JavaScriptCore/runtime/CommonSlowPaths.h index 0d3480104..e4c76ad16 100644 --- a/Source/JavaScriptCore/runtime/CommonSlowPaths.h +++ b/Source/JavaScriptCore/runtime/CommonSlowPaths.h @@ -119,123 +119,6 @@ inline bool opIn(ExecState* exec, JSValue propName, JSValue baseVal) return baseObj->hasProperty(exec, property); } -ALWAYS_INLINE JSValue opResolve(ExecState* exec, Identifier& ident) -{ - ScopeChainNode* scopeChain = exec->scopeChain(); - - ScopeChainIterator iter = scopeChain->begin(); - ScopeChainIterator end = scopeChain->end(); - ASSERT(iter != end); - - do { - JSObject* o = iter->get(); - PropertySlot slot(o); - if (o->getPropertySlot(exec, ident, slot)) - return slot.getValue(exec, ident); - } while (++iter != end); - - exec->globalData().exception = createUndefinedVariableError(exec, ident); - return JSValue(); -} - -ALWAYS_INLINE JSValue opResolveSkip(ExecState* exec, Identifier& ident, int skip) -{ - ScopeChainNode* scopeChain = exec->scopeChain(); - - ScopeChainIterator iter = scopeChain->begin(); - ScopeChainIterator end = scopeChain->end(); - ASSERT(iter != end); - CodeBlock* codeBlock = exec->codeBlock(); - bool checkTopLevel = codeBlock->codeType() == FunctionCode && codeBlock->needsFullScopeChain(); - ASSERT(skip || !checkTopLevel); - if (checkTopLevel && skip--) { - if (exec->uncheckedR(codeBlock->activationRegister()).jsValue()) - ++iter; - } - while (skip--) { - ++iter; - ASSERT(iter != end); - } - do { - JSObject* o = iter->get(); - PropertySlot slot(o); - if (o->getPropertySlot(exec, ident, slot)) - return slot.getValue(exec, ident); - } while (++iter != end); - - exec->globalData().exception = createUndefinedVariableError(exec, ident); - return JSValue(); -} - -ALWAYS_INLINE JSValue opResolveWithBase(ExecState* exec, Identifier& ident, Register& baseSlot) -{ - ScopeChainNode* scopeChain = exec->scopeChain(); - - ScopeChainIterator iter = scopeChain->begin(); - ScopeChainIterator end = scopeChain->end(); - - // FIXME: add scopeDepthIsZero optimization - - ASSERT(iter != end); - - JSObject* base; - do { - base = iter->get(); - PropertySlot slot(base); - if (base->getPropertySlot(exec, ident, slot)) { - JSValue result = slot.getValue(exec, ident); - if (exec->globalData().exception) - return JSValue(); - - baseSlot = JSValue(base); - return result; - } - ++iter; - } while (iter != end); - - exec->globalData().exception = createUndefinedVariableError(exec, ident); - return JSValue(); -} - -ALWAYS_INLINE JSValue opResolveWithThis(ExecState* exec, Identifier& ident, Register& baseSlot) -{ - ScopeChainNode* scopeChain = exec->scopeChain(); - - ScopeChainIterator iter = scopeChain->begin(); - ScopeChainIterator end = scopeChain->end(); - - // FIXME: add scopeDepthIsZero optimization - - ASSERT(iter != end); - - JSObject* base; - do { - base = iter->get(); - ++iter; - PropertySlot slot(base); - if (base->getPropertySlot(exec, ident, slot)) { - JSValue result = slot.getValue(exec, ident); - if (exec->globalData().exception) - return JSValue(); - - // All entries on the scope chain should be EnvironmentRecords (activations etc), - // other then 'with' object, which are directly referenced from the scope chain, - // and the global object. If we hit either an EnvironmentRecord or a global - // object at the end of the scope chain, this is undefined. If we hit a non- - // EnvironmentRecord within the scope chain, pass the base as the this value. - if (iter == end || base->structure()->typeInfo().isEnvironmentRecord()) - baseSlot = jsUndefined(); - else - baseSlot = JSValue(base); - return result; - } - } while (iter != end); - - exec->globalData().exception = createUndefinedVariableError(exec, ident); - return JSValue(); -} - } } // namespace JSC::CommonSlowPaths #endif // CommonSlowPaths_h - |