Index: src/ic.h |
diff --git a/src/ic.h b/src/ic.h |
index ec9fe8b09d3720cb9c76e297aeb12e4450ad1485..7a9d7fbb5390929f7fa42388ad866ce1077fe44d 100644 |
--- a/src/ic.h |
+++ b/src/ic.h |
@@ -101,7 +101,9 @@ class IC { |
} |
// Clear the inline cache to initial state. |
- static void Clear(Isolate* isolate, Address address); |
+ static void Clear(Isolate* isolate, |
+ Address address, |
+ ConstantPoolArray* constant_pool); |
#ifdef DEBUG |
bool IsLoadStub() const { |
@@ -155,14 +157,17 @@ class IC { |
Isolate* isolate() const { return isolate_; } |
#ifdef ENABLE_DEBUGGER_SUPPORT |
- // Computes the address in the original code when the code running is |
- // containing break points (calls to DebugBreakXXX builtins). |
- Address OriginalCodeAddress() const; |
+ // Get the shared function info of the caller. |
+ SharedFunctionInfo* GetSharedFunctionInfo() const; |
+ // Get the code object of the caller. |
+ Code* GetCode() const; |
+ // Get the original (non-breakpointed) code object of the caller. |
+ Code* GetOriginalCode() const; |
#endif |
// Set the call-site target. |
void set_target(Code* code) { |
- SetTargetAtAddress(address(), code); |
+ SetTargetAtAddress(address(), code, constant_pool()); |
target_set_ = true; |
} |
@@ -180,8 +185,11 @@ class IC { |
Failure* ReferenceError(const char* type, Handle<String> name); |
// Access the target code for the given IC address. |
- static inline Code* GetTargetAtAddress(Address address); |
- static inline void SetTargetAtAddress(Address address, Code* target); |
+ static inline Code* GetTargetAtAddress(Address address, |
+ ConstantPoolArray* constant_pool); |
+ static inline void SetTargetAtAddress(Address address, |
+ Code* target, |
+ ConstantPoolArray* constant_pool); |
static void PostPatching(Address address, Code* target, Code* old_target); |
// Compute the handler either by compiling or by retrieving a cached version. |
@@ -240,7 +248,11 @@ class IC { |
} |
private: |
- Code* raw_target() const { return GetTargetAtAddress(address()); } |
+ Code* raw_target() const { |
+ return GetTargetAtAddress(address(), constant_pool()); |
+ } |
+ inline ConstantPoolArray* constant_pool() const; |
+ inline ConstantPoolArray* raw_constant_pool() const; |
// Frame pointer for the frame that uses (calls) the IC. |
Address fp_; |
@@ -253,6 +265,10 @@ class IC { |
Isolate* isolate_; |
+ // The constant pool of the code which originally called the IC (which might |
+ // be for the breakpointed copy of the original code). |
+ Handle<ConstantPoolArray> raw_constant_pool_; |
+ |
// The original code target that missed. |
Handle<Code> target_; |
State state_; |
@@ -373,7 +389,10 @@ class LoadIC: public IC { |
Representation representation = |
Representation::Tagged()); |
- static void Clear(Isolate* isolate, Address address, Code* target); |
+ static void Clear(Isolate* isolate, |
+ Address address, |
+ Code* target, |
+ ConstantPoolArray* constant_pool); |
friend class IC; |
}; |
@@ -443,7 +462,10 @@ class KeyedLoadIC: public LoadIC { |
return isolate()->builtins()->KeyedLoadIC_String(); |
} |
- static void Clear(Isolate* isolate, Address address, Code* target); |
+ static void Clear(Isolate* isolate, |
+ Address address, |
+ Code* target, |
+ ConstantPoolArray* constant_pool); |
friend class IC; |
}; |
@@ -533,7 +555,10 @@ class StoreIC: public IC { |
IC::set_target(code); |
} |
- static void Clear(Isolate* isolate, Address address, Code* target); |
+ static void Clear(Isolate* isolate, |
+ Address address, |
+ Code* target, |
+ ConstantPoolArray* constant_pool); |
friend class IC; |
}; |
@@ -640,7 +665,10 @@ class KeyedStoreIC: public StoreIC { |
return isolate()->builtins()->KeyedStoreIC_SloppyArguments(); |
} |
- static void Clear(Isolate* isolate, Address address, Code* target); |
+ static void Clear(Isolate* isolate, |
+ Address address, |
+ Code* target, |
+ ConstantPoolArray* constant_pool); |
KeyedAccessStoreMode GetStoreMode(Handle<JSObject> receiver, |
Handle<Object> key, |
@@ -847,7 +875,10 @@ class CompareIC: public IC { |
static Code* GetRawUninitialized(Isolate* isolate, Token::Value op); |
- static void Clear(Isolate* isolate, Address address, Code* target); |
+ static void Clear(Isolate* isolate, |
+ Address address, |
+ Code* target, |
+ ConstantPoolArray* constant_pool); |
Token::Value op_; |
@@ -863,7 +894,9 @@ class CompareNilIC: public IC { |
static Handle<Code> GetUninitialized(); |
- static void Clear(Address address, Code* target); |
+ static void Clear(Address address, |
+ Code* target, |
+ ConstantPoolArray* constant_pool); |
static MUST_USE_RESULT MaybeObject* DoCompareNilSlow(NilValue nil, |
Handle<Object> object); |