Index: src/ic.h |
=================================================================== |
--- src/ic.h (revision 7267) |
+++ src/ic.h (working copy) |
@@ -86,7 +86,7 @@ |
// Construct the IC structure with the given number of extra |
// JavaScript frames on the stack. |
- explicit IC(FrameDepth depth); |
+ IC(FrameDepth depth, Isolate* isolate); |
// Get the call-site target; used for determining the state. |
Code* target() { return GetTargetAtAddress(address()); } |
@@ -130,6 +130,7 @@ |
protected: |
Address fp() const { return fp_; } |
Address pc() const { return *pc_address_; } |
+ Isolate* isolate() const { return isolate_; } |
#ifdef ENABLE_DEBUGGER_SUPPORT |
// Computes the address in the original code when the code running is |
@@ -148,10 +149,10 @@ |
const char* extra_info = ""); |
#endif |
- static Failure* TypeError(const char* type, |
- Handle<Object> object, |
- Handle<Object> key); |
- static Failure* ReferenceError(const char* type, Handle<String> name); |
+ Failure* TypeError(const char* type, |
+ Handle<Object> object, |
+ Handle<Object> key); |
+ Failure* ReferenceError(const char* type, Handle<String> name); |
// Access the target code for the given IC address. |
static inline Code* GetTargetAtAddress(Address address); |
@@ -167,6 +168,8 @@ |
// invoke the garbage collector. |
Address* pc_address_; |
+ Isolate* isolate_; |
+ |
DISALLOW_IMPLICIT_CONSTRUCTORS(IC); |
}; |
@@ -189,7 +192,8 @@ |
class CallICBase: public IC { |
protected: |
- explicit CallICBase(Code::Kind kind) : IC(EXTRA_CALL_FRAME), kind_(kind) {} |
+ CallICBase(Code::Kind kind, Isolate* isolate) |
+ : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {} |
public: |
MUST_USE_RESULT MaybeObject* LoadFunction(State state, |
@@ -233,7 +237,9 @@ |
class CallIC: public CallICBase { |
public: |
- CallIC() : CallICBase(Code::CALL_IC) { ASSERT(target()->is_call_stub()); } |
+ explicit CallIC(Isolate* isolate) : CallICBase(Code::CALL_IC, isolate) { |
+ ASSERT(target()->is_call_stub()); |
+ } |
// Code generator routines. |
static void GenerateInitialize(MacroAssembler* masm, int argc) { |
@@ -247,7 +253,8 @@ |
class KeyedCallIC: public CallICBase { |
public: |
- KeyedCallIC() : CallICBase(Code::KEYED_CALL_IC) { |
+ explicit KeyedCallIC(Isolate* isolate) |
+ : CallICBase(Code::KEYED_CALL_IC, isolate) { |
ASSERT(target()->is_keyed_call_stub()); |
} |
@@ -267,7 +274,9 @@ |
class LoadIC: public IC { |
public: |
- LoadIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_load_stub()); } |
+ explicit LoadIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { |
+ ASSERT(target()->is_load_stub()); |
+ } |
MUST_USE_RESULT MaybeObject* Load(State state, |
Handle<Object> object, |
@@ -305,14 +314,17 @@ |
Handle<String> name); |
// Stub accessors. |
- static Code* megamorphic_stub() { |
- return Builtins::builtin(Builtins::LoadIC_Megamorphic); |
+ Code* megamorphic_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::LoadIC_Megamorphic); |
} |
static Code* initialize_stub() { |
- return Builtins::builtin(Builtins::LoadIC_Initialize); |
+ return Isolate::Current()->builtins()->builtin( |
+ Builtins::LoadIC_Initialize); |
} |
- static Code* pre_monomorphic_stub() { |
- return Builtins::builtin(Builtins::LoadIC_PreMonomorphic); |
+ Code* pre_monomorphic_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::LoadIC_PreMonomorphic); |
} |
static void Clear(Address address, Code* target); |
@@ -330,7 +342,9 @@ |
class KeyedLoadIC: public IC { |
public: |
- KeyedLoadIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_keyed_load_stub()); } |
+ explicit KeyedLoadIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { |
+ ASSERT(target()->is_keyed_load_stub()); |
+ } |
MUST_USE_RESULT MaybeObject* Load(State state, |
Handle<Object> object, |
@@ -367,23 +381,29 @@ |
// Stub accessors. |
static Code* initialize_stub() { |
- return Builtins::builtin(Builtins::KeyedLoadIC_Initialize); |
+ return Isolate::Current()->builtins()->builtin( |
+ Builtins::KeyedLoadIC_Initialize); |
} |
- static Code* megamorphic_stub() { |
- return Builtins::builtin(Builtins::KeyedLoadIC_Generic); |
+ Code* megamorphic_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::KeyedLoadIC_Generic); |
} |
- static Code* generic_stub() { |
- return Builtins::builtin(Builtins::KeyedLoadIC_Generic); |
+ Code* generic_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::KeyedLoadIC_Generic); |
} |
- static Code* pre_monomorphic_stub() { |
- return Builtins::builtin(Builtins::KeyedLoadIC_PreMonomorphic); |
+ Code* pre_monomorphic_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::KeyedLoadIC_PreMonomorphic); |
} |
- static Code* string_stub() { |
- return Builtins::builtin(Builtins::KeyedLoadIC_String); |
+ Code* string_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::KeyedLoadIC_String); |
} |
- static Code* indexed_interceptor_stub() { |
- return Builtins::builtin(Builtins::KeyedLoadIC_IndexedInterceptor); |
+ Code* indexed_interceptor_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::KeyedLoadIC_IndexedInterceptor); |
} |
static void Clear(Address address, Code* target); |
@@ -398,7 +418,9 @@ |
class StoreIC: public IC { |
public: |
- StoreIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_store_stub()); } |
+ explicit StoreIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { |
+ ASSERT(target()->is_store_stub()); |
+ } |
MUST_USE_RESULT MaybeObject* Store(State state, |
StrictModeFlag strict_mode, |
@@ -441,23 +463,29 @@ |
} |
// Stub accessors. |
- static Code* megamorphic_stub() { |
- return Builtins::builtin(Builtins::StoreIC_Megamorphic); |
+ Code* megamorphic_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::StoreIC_Megamorphic); |
} |
- static Code* megamorphic_stub_strict() { |
- return Builtins::builtin(Builtins::StoreIC_Megamorphic_Strict); |
+ Code* megamorphic_stub_strict() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::StoreIC_Megamorphic_Strict); |
} |
static Code* initialize_stub() { |
- return Builtins::builtin(Builtins::StoreIC_Initialize); |
+ return Isolate::Current()->builtins()->builtin( |
+ Builtins::StoreIC_Initialize); |
} |
static Code* initialize_stub_strict() { |
- return Builtins::builtin(Builtins::StoreIC_Initialize_Strict); |
+ return Isolate::Current()->builtins()->builtin( |
+ Builtins::StoreIC_Initialize_Strict); |
} |
- static Code* global_proxy_stub() { |
- return Builtins::builtin(Builtins::StoreIC_GlobalProxy); |
+ Code* global_proxy_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::StoreIC_GlobalProxy); |
} |
- static Code* global_proxy_stub_strict() { |
- return Builtins::builtin(Builtins::StoreIC_GlobalProxy_Strict); |
+ Code* global_proxy_stub_strict() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::StoreIC_GlobalProxy_Strict); |
} |
static void Clear(Address address, Code* target); |
@@ -472,7 +500,7 @@ |
class KeyedStoreIC: public IC { |
public: |
- KeyedStoreIC() : IC(NO_EXTRA_FRAME) { } |
+ explicit KeyedStoreIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
MUST_USE_RESULT MaybeObject* Store(State state, |
StrictModeFlag strict_mode, |
@@ -511,23 +539,29 @@ |
// Stub accessors. |
static Code* initialize_stub() { |
- return Builtins::builtin(Builtins::KeyedStoreIC_Initialize); |
+ return Isolate::Current()->builtins()->builtin( |
+ Builtins::KeyedStoreIC_Initialize); |
} |
+ Code* megamorphic_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::KeyedStoreIC_Generic); |
+ } |
static Code* initialize_stub_strict() { |
- return Builtins::builtin(Builtins::KeyedStoreIC_Initialize_Strict); |
+ return Isolate::Current()->builtins()->builtin( |
+ Builtins::KeyedStoreIC_Initialize_Strict); |
} |
- static Code* megamorphic_stub() { |
- return Builtins::builtin(Builtins::KeyedStoreIC_Generic); |
+ Code* megamorphic_stub_strict() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::KeyedStoreIC_Generic_Strict); |
} |
- static Code* megamorphic_stub_strict() { |
- return Builtins::builtin(Builtins::KeyedStoreIC_Generic_Strict); |
+ Code* generic_stub() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::KeyedStoreIC_Generic); |
} |
- static Code* generic_stub() { |
- return Builtins::builtin(Builtins::KeyedStoreIC_Generic); |
+ Code* generic_stub_strict() { |
+ return isolate()->builtins()->builtin( |
+ Builtins::KeyedStoreIC_Generic_Strict); |
} |
- static Code* generic_stub_strict() { |
- return Builtins::builtin(Builtins::KeyedStoreIC_Generic_Strict); |
- } |
static void Clear(Address address, Code* target); |
@@ -555,7 +589,7 @@ |
GENERIC // Non-specialized case (processes any type combination). |
}; |
- BinaryOpIC() : IC(NO_EXTRA_FRAME) { } |
+ explicit BinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
void patch(Code* code); |
@@ -580,7 +614,7 @@ |
GENERIC |
}; |
- TRBinaryOpIC() : IC(NO_EXTRA_FRAME) { } |
+ explicit TRBinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
void patch(Code* code); |
@@ -604,7 +638,8 @@ |
GENERIC |
}; |
- explicit CompareIC(Token::Value op) : IC(EXTRA_CALL_FRAME), op_(op) { } |
+ CompareIC(Isolate* isolate, Token::Value op) |
+ : IC(EXTRA_CALL_FRAME, isolate), op_(op) { } |
// Update the inline cache for the given operands. |
void UpdateCaches(Handle<Object> x, Handle<Object> y); |