diff options
Diffstat (limited to 'src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Register.h')
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Register.h | 63 |
1 files changed, 13 insertions, 50 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Register.h b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Register.h index 6d01eb7c51..ea1f849309 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Register.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Register.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -51,24 +51,9 @@ namespace JSC { public: Register(); Register(JSValue); - Register(Arguments*); JSValue jsValue() const; - - bool marked() const; - void mark(); - int32_t i() const; - void* v() const; - - private: - friend class ExecState; - friend class Interpreter; - - // Only CallFrame, Interpreter, and JITStubs should use these functions. - - Register(intptr_t); - Register(JSActivation*); Register(CallFrame*); Register(CodeBlock*); @@ -77,6 +62,7 @@ namespace JSC { Register(ScopeChainNode*); Register(Instruction*); + int32_t i() const; JSActivation* activation() const; Arguments* arguments() const; CallFrame* callFrame() const; @@ -86,13 +72,19 @@ namespace JSC { ScopeChainNode* scopeChain() const; Instruction* vPC() const; + static Register withInt(int32_t i) + { + return Register(i); + } + + private: + Register(int32_t); + union { - intptr_t i; - void* v; + int32_t i; EncodedJSValue value; JSActivation* activation; - Arguments* arguments; CallFrame* callFrame; CodeBlock* codeBlock; JSObject* object; @@ -118,24 +110,9 @@ namespace JSC { { return JSValue::decode(u.value); } - - ALWAYS_INLINE bool Register::marked() const - { - return jsValue().marked(); - } - ALWAYS_INLINE void Register::mark() - { - jsValue().mark(); - } - // Interpreter functions - ALWAYS_INLINE Register::Register(Arguments* arguments) - { - u.arguments = arguments; - } - ALWAYS_INLINE Register::Register(JSActivation* activation) { u.activation = activation; @@ -171,35 +148,21 @@ namespace JSC { u.propertyNameIterator = propertyNameIterator; } - ALWAYS_INLINE Register::Register(intptr_t i) + ALWAYS_INLINE Register::Register(int32_t i) { - // See comment on 'i()' below. - ASSERT(i == static_cast<int32_t>(i)); u.i = i; } - // Read 'i' as a 32-bit integer; we only use it to hold 32-bit values, - // and we only write 32-bits when writing the arg count from JIT code. ALWAYS_INLINE int32_t Register::i() const { - return static_cast<int32_t>(u.i); + return u.i; } - ALWAYS_INLINE void* Register::v() const - { - return u.v; - } - ALWAYS_INLINE JSActivation* Register::activation() const { return u.activation; } - ALWAYS_INLINE Arguments* Register::arguments() const - { - return u.arguments; - } - ALWAYS_INLINE CallFrame* Register::callFrame() const { return u.callFrame; |