OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_IC_H_ | 5 #ifndef V8_IC_H_ |
6 #define V8_IC_H_ | 6 #define V8_IC_H_ |
7 | 7 |
8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
10 | 10 |
(...skipping 115 matching lines...) Loading... |
126 // well as smis. | 126 // well as smis. |
127 // - The oddball map is only used for booleans. | 127 // - The oddball map is only used for booleans. |
128 static Handle<Map> TypeToMap(HeapType* type, Isolate* isolate); | 128 static Handle<Map> TypeToMap(HeapType* type, Isolate* isolate); |
129 template <class T> | 129 template <class T> |
130 static typename T::TypeHandle MapToType(Handle<Map> map, | 130 static typename T::TypeHandle MapToType(Handle<Map> map, |
131 typename T::Region* region); | 131 typename T::Region* region); |
132 | 132 |
133 static Handle<HeapType> CurrentTypeOf(Handle<Object> object, | 133 static Handle<HeapType> CurrentTypeOf(Handle<Object> object, |
134 Isolate* isolate); | 134 Isolate* isolate); |
135 | 135 |
| 136 static bool ICUseVector(Code::Kind kind) { |
| 137 return (FLAG_vector_ics && |
| 138 (kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC)) || |
| 139 kind == Code::CALL_IC; |
| 140 } |
| 141 |
136 protected: | 142 protected: |
137 // Get the call-site target; used for determining the state. | 143 // Get the call-site target; used for determining the state. |
138 Handle<Code> target() const { return target_; } | 144 Handle<Code> target() const { return target_; } |
139 | 145 |
140 Address fp() const { return fp_; } | 146 Address fp() const { return fp_; } |
141 Address pc() const { return *pc_address_; } | 147 Address pc() const { return *pc_address_; } |
142 Isolate* isolate() const { return isolate_; } | 148 Isolate* isolate() const { return isolate_; } |
143 | 149 |
144 // Get the shared function info of the caller. | 150 // Get the shared function info of the caller. |
145 SharedFunctionInfo* GetSharedFunctionInfo() const; | 151 SharedFunctionInfo* GetSharedFunctionInfo() const; |
146 // Get the code object of the caller. | 152 // Get the code object of the caller. |
147 Code* GetCode() const; | 153 Code* GetCode() const; |
148 // Get the original (non-breakpointed) code object of the caller. | 154 // Get the original (non-breakpointed) code object of the caller. |
149 Code* GetOriginalCode() const; | 155 Code* GetOriginalCode() const; |
150 | 156 |
151 // Set the call-site target. | 157 // Set the call-site target. |
152 inline void set_target(Code* code); | 158 inline void set_target(Code* code); |
153 bool is_target_set() { return target_set_; } | 159 bool is_target_set() { return target_set_; } |
154 | 160 |
155 static bool ICUseVector(Code::Kind kind) { | |
156 return (FLAG_vector_ics && | |
157 (kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC)) || | |
158 kind == Code::CALL_IC; | |
159 } | |
160 | |
161 bool UseVector() const { | 161 bool UseVector() const { |
162 bool use = ICUseVector(kind()); | 162 bool use = ICUseVector(kind()); |
163 // If we are supposed to use the nexus, verify the nexus is non-null. | 163 // If we are supposed to use the nexus, verify the nexus is non-null. |
164 DCHECK(!use || nexus_ != NULL); | 164 DCHECK(!use || nexus_ != NULL); |
165 return use; | 165 return use; |
166 } | 166 } |
167 | 167 |
168 // Configure for most states. | 168 // Configure for most states. |
169 void ConfigureVectorState(IC::State new_state); | 169 void ConfigureVectorState(IC::State new_state); |
170 // Configure the vector for MONOMORPHIC. | 170 // Configure the vector for MONOMORPHIC. |
(...skipping 590 matching lines...) Loading... |
761 | 761 |
762 // Support functions for interceptor handlers. | 762 // Support functions for interceptor handlers. |
763 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); | 763 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); |
764 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); | 764 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); |
765 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); | 765 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); |
766 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); | 766 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); |
767 } | 767 } |
768 } // namespace v8::internal | 768 } // namespace v8::internal |
769 | 769 |
770 #endif // V8_IC_H_ | 770 #endif // V8_IC_H_ |
OLD | NEW |