Commit 168e5064 authored by oliver@apple.com's avatar oliver@apple.com

2011-01-31 Oliver Hunt <oliver@apple.com>

        Convert markstack to a slot visitor API
        https://bugs.webkit.org/show_bug.cgi?id=53219

        rolling r77098, r77099, r77100, r77109, and
        r77111 back in, along with a few more Qt fix attempts.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 200b5925
......@@ -54,11 +54,11 @@ struct JSCallbackObjectData {
return m_privateProperties->getPrivateProperty(propertyName);
}
void setPrivateProperty(const Identifier& propertyName, JSValue value)
void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value)
{
if (!m_privateProperties)
m_privateProperties = adoptPtr(new JSPrivatePropertyMap);
m_privateProperties->setPrivateProperty(propertyName, value);
m_privateProperties->setPrivateProperty(globalData, owner, propertyName, value);
}
void deletePrivateProperty(const Identifier& propertyName)
......@@ -83,12 +83,13 @@ struct JSCallbackObjectData {
PrivatePropertyMap::const_iterator location = m_propertyMap.find(propertyName.impl());
if (location == m_propertyMap.end())
return JSValue();
return location->second;
return location->second.get();
}
void setPrivateProperty(const Identifier& propertyName, JSValue value)
void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value)
{
m_propertyMap.set(propertyName.impl(), value);
WriteBarrier<Unknown> empty;
m_propertyMap.add(propertyName.impl(), empty).first->second.set(globalData, owner, value);
}
void deletePrivateProperty(const Identifier& propertyName)
......@@ -100,12 +101,12 @@ struct JSCallbackObjectData {
{
for (PrivatePropertyMap::iterator ptr = m_propertyMap.begin(); ptr != m_propertyMap.end(); ++ptr) {
if (ptr->second)
markStack.append(ptr->second);
markStack.append(&ptr->second);
}
}
private:
typedef HashMap<RefPtr<StringImpl>, JSValue, IdentifierRepHash> PrivatePropertyMap;
typedef HashMap<RefPtr<StringImpl>, WriteBarrier<Unknown>, IdentifierRepHash> PrivatePropertyMap;
PrivatePropertyMap m_propertyMap;
};
OwnPtr<JSPrivatePropertyMap> m_privateProperties;
......@@ -137,9 +138,9 @@ public:
return m_callbackObjectData->getPrivateProperty(propertyName);
}
void setPrivateProperty(const Identifier& propertyName, JSValue value)
void setPrivateProperty(JSGlobalData& globalData, const Identifier& propertyName, JSValue value)
{
m_callbackObjectData->setPrivateProperty(propertyName, value);
m_callbackObjectData->setPrivateProperty(globalData, this, propertyName, value);
}
void deletePrivateProperty(const Identifier& propertyName)
......
......@@ -238,7 +238,7 @@ void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName
if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
if (entry->attributes & kJSPropertyAttributeReadOnly)
return;
JSCallbackObject<Base>::putDirect(propertyName, value); // put as override property
JSCallbackObject<Base>::putDirect(exec->globalData(), propertyName, value); // put as override property
return;
}
}
......@@ -565,7 +565,7 @@ JSValue JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, JSValue sl
if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) {
JSObject* o = new (exec) JSCallbackFunction(exec, asGlobalObject(thisObj->getAnonymousValue(0)), callAsFunction, propertyName);
thisObj->putDirect(propertyName, o, entry->attributes);
thisObj->putDirect(exec->globalData(), propertyName, o, entry->attributes);
return o;
}
}
......
......@@ -108,7 +108,7 @@ JSObjectRef JSObjectMakeConstructor(JSContextRef ctx, JSClassRef jsClass, JSObje
jsPrototype = exec->lexicalGlobalObject()->objectPrototype();
JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor);
constructor->putDirect(exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly);
constructor->putDirect(exec->globalData(), exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly);
return toRef(constructor);
}
......@@ -385,11 +385,11 @@ bool JSObjectSetPrivateProperty(JSContextRef ctx, JSObjectRef object, JSStringRe
JSValue jsValue = value ? toJS(exec, value) : JSValue();
Identifier name(propertyName->identifier(&exec->globalData()));
if (jsObject->inherits(&JSCallbackObject<JSGlobalObject>::info)) {
static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->setPrivateProperty(name, jsValue);
static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->setPrivateProperty(exec->globalData(), name, jsValue);
return true;
}
if (jsObject->inherits(&JSCallbackObject<JSObjectWithGlobalObject>::info)) {
static_cast<JSCallbackObject<JSObjectWithGlobalObject>*>(jsObject)->setPrivateProperty(name, jsValue);
static_cast<JSCallbackObject<JSObjectWithGlobalObject>*>(jsObject)->setPrivateProperty(exec->globalData(), name, jsValue);
return true;
}
return false;
......
......@@ -37,7 +37,7 @@ class JSObject;
typedef void (*JSWeakMapDestroyedCallback)(struct OpaqueJSWeakObjectMap*, void*);
typedef JSC::WeakGCMap<void*, JSC::JSObject*> WeakMapType;
typedef JSC::WeakGCMap<void*, JSC::JSObject> WeakMapType;
struct OpaqueJSWeakObjectMap : public RefCounted<OpaqueJSWeakObjectMap> {
public:
......
This diff is collapsed.
......@@ -182,7 +182,7 @@ __ZN3JSC17BytecodeGenerator21setDumpsGeneratedCodeEb
__ZN3JSC17PropertyNameArray3addEPN3WTF10StringImplE
__ZN3JSC17constructFunctionEPNS_9ExecStateERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
__ZN3JSC17createSyntaxErrorEPNS_9ExecStateERKNS_7UStringE
__ZN3JSC18DebuggerActivationC1EPNS_8JSObjectE
__ZN3JSC18DebuggerActivationC1ERNS_12JSGlobalDataEPNS_8JSObjectE
__ZN3JSC18PropertyDescriptor11setWritableEb
__ZN3JSC18PropertyDescriptor12setUndefinedEv
__ZN3JSC18PropertyDescriptor13setDescriptorENS_7JSValueEj
......@@ -250,7 +250,7 @@ __ZN3JSC7JSArray18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
__ZN3JSC7JSArray4infoE
__ZN3JSC7JSArray9setLengthEj
__ZN3JSC7JSArrayC1EN3WTF17NonNullPassRefPtrINS_9StructureEEE
__ZN3JSC7JSArrayC1EN3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_7ArgListE
__ZN3JSC7JSArrayC1ERNS_12JSGlobalDataEN3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_7ArgListE
__ZN3JSC7JSArrayC2EN3WTF17NonNullPassRefPtrINS_9StructureEEE
__ZN3JSC7JSArrayD2Ev
__ZN3JSC7JSValue13isValidCalleeEv
......
......@@ -10,7 +10,7 @@ EXPORTS
??0DynamicGlobalObjectScope@JSC@@QAE@PAVExecState@1@PAVJSGlobalObject@1@@Z
??0InternalFunction@JSC@@IAE@PAVJSGlobalData@1@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVIdentifier@1@@Z
??0JSArray@JSC@@QAE@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@@Z
??0JSArray@JSC@@QAE@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVArgList@1@@Z
??0JSArray@JSC@@QAE@AAVJSGlobalData@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVArgList@1@@Z
??0JSByteArray@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@PAVByteArray@4@PBUClassInfo@1@@Z
??0JSFunction@JSC@@QAE@PAVExecState@1@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@HABVIdentifier@1@P6I_J0@Z@Z
??0JSObjectWithGlobalObject@JSC@@IAE@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@@Z
......
......@@ -373,6 +373,7 @@
A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */; };
A7C530E4102A3813005BC741 /* MarkStackPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */; };
A7D649AA1015224E009B2E1B /* PossiblyNull.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D649A91015224E009B2E1B /* PossiblyNull.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7DCB97312E5193F00911940 /* WriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A7DCB77912E3D90500911940 /* WriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7E2EA6B0FB460CF00601F06 /* LiteralParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E2EA690FB460CF00601F06 /* LiteralParser.h */; };
A7E2EA6C0FB460CF00601F06 /* LiteralParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */; };
A7F19ECE11DD490900931E70 /* FixedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F19ECD11DD490900931E70 /* FixedArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -1044,6 +1045,7 @@
A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITPropertyAccess32_64.cpp; sourceTree = "<group>"; };
A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkStackPosix.cpp; sourceTree = "<group>"; };
A7D649A91015224E009B2E1B /* PossiblyNull.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PossiblyNull.h; sourceTree = "<group>"; };
A7DCB77912E3D90500911940 /* WriteBarrier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WriteBarrier.h; sourceTree = "<group>"; };
A7E2EA690FB460CF00601F06 /* LiteralParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiteralParser.h; sourceTree = "<group>"; };
A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralParser.cpp; sourceTree = "<group>"; };
A7E42C180E3938830065A544 /* JSStaticScopeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStaticScopeObject.h; sourceTree = "<group>"; };
......@@ -1906,6 +1908,7 @@
14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */,
14035DB010DBFB2A00FFFFE7 /* WeakGCPtr.h */,
1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */,
A7DCB77912E3D90500911940 /* WriteBarrier.h */,
);
path = runtime;
sourceTree = "<group>";
......@@ -2431,6 +2434,7 @@
86704B4312DB8A8100A9FE7B /* YarrSyntaxChecker.h in Headers */,
5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */,
451539B912DC994500EF7AC4 /* Yarr.h in Headers */,
A7DCB97312E5193F00911940 /* WriteBarrier.h in Headers */,
E49DC16C12EF294E00184A1F /* SourceProviderCache.h in Headers */,
E49DC16D12EF295300184A1F /* SourceProviderCacheItem.h in Headers */,
);
......
......@@ -1529,12 +1529,12 @@ void CodeBlock::refStructures(Instruction* vPC) const
void CodeBlock::markAggregate(MarkStack& markStack)
{
for (size_t i = 0; i < m_constantRegisters.size(); ++i)
markStack.append(m_constantRegisters[i].jsValue());
markStack.deprecatedAppend(&m_constantRegisters[i]);
for (size_t i = 0; i < m_functionExprs.size(); ++i)
m_functionExprs[i]->markAggregate(markStack);
for (size_t i = 0; i < m_functionDecls.size(); ++i)
m_functionDecls[i]->markAggregate(markStack);
markStack.append(m_globalObject);
markStack.append(&m_globalObject);
}
HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset)
......
......@@ -248,7 +248,7 @@ namespace JSC {
protected:
CodeBlock(ScriptExecutable* ownerExecutable, CodeType, JSGlobalObject*, PassRefPtr<SourceProvider>, unsigned sourceOffset, SymbolTable* symbolTable, bool isConstructor);
JSGlobalObject* m_globalObject;
DeprecatedPtr<JSGlobalObject> m_globalObject;
public:
virtual ~CodeBlock();
......@@ -485,7 +485,7 @@ namespace JSC {
unsigned addRegExp(RegExp* r) { createRareDataIfNecessary(); unsigned size = m_rareData->m_regexps.size(); m_rareData->m_regexps.append(r); return size; }
RegExp* regexp(int index) const { ASSERT(m_rareData); return m_rareData->m_regexps[index].get(); }
JSGlobalObject* globalObject() { return m_globalObject; }
JSGlobalObject* globalObject() { return m_globalObject.get(); }
// Jump Tables
......
......@@ -251,7 +251,7 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const ScopeChain&
for (SymbolTable::iterator it = symbolTable->begin(); it != end; ++it)
registerFor(it->second.getIndex()).setIndex(it->second.getIndex() + m_globalVarStorageOffset);
BatchedTransitionOptimizer optimizer(globalObject);
BatchedTransitionOptimizer optimizer(*m_globalData, globalObject);
const VarStack& varStack = programNode->varStack();
const FunctionStack& functionStack = programNode->functionStack();
......@@ -903,7 +903,7 @@ PassRefPtr<Label> BytecodeGenerator::emitJumpIfNotFunctionCall(RegisterID* cond,
emitOpcode(op_jneq_ptr);
instructions().append(cond->index());
instructions().append(m_scopeChain->globalObject()->d()->callFunction);
instructions().append(m_scopeChain->globalObject()->d()->callFunction.get());
instructions().append(target->bind(begin, instructions().size()));
return target;
}
......@@ -914,7 +914,7 @@ PassRefPtr<Label> BytecodeGenerator::emitJumpIfNotFunctionApply(RegisterID* cond
emitOpcode(op_jneq_ptr);
instructions().append(cond->index());
instructions().append(m_scopeChain->globalObject()->d()->applyFunction);
instructions().append(m_scopeChain->globalObject()->d()->applyFunction.get());
instructions().append(target->bind(begin, instructions().size()));
return target;
}
......@@ -1117,7 +1117,7 @@ bool BytecodeGenerator::findScopedProperty(const Identifier& property, int& inde
if (shouldOptimizeLocals() && m_codeType == GlobalCode) {
ScopeChainIterator iter = m_scopeChain->begin();
globalObject = *iter;
globalObject = iter->get();
ASSERT((++iter) == m_scopeChain->end());
}
return false;
......@@ -1128,7 +1128,7 @@ bool BytecodeGenerator::findScopedProperty(const Identifier& property, int& inde
ScopeChainIterator iter = m_scopeChain->begin();
ScopeChainIterator end = m_scopeChain->end();
for (; iter != end; ++iter, ++depth) {
JSObject* currentScope = *iter;
JSObject* currentScope = iter->get();
if (!currentScope->isVariableObject())
break;
JSVariableObject* currentVariableObject = static_cast<JSVariableObject*>(currentScope);
......@@ -1157,7 +1157,7 @@ bool BytecodeGenerator::findScopedProperty(const Identifier& property, int& inde
// Can't locate the property but we're able to avoid a few lookups.
stackDepth = depth + m_codeBlock->needsFullScopeChain();
index = missingSymbolMarker();
JSObject* scope = *iter;
JSObject* scope = iter->get();
if (++iter == end)
globalObject = scope;
return true;
......
......@@ -109,7 +109,7 @@ JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSG
JSGlobalData& globalData = globalObject->globalData();
JSValue result = globalData.interpreter->execute(eval.get(), globalCallFrame, globalObject, globalCallFrame->scopeChain());
if (globalData.exception) {
exception = globalData.exception;
exception = globalData.exception.get();
globalData.exception = JSValue();
}
ASSERT(result);
......
......@@ -30,12 +30,12 @@
namespace JSC {
DebuggerActivation::DebuggerActivation(JSObject* activation)
DebuggerActivation::DebuggerActivation(JSGlobalData& globalData, JSObject* activation)
: JSObject(DebuggerActivation::createStructure(jsNull()))
{
ASSERT(activation);
ASSERT(activation->isActivationObject());
m_activation = static_cast<JSActivation*>(activation);
m_activation.set(globalData, this, static_cast<JSActivation*>(activation));
}
void DebuggerActivation::markChildren(MarkStack& markStack)
......@@ -43,7 +43,7 @@ void DebuggerActivation::markChildren(MarkStack& markStack)
JSObject::markChildren(markStack);
if (m_activation)
markStack.append(m_activation);
markStack.append(&m_activation);
}
UString DebuggerActivation::className() const
......
......@@ -34,7 +34,7 @@ namespace JSC {
class DebuggerActivation : public JSObject {
public:
DebuggerActivation(JSObject*);
DebuggerActivation(JSGlobalData&, JSObject*);
virtual void markChildren(MarkStack&);
virtual UString className() const;
......@@ -58,7 +58,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | JSObject::StructureFlags;
private:
JSActivation* m_activation;
WriteBarrier<JSActivation> m_activation;
};
} // namespace JSC
......
......@@ -96,7 +96,7 @@ JSValue DebuggerCallFrame::evaluate(const UString& script, JSValue& exception) c
JSGlobalData& globalData = m_callFrame->globalData();
JSValue result = globalData.interpreter->execute(eval.get(), m_callFrame, thisObject(), m_callFrame->scopeChain());
if (globalData.exception) {
exception = globalData.exception;
exception = globalData.exception.get();
globalData.exception = JSValue();
}
ASSERT(result);
......
......@@ -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; }
......
......@@ -845,7 +845,7 @@ NEVER_INLINE void JITThunks::tryCacheGetByID(CallFrame* callFrame, CodeBlock* co
// Since we're accessing a prototype in a loop, it's a good bet that it
// should not be treated as a dictionary.
if (slotBaseObject->structure()->isDictionary()) {
slotBaseObject->flattenDictionaryObject();
slotBaseObject->flattenDictionaryObject(callFrame->globalData());
offset = slotBaseObject->structure()->get(propertyName);
}
......@@ -942,17 +942,17 @@ static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalD
#define CHECK_FOR_EXCEPTION() \
do { \
if (UNLIKELY(stackFrame.globalData->exception)) \
if (UNLIKELY(stackFrame.globalData->exception.get())) \
VM_THROW_EXCEPTION(); \
} while (0)
#define CHECK_FOR_EXCEPTION_AT_END() \
do { \
if (UNLIKELY(stackFrame.globalData->exception)) \
if (UNLIKELY(stackFrame.globalData->exception.get())) \
VM_THROW_EXCEPTION_AT_END(); \
} while (0)
#define CHECK_FOR_EXCEPTION_VOID() \
do { \
if (UNLIKELY(stackFrame.globalData->exception)) { \
if (UNLIKELY(stackFrame.globalData->exception.get())) { \
VM_THROW_EXCEPTION_AT_END(); \
return; \
} \
......@@ -1466,7 +1466,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_method_check)
// Since we're accessing a prototype in a loop, it's a good bet that it
// should not be treated as a dictionary.
if (slotBaseObject->structure()->isDictionary())
slotBaseObject->flattenDictionaryObject();
slotBaseObject->flattenDictionaryObject(callFrame->globalData());
// The result fetched should always be the callee!
ASSERT(result == JSValue(callee));
......@@ -1656,7 +1656,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_proto_list)
// Since we're accessing a prototype in a loop, it's a good bet that it
// should not be treated as a dictionary.
if (slotBaseObject->structure()->isDictionary()) {
slotBaseObject->flattenDictionaryObject();
slotBaseObject->flattenDictionaryObject(callFrame->globalData());
offset = slotBaseObject->structure()->get(propertyName);
}
......@@ -2147,7 +2147,7 @@ DEFINE_STUB_FUNCTION(void, op_tear_off_activation)
activation->copyRegisters();
if (JSValue v = stackFrame.args[1].jsValue()) {
if (!stackFrame.callFrame->codeBlock()->isStrictMode())
asArguments(v)->setActivation(activation);
asArguments(v)->setActivation(*stackFrame.globalData, activation);
}
}
......@@ -2204,7 +2204,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve)
Identifier& ident = stackFrame.args[0].identifier();
do {
JSObject* o = *iter;
JSObject* o = iter->get();
PropertySlot slot(o);
if (o->getPropertySlot(callFrame, ident, slot)) {
JSValue result = slot.getValue(callFrame, ident);
......@@ -2397,7 +2397,7 @@ DEFINE_STUB_FUNCTION(void, op_put_by_val)
if (isJSArray(globalData, baseValue)) {
JSArray* jsArray = asArray(baseValue);
if (jsArray->canSetIndex(i))
jsArray->setIndex(i, value);
jsArray->setIndex(*globalData, i, value);
else
jsArray->JSArray::put(callFrame, i, value);
} else if (isJSByteArray(globalData, baseValue) && asByteArray(baseValue)->canAccessIndex(i)) {
......@@ -2645,7 +2645,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_skip)
}
Identifier& ident = stackFrame.args[0].identifier();
do {
JSObject* o = *iter;
JSObject* o = iter->get();
PropertySlot slot(o);
if (o->getPropertySlot(callFrame, ident, slot)) {
JSValue result = slot.getValue(callFrame, ident);
......@@ -2974,7 +2974,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_with_base)
Identifier& ident = stackFrame.args[0].identifier();
JSObject* base;
do {
base = *iter;
base = iter->get();
PropertySlot slot(base);
if (base->getPropertySlot(callFrame, ident, slot)) {
JSValue result = slot.getValue(callFrame, ident);
......@@ -3480,7 +3480,7 @@ DEFINE_STUB_FUNCTION(void*, vm_throw)
{
STUB_INIT_STACK_FRAME(stackFrame);
JSGlobalData* globalData = stackFrame.globalData;
ExceptionHandler handler = jitThrow(globalData, stackFrame.callFrame, globalData->exception, globalData->exceptionLocation);
ExceptionHandler handler = jitThrow(globalData, stackFrame.callFrame, globalData->exception.get(), globalData->exceptionLocation);
STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
return handler.callFrame;
}
......
......@@ -169,7 +169,7 @@ GlobalObject::GlobalObject(const Vector<UString>& arguments)
JSObject* array = constructEmptyArray(globalExec());
for (size_t i = 0; i < arguments.size(); ++i)
array->put(globalExec(), i, jsString(globalExec(), arguments[i]));
putDirect(Identifier(globalExec(), "arguments"), array);
putDirect(globalExec()->globalData(), Identifier(globalExec(), "arguments"), array);
}
EncodedJSValue JSC_HOST_CALL functionPrint(ExecState* exec)
......
......@@ -42,7 +42,7 @@ void MarkedArgumentBuffer::markLists(MarkStack& markStack, ListSet& markSet)
ListSet::iterator end = markSet.end();
for (ListSet::iterator it = markSet.begin(); it != end; ++it) {
MarkedArgumentBuffer* list = *it;
markStack.appendValues(reinterpret_cast<JSValue*>(list->m_buffer), list->m_size);
markStack.deprecatedAppendValues(list->m_buffer, list->m_size);
}
}
......
......@@ -48,17 +48,17 @@ void Arguments::markChildren(MarkStack& markStack)
JSObject::markChildren(markStack);
if (d->registerArray)
markStack.appendValues(reinterpret_cast<JSValue*>(d->registerArray.get()), d->numParameters);
markStack.deprecatedAppendValues(d->registerArray.get(), d->numParameters);
if (d->extraArguments) {
unsigned numExtraArguments = d->numArguments - d->numParameters;
markStack.appendValues(reinterpret_cast<JSValue*>(d->extraArguments), numExtraArguments);
markStack.deprecatedAppendValues(d->extraArguments, numExtraArguments);
}
markStack.append(d->callee);
markStack.append(&d->callee);
if (d->activation)
markStack.append(d->activation);
markStack.append(&d->activation);
}
void Arguments::copyToRegisters(ExecState* exec, Register* buffer, uint32_t maxSize)
......@@ -197,7 +197,7 @@ bool Arguments::getOwnPropertySlot(ExecState* exec, const Identifier& propertyNa
if (propertyName == exec->propertyNames().callee && LIKELY(!d->overrodeCallee)) {
if (!d->isStrictMode) {
slot.setValue(d->callee);
slot.setValue(d->callee.get());
return true;
}
createStrictModeCalleeIfNecessary(exec);
......@@ -228,7 +228,7 @@ bool Arguments::getOwnPropertyDescriptor(ExecState* exec, const Identifier& prop
if (propertyName == exec->propertyNames().callee && LIKELY(!d->overrodeCallee)) {
if (!d->isStrictMode) {
descriptor.setDescriptor(d->callee, DontEnum);
descriptor.setDescriptor(d->callee.get(), DontEnum);
return true;
}
createStrictModeCalleeIfNecessary(exec);
......@@ -280,14 +280,14 @@ void Arguments::put(ExecState* exec, const Identifier& propertyName, JSValue val
if (propertyName == exec->propertyNames().length && !d->overrodeLength) {
d->overrodeLength = true;
putDirect(propertyName, value, DontEnum);
putDirect(exec->globalData(), propertyName, value, DontEnum);
return;
}
if (propertyName == exec->propertyNames().callee && !d->overrodeCallee) {
if (!d->isStrictMode) {
d->overrodeCallee = true;
putDirect(propertyName, value, DontEnum);
putDirect(exec->globalData(), propertyName, value, DontEnum);
return;
}
createStrictModeCalleeIfNecessary(exec);
......
......@@ -37,7 +37,7 @@ namespace JSC {
WTF_MAKE_NONCOPYABLE(ArgumentsData); WTF_MAKE_FAST_ALLOCATED;
public:
ArgumentsData() { }
JSActivation* activation;
WriteBarrier<JSActivation> activation;
unsigned numParameters;
ptrdiff_t firstParameterIndex;
......@@ -50,7 +50,7 @@ namespace JSC {
OwnArrayPtr<bool> deletedArguments;
Register extraArgumentsFixedBuffer[4];
JSFunction* callee;
WriteBarrier<JSFunction> callee;
bool overrodeLength : 1;
bool overrodeCallee : 1;
bool overrodeCaller : 1;
......@@ -86,9 +86,9 @@ namespace JSC {
void copyToRegisters(ExecState* exec, Register* buffer, uint32_t maxSize);
void copyRegisters();
bool isTornOff() const { return d->registerArray; }
void setActivation(JSActivation* activation)
void setActivation(JSGlobalData& globalData, JSActivation* activation)
{
d->activation = activation;
d->activation.set(globalData, this, activation);
d->registers = &activation->registerAt(0);
}
......@@ -158,7 +158,6 @@ namespace JSC {
d->firstParameterIndex = firstParameterIndex;
d->numArguments = numArguments;
d->activation = 0;
d->registers = callFrame->registers();
Register* extraArguments;
......@@ -176,7 +175,7 @@ namespace JSC {
d->extraArguments = extraArguments;
d->callee = callee;
d->callee.set(callFrame->globalData(), this, callee);
d->overrodeLength = false;
d->overrodeCallee = false;
d->overrodeCaller = false;
......@@ -195,7 +194,6 @@ namespace JSC {
d->numParameters = 0;
d->numArguments = numArguments;
d->activation = 0;
Register* extraArguments;
if (numArguments > sizeof(d->extraArgumentsFixedBuffer) / sizeof(Register))
......@@ -209,7 +207,7 @@ namespace JSC {
d->extraArguments = extraArguments;
d->callee = asFunction(callFrame->callee());
d->callee.set(callFrame->globalData(), this, asFunction(callFrame->callee()));
d->overrodeLength = false;
d->overrodeCallee = false;
d->overrodeCaller = false;
......
......@@ -42,10 +42,10 @@ ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject
: InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, arrayPrototype->classInfo()->className))
{
// ECMA 15.4.3.1 Array.prototype
putDirectWithoutTransition(exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly);
putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly);
// no. of arguments for constructor
putDirectWithoutTransition(exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
// ES5
putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().isArray, arrayConstructorIsArray), DontEnum);
......@@ -62,7 +62,7 @@ static inline JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgLi
}
// otherwise the array is constructed with the arguments in it
return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), args);
return new (exec) JSArray(exec->globalData(), exec->lexicalGlobalObject()->arrayStructure(), args);
}
static EncodedJSValue JSC_HOST_CALL constructWithArrayConstructor(ExecState* exec)
......