summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/interpreter')
-rw-r--r--Source/JavaScriptCore/interpreter/CallFrame.h2
-rw-r--r--Source/JavaScriptCore/interpreter/Interpreter.cpp54
-rw-r--r--Source/JavaScriptCore/interpreter/RegisterFile.h2
3 files changed, 29 insertions, 29 deletions
diff --git a/Source/JavaScriptCore/interpreter/CallFrame.h b/Source/JavaScriptCore/interpreter/CallFrame.h
index 2797ef3..190a7c1 100644
--- a/Source/JavaScriptCore/interpreter/CallFrame.h
+++ b/Source/JavaScriptCore/interpreter/CallFrame.h
@@ -75,7 +75,7 @@ namespace JSC {
// But they're used in many places in legacy code, so they're not going away any time soon.
void clearException() { globalData().exception = JSValue(); }
- JSValue exception() const { return globalData().exception; }
+ JSValue exception() const { return globalData().exception.get(); }
bool hadException() const { return globalData().exception; }
const CommonIdentifiers& propertyNames() const { return *globalData().propertyNames; }
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 392e8b8..c2612ac 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -103,11 +103,11 @@ NEVER_INLINE bool Interpreter::resolve(CallFrame* callFrame, Instruction* vPC, J
CodeBlock* codeBlock = callFrame->codeBlock();
Identifier& ident = codeBlock->identifier(property);
do {
- JSObject* o = *iter;
+ JSObject* o = iter->get();
PropertySlot slot(o);
if (o->getPropertySlot(callFrame, ident, slot)) {
JSValue result = slot.getValue(callFrame, ident);
- exceptionValue = callFrame->globalData().exception;
+ exceptionValue = callFrame->globalData().exception.get();
if (exceptionValue)
return false;
callFrame->uncheckedR(dst) = JSValue(result);
@@ -142,11 +142,11 @@ NEVER_INLINE bool Interpreter::resolveSkip(CallFrame* callFrame, Instruction* vP
}
Identifier& ident = codeBlock->identifier(property);
do {
- JSObject* o = *iter;
+ JSObject* o = iter->get();
PropertySlot slot(o);
if (o->getPropertySlot(callFrame, ident, slot)) {
JSValue result = slot.getValue(callFrame, ident);
- exceptionValue = callFrame->globalData().exception;
+ exceptionValue = callFrame->globalData().exception.get();
if (exceptionValue)
return false;
ASSERT(result);
@@ -187,7 +187,7 @@ NEVER_INLINE bool Interpreter::resolveGlobal(CallFrame* callFrame, Instruction*
return true;
}
- exceptionValue = callFrame->globalData().exception;
+ exceptionValue = callFrame->globalData().exception.get();
if (exceptionValue)
return false;
callFrame->uncheckedR(dst) = JSValue(result);
@@ -220,14 +220,14 @@ NEVER_INLINE bool Interpreter::resolveGlobalDynamic(CallFrame* callFrame, Instru
++iter;
}
while (skip--) {
- JSObject* o = *iter;
+ JSObject* o = iter->get();
if (o->hasCustomProperties()) {
Identifier& ident = codeBlock->identifier(property);
do {
PropertySlot slot(o);
if (o->getPropertySlot(callFrame, ident, slot)) {
JSValue result = slot.getValue(callFrame, ident);
- exceptionValue = callFrame->globalData().exception;
+ exceptionValue = callFrame->globalData().exception.get();
if (exceptionValue)
return false;
ASSERT(result);
@@ -236,7 +236,7 @@ NEVER_INLINE bool Interpreter::resolveGlobalDynamic(CallFrame* callFrame, Instru
}
if (iter == end)
break;
- o = *iter;
+ o = iter->get();
++iter;
} while (true);
exceptionValue = createUndefinedVariableError(callFrame, ident);
@@ -266,7 +266,7 @@ NEVER_INLINE bool Interpreter::resolveGlobalDynamic(CallFrame* callFrame, Instru
return true;
}
- exceptionValue = callFrame->globalData().exception;
+ exceptionValue = callFrame->globalData().exception.get();
if (exceptionValue)
return false;
ASSERT(result);
@@ -310,11 +310,11 @@ NEVER_INLINE bool Interpreter::resolveBaseAndProperty(CallFrame* callFrame, Inst
Identifier& ident = codeBlock->identifier(property);
JSObject* base;
do {
- base = *iter;
+ base = iter->get();
PropertySlot slot(base);
if (base->getPropertySlot(callFrame, ident, slot)) {
JSValue result = slot.getValue(callFrame, ident);
- exceptionValue = callFrame->globalData().exception;
+ exceptionValue = callFrame->globalData().exception.get();
if (exceptionValue)
return false;
callFrame->uncheckedR(propDst) = JSValue(result);
@@ -566,11 +566,13 @@ NEVER_INLINE bool Interpreter::unwindCallFrame(CallFrame*& callFrame, JSValue ex
}
while (!scopeChain->object->inherits(&JSActivation::info))
scopeChain = scopeChain->pop();
- JSActivation* activation = asActivation(scopeChain->object);
+
+ callFrame->setScopeChain(scopeChain);
+ JSActivation* activation = asActivation(scopeChain->object.get());
activation->copyRegisters();
if (JSValue arguments = callFrame->uncheckedR(unmodifiedArgumentsRegister(oldCodeBlock->argumentsRegister())).jsValue()) {
if (!oldCodeBlock->isStrictMode())
- asArguments(arguments)->setActivation(activation);
+ asArguments(arguments)->setActivation(callFrame->globalData(), activation);
}
} else if (oldCodeBlock->usesArguments() && !oldCodeBlock->isStrictMode()) {
if (JSValue arguments = callFrame->uncheckedR(unmodifiedArgumentsRegister(oldCodeBlock->argumentsRegister())).jsValue())
@@ -648,7 +650,7 @@ static void appendSourceToError(CallFrame* callFrame, ErrorInstance* exception,
message = makeUString(message, " (near '...", codeBlock->source()->getRange(start, stop), "...')");
}
- exception->putDirect(globalData->propertyNames->message, jsString(globalData, message));
+ exception->putDirect(*globalData, globalData->propertyNames->message, jsString(globalData, message));
}
NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSValue& exceptionValue, unsigned bytecodeOffset)
@@ -1085,7 +1087,7 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObjec
for (ScopeChainNode* node = scopeChain; ; node = node->next) {
ASSERT(node);
if (node->object->isVariableObject()) {
- variableObject = static_cast<JSVariableObject*>(node->object);
+ variableObject = static_cast<JSVariableObject*>(node->object.get());
break;
}
}
@@ -1100,7 +1102,7 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObjec
pushedScope = true;
}
// Scope for BatchedTransitionOptimizer
- BatchedTransitionOptimizer optimizer(variableObject);
+ BatchedTransitionOptimizer optimizer(callFrame->globalData(), variableObject);
for (unsigned i = 0; i < numVariables; ++i) {
const Identifier& ident = codeBlock->variable(i);
@@ -1371,7 +1373,7 @@ NEVER_INLINE void Interpreter::tryCacheGetByID(CallFrame* callFrame, CodeBlock*
// Since we're accessing a prototype in a loop, it's a good bet that it
// should not be treated as a dictionary.
if (baseObject->structure()->isDictionary()) {
- baseObject->flattenDictionaryObject();
+ baseObject->flattenDictionaryObject(callFrame->globalData());
offset = baseObject->structure()->get(propertyName);
}
@@ -1475,8 +1477,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
#define CHECK_FOR_EXCEPTION() \
do { \
- if (UNLIKELY(globalData->exception != JSValue())) { \
- exceptionValue = globalData->exception; \
+ if (UNLIKELY(globalData->exception.get() != JSValue())) { \
+ exceptionValue = globalData->exception.get(); \
goto vm_throw; \
} \
} while (0)
@@ -2408,7 +2410,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
ASSERT(iter != end);
}
ASSERT((*iter)->isVariableObject());
- JSVariableObject* scope = static_cast<JSVariableObject*>(*iter);
+ JSVariableObject* scope = static_cast<JSVariableObject*>(iter->get());
callFrame->uncheckedR(dst) = scope->registerAt(index);
ASSERT(callFrame->r(dst).jsValue());
vPC += OPCODE_LENGTH(op_get_scoped_var);
@@ -2439,7 +2441,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
}
ASSERT((*iter)->isVariableObject());
- JSVariableObject* scope = static_cast<JSVariableObject*>(*iter);
+ JSVariableObject* scope = static_cast<JSVariableObject*>(iter->get());
ASSERT(callFrame->r(value).jsValue());
scope->registerAt(index) = JSValue(callFrame->r(value).jsValue());
vPC += OPCODE_LENGTH(op_put_scoped_var);
@@ -3080,7 +3082,7 @@ skip_id_custom_self:
int value = vPC[3].u.operand;
unsigned offset = vPC[7].u.operand;
ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock->identifier(vPC[2].u.operand))) == offset);
- baseObject->putDirectOffset(offset, callFrame->r(value).jsValue());
+ baseObject->putDirectOffset(callFrame->globalData(), offset, callFrame->r(value).jsValue());
vPC += OPCODE_LENGTH(op_put_by_id_transition);
NEXT_INSTRUCTION();
@@ -3115,7 +3117,7 @@ skip_id_custom_self:
unsigned offset = vPC[5].u.operand;
ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(codeBlock->identifier(vPC[2].u.operand))) == offset);
- baseObject->putDirectOffset(offset, callFrame->r(value).jsValue());
+ baseObject->putDirectOffset(callFrame->globalData(), offset, callFrame->r(value).jsValue());
vPC += OPCODE_LENGTH(op_put_by_id_replace);
NEXT_INSTRUCTION();
@@ -3309,7 +3311,7 @@ skip_id_custom_self:
if (isJSArray(globalData, baseValue)) {
JSArray* jsArray = asArray(baseValue);
if (jsArray->canSetIndex(i))
- jsArray->setIndex(i, callFrame->r(value).jsValue());
+ jsArray->setIndex(*globalData, i, callFrame->r(value).jsValue());
else
jsArray->JSArray::put(callFrame, i, callFrame->r(value).jsValue());
} else if (isJSByteArray(globalData, baseValue) && asByteArray(baseValue)->canAccessIndex(i)) {
@@ -3835,7 +3837,7 @@ skip_id_custom_self:
if (thisValue == globalObject && funcVal == globalObject->evalFunction()) {
JSValue result = callEval(callFrame, registerFile, argv, argCount, registerOffset);
- if ((exceptionValue = globalData->exception))
+ if ((exceptionValue = globalData->exception.get()))
goto vm_throw;
functionReturnValue = result;
@@ -4103,7 +4105,7 @@ skip_id_custom_self:
if (JSValue argumentsValue = callFrame->r(unmodifiedArgumentsRegister(arguments)).jsValue()) {
if (!codeBlock->isStrictMode())
- asArguments(argumentsValue)->setActivation(asActivation(activationValue));
+ asArguments(argumentsValue)->setActivation(*globalData, asActivation(activationValue));
}
} else if (JSValue argumentsValue = callFrame->r(unmodifiedArgumentsRegister(arguments)).jsValue()) {
if (!codeBlock->isStrictMode())
diff --git a/Source/JavaScriptCore/interpreter/RegisterFile.h b/Source/JavaScriptCore/interpreter/RegisterFile.h
index 9dfc432..e9c6df1 100644
--- a/Source/JavaScriptCore/interpreter/RegisterFile.h
+++ b/Source/JavaScriptCore/interpreter/RegisterFile.h
@@ -132,8 +132,6 @@ namespace JSC {
Register* lastGlobal() const { return m_start - m_numGlobals; }
- void markCallFrames(ConservativeSet& conservativeSet, Heap* heap) { heap->markConservatively(conservativeSet, m_start, m_end); }
-
static size_t committedByteCount();
static void initializeThreading();