summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/interpreter/Register.h
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-02 14:57:50 +0000
committerSteve Block <steveblock@google.com>2010-02-04 15:06:55 +0000
commitd0825bca7fe65beaee391d30da42e937db621564 (patch)
tree7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /JavaScriptCore/interpreter/Register.h
parent3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff)
downloadexternal_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip
external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz
external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'JavaScriptCore/interpreter/Register.h')
-rw-r--r--JavaScriptCore/interpreter/Register.h62
1 files changed, 37 insertions, 25 deletions
diff --git a/JavaScriptCore/interpreter/Register.h b/JavaScriptCore/interpreter/Register.h
index d0b0568..ecd7403 100644
--- a/JavaScriptCore/interpreter/Register.h
+++ b/JavaScriptCore/interpreter/Register.h
@@ -51,17 +51,18 @@ namespace JSC {
class Register : public WTF::FastAllocBase {
public:
Register();
- Register(JSValue);
+ Register(const JSValue&);
+ Register& operator=(const JSValue&);
JSValue jsValue() const;
- Register(JSActivation*);
- Register(CallFrame*);
- Register(CodeBlock*);
- Register(JSFunction*);
- Register(JSPropertyNameIterator*);
- Register(ScopeChainNode*);
- Register(Instruction*);
+ Register& operator=(JSActivation*);
+ Register& operator=(CallFrame*);
+ Register& operator=(CodeBlock*);
+ Register& operator=(JSFunction*);
+ Register& operator=(JSPropertyNameIterator*);
+ Register& operator=(ScopeChainNode*);
+ Register& operator=(Instruction*);
int32_t i() const;
JSActivation* activation() const;
@@ -75,12 +76,12 @@ namespace JSC {
static Register withInt(int32_t i)
{
- return Register(i);
+ Register r;
+ r.u.i = i;
+ return r;
}
private:
- Register(int32_t);
-
union {
int32_t i;
EncodedJSValue value;
@@ -98,11 +99,11 @@ namespace JSC {
ALWAYS_INLINE Register::Register()
{
#ifndef NDEBUG
- u.value = JSValue::encode(JSValue());
+ *this = JSValue();
#endif
}
- ALWAYS_INLINE Register::Register(JSValue v)
+ ALWAYS_INLINE Register::Register(const JSValue& v)
{
#if ENABLE(JSC_ZOMBIES)
ASSERT(!v.isZombie());
@@ -110,6 +111,15 @@ namespace JSC {
u.value = JSValue::encode(v);
}
+ ALWAYS_INLINE Register& Register::operator=(const JSValue& v)
+ {
+#if ENABLE(JSC_ZOMBIES)
+ ASSERT(!v.isZombie());
+#endif
+ u.value = JSValue::encode(v);
+ return *this;
+ }
+
ALWAYS_INLINE JSValue Register::jsValue() const
{
return JSValue::decode(u.value);
@@ -117,44 +127,46 @@ namespace JSC {
// Interpreter functions
- ALWAYS_INLINE Register::Register(JSActivation* activation)
+ ALWAYS_INLINE Register& Register::operator=(JSActivation* activation)
{
u.activation = activation;
+ return *this;
}
- ALWAYS_INLINE Register::Register(CallFrame* callFrame)
+ ALWAYS_INLINE Register& Register::operator=(CallFrame* callFrame)
{
u.callFrame = callFrame;
+ return *this;
}
- ALWAYS_INLINE Register::Register(CodeBlock* codeBlock)
+ ALWAYS_INLINE Register& Register::operator=(CodeBlock* codeBlock)
{
u.codeBlock = codeBlock;
+ return *this;
}
- ALWAYS_INLINE Register::Register(JSFunction* function)
+ ALWAYS_INLINE Register& Register::operator=(JSFunction* function)
{
u.function = function;
+ return *this;
}
- ALWAYS_INLINE Register::Register(Instruction* vPC)
+ ALWAYS_INLINE Register& Register::operator=(Instruction* vPC)
{
u.vPC = vPC;
+ return *this;
}
- ALWAYS_INLINE Register::Register(ScopeChainNode* scopeChain)
+ ALWAYS_INLINE Register& Register::operator=(ScopeChainNode* scopeChain)
{
u.scopeChain = scopeChain;
+ return *this;
}
- ALWAYS_INLINE Register::Register(JSPropertyNameIterator* propertyNameIterator)
+ ALWAYS_INLINE Register& Register::operator=(JSPropertyNameIterator* propertyNameIterator)
{
u.propertyNameIterator = propertyNameIterator;
- }
-
- ALWAYS_INLINE Register::Register(int32_t i)
- {
- u.i = i;
+ return *this;
}
ALWAYS_INLINE int32_t Register::i() const