summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/interpreter/Register.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/interpreter/Register.h')
-rw-r--r--Source/JavaScriptCore/interpreter/Register.h66
1 files changed, 10 insertions, 56 deletions
diff --git a/Source/JavaScriptCore/interpreter/Register.h b/Source/JavaScriptCore/interpreter/Register.h
index 3944642..fb02c12 100644
--- a/Source/JavaScriptCore/interpreter/Register.h
+++ b/Source/JavaScriptCore/interpreter/Register.h
@@ -54,11 +54,10 @@ namespace JSC {
Register(const JSValue&);
Register& operator=(const JSValue&);
JSValue jsValue() const;
+ EncodedJSValue encodedJSValue() const;
- Register& operator=(JSActivation*);
Register& operator=(CallFrame*);
Register& operator=(CodeBlock*);
- Register& operator=(JSPropertyNameIterator*);
Register& operator=(ScopeChainNode*);
Register& operator=(Instruction*);
@@ -73,29 +72,17 @@ namespace JSC {
static Register withInt(int32_t i)
{
- Register r;
- r.u.i = i;
+ Register r = jsNumber(i);
return r;
}
- static Register withCallee(JSObject* callee)
- {
- Register r;
- r.u.function = callee;
- return r;
- }
+ static inline Register withCallee(JSObject* callee);
private:
union {
- int32_t i;
EncodedJSValue value;
-
- JSActivation* activation;
CallFrame* callFrame;
CodeBlock* codeBlock;
- JSObject* function;
- JSPropertyNameIterator* propertyNameIterator;
- ScopeChainNode* scopeChain;
Instruction* vPC;
} u;
};
@@ -129,14 +116,13 @@ namespace JSC {
return JSValue::decode(u.value);
}
- // Interpreter functions
-
- ALWAYS_INLINE Register& Register::operator=(JSActivation* activation)
+ ALWAYS_INLINE EncodedJSValue Register::encodedJSValue() const
{
- u.activation = activation;
- return *this;
+ return u.value;
}
+ // Interpreter functions
+
ALWAYS_INLINE Register& Register::operator=(CallFrame* callFrame)
{
u.callFrame = callFrame;
@@ -155,28 +141,11 @@ namespace JSC {
return *this;
}
- ALWAYS_INLINE Register& Register::operator=(ScopeChainNode* scopeChain)
- {
- u.scopeChain = scopeChain;
- return *this;
- }
-
- ALWAYS_INLINE Register& Register::operator=(JSPropertyNameIterator* propertyNameIterator)
- {
- u.propertyNameIterator = propertyNameIterator;
- return *this;
- }
-
ALWAYS_INLINE int32_t Register::i() const
{
- return u.i;
+ return jsValue().asInt32();
}
-
- ALWAYS_INLINE JSActivation* Register::activation() const
- {
- return u.activation;
- }
-
+
ALWAYS_INLINE CallFrame* Register::callFrame() const
{
return u.callFrame;
@@ -186,22 +155,7 @@ namespace JSC {
{
return u.codeBlock;
}
-
- ALWAYS_INLINE JSObject* Register::function() const
- {
- return u.function;
- }
-
- ALWAYS_INLINE JSPropertyNameIterator* Register::propertyNameIterator() const
- {
- return u.propertyNameIterator;
- }
-
- ALWAYS_INLINE ScopeChainNode* Register::scopeChain() const
- {
- return u.scopeChain;
- }
-
+
ALWAYS_INLINE Instruction* Register::vPC() const
{
return u.vPC;