Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 1 | // Copyright 2006-2009 the V8 project authors. All rights reserved. |
| 2 | // Redistribution and use in source and binary forms, with or without |
| 3 | // modification, are permitted provided that the following conditions are |
| 4 | // met: |
| 5 | // |
| 6 | // * Redistributions of source code must retain the above copyright |
| 7 | // notice, this list of conditions and the following disclaimer. |
| 8 | // * Redistributions in binary form must reproduce the above |
| 9 | // copyright notice, this list of conditions and the following |
| 10 | // disclaimer in the documentation and/or other materials provided |
| 11 | // with the distribution. |
| 12 | // * Neither the name of Google Inc. nor the names of its |
| 13 | // contributors may be used to endorse or promote products derived |
| 14 | // from this software without specific prior written permission. |
| 15 | // |
| 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | |
| 28 | #ifndef V8_IC_H_ |
| 29 | #define V8_IC_H_ |
| 30 | |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 31 | #include "macro-assembler.h" |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 32 | |
| 33 | namespace v8 { |
| 34 | namespace internal { |
| 35 | |
Leon Clarke | e46be81 | 2010-01-19 14:06:41 +0000 | [diff] [blame] | 36 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 37 | // IC_UTIL_LIST defines all utility functions called from generated |
| 38 | // inline caching code. The argument for the macro, ICU, is the function name. |
| 39 | #define IC_UTIL_LIST(ICU) \ |
| 40 | ICU(LoadIC_Miss) \ |
| 41 | ICU(KeyedLoadIC_Miss) \ |
| 42 | ICU(CallIC_Miss) \ |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 43 | ICU(KeyedCallIC_Miss) \ |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 44 | ICU(StoreIC_Miss) \ |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 45 | ICU(StoreIC_ArrayLength) \ |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 46 | ICU(SharedStoreIC_ExtendStorage) \ |
| 47 | ICU(KeyedStoreIC_Miss) \ |
| 48 | /* Utilities for IC stubs. */ \ |
| 49 | ICU(LoadCallbackProperty) \ |
| 50 | ICU(StoreCallbackProperty) \ |
| 51 | ICU(LoadPropertyWithInterceptorOnly) \ |
| 52 | ICU(LoadPropertyWithInterceptorForLoad) \ |
| 53 | ICU(LoadPropertyWithInterceptorForCall) \ |
Andrei Popescu | 402d937 | 2010-02-26 13:31:12 +0000 | [diff] [blame] | 54 | ICU(KeyedLoadPropertyWithInterceptor) \ |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 55 | ICU(StoreInterceptorProperty) \ |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 56 | ICU(BinaryOp_Patch) \ |
| 57 | ICU(TypeRecordingBinaryOp_Patch) \ |
| 58 | ICU(CompareIC_Miss) |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 59 | // |
| 60 | // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC, |
| 61 | // and KeyedStoreIC. |
| 62 | // |
| 63 | class IC { |
| 64 | public: |
| 65 | |
| 66 | // The ids for utility called from the generated code. |
| 67 | enum UtilityId { |
| 68 | #define CONST_NAME(name) k##name, |
| 69 | IC_UTIL_LIST(CONST_NAME) |
| 70 | #undef CONST_NAME |
| 71 | kUtilityCount |
| 72 | }; |
| 73 | |
| 74 | // Looks up the address of the named utility. |
| 75 | static Address AddressFromUtilityId(UtilityId id); |
| 76 | |
| 77 | // Alias the inline cache state type to make the IC code more readable. |
| 78 | typedef InlineCacheState State; |
| 79 | |
| 80 | // The IC code is either invoked with no extra frames on the stack |
| 81 | // or with a single extra frame for supporting calls. |
| 82 | enum FrameDepth { |
| 83 | NO_EXTRA_FRAME = 0, |
| 84 | EXTRA_CALL_FRAME = 1 |
| 85 | }; |
| 86 | |
| 87 | // Construct the IC structure with the given number of extra |
| 88 | // JavaScript frames on the stack. |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 89 | IC(FrameDepth depth, Isolate* isolate); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 90 | |
| 91 | // Get the call-site target; used for determining the state. |
| 92 | Code* target() { return GetTargetAtAddress(address()); } |
| 93 | inline Address address(); |
| 94 | |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 95 | // Compute the current IC state based on the target stub, receiver and name. |
| 96 | static State StateFrom(Code* target, Object* receiver, Object* name); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 97 | |
| 98 | // Clear the inline cache to initial state. |
| 99 | static void Clear(Address address); |
| 100 | |
| 101 | // Computes the reloc info for this IC. This is a fairly expensive |
| 102 | // operation as it has to search through the heap to find the code |
| 103 | // object that contains this IC site. |
| 104 | RelocInfo::Mode ComputeMode(); |
| 105 | |
| 106 | // Returns if this IC is for contextual (no explicit receiver) |
| 107 | // access to properties. |
Leon Clarke | e46be81 | 2010-01-19 14:06:41 +0000 | [diff] [blame] | 108 | bool IsContextual(Handle<Object> receiver) { |
| 109 | if (receiver->IsGlobalObject()) { |
| 110 | return SlowIsContextual(); |
| 111 | } else { |
| 112 | ASSERT(!SlowIsContextual()); |
| 113 | return false; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | bool SlowIsContextual() { |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 118 | return ComputeMode() == RelocInfo::CODE_TARGET_CONTEXT; |
| 119 | } |
| 120 | |
Steve Block | 8defd9f | 2010-07-08 12:39:36 +0100 | [diff] [blame] | 121 | // Determines which map must be used for keeping the code stub. |
| 122 | // These methods should not be called with undefined or null. |
| 123 | static inline InlineCacheHolderFlag GetCodeCacheForObject(Object* object, |
| 124 | JSObject* holder); |
| 125 | static inline InlineCacheHolderFlag GetCodeCacheForObject(JSObject* object, |
| 126 | JSObject* holder); |
Kristian Monsen | 80d68ea | 2010-09-08 11:05:35 +0100 | [diff] [blame] | 127 | static inline JSObject* GetCodeCacheHolder(Object* object, |
| 128 | InlineCacheHolderFlag holder); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 129 | |
| 130 | protected: |
| 131 | Address fp() const { return fp_; } |
| 132 | Address pc() const { return *pc_address_; } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 133 | Isolate* isolate() const { return isolate_; } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 134 | |
| 135 | #ifdef ENABLE_DEBUGGER_SUPPORT |
| 136 | // Computes the address in the original code when the code running is |
| 137 | // containing break points (calls to DebugBreakXXX builtins). |
| 138 | Address OriginalCodeAddress(); |
| 139 | #endif |
| 140 | |
| 141 | // Set the call-site target. |
| 142 | void set_target(Code* code) { SetTargetAtAddress(address(), code); } |
| 143 | |
| 144 | #ifdef DEBUG |
| 145 | static void TraceIC(const char* type, |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 146 | Handle<Object> name, |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 147 | State old_state, |
| 148 | Code* new_target, |
| 149 | const char* extra_info = ""); |
| 150 | #endif |
| 151 | |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 152 | Failure* TypeError(const char* type, |
| 153 | Handle<Object> object, |
| 154 | Handle<Object> key); |
| 155 | Failure* ReferenceError(const char* type, Handle<String> name); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 156 | |
| 157 | // Access the target code for the given IC address. |
| 158 | static inline Code* GetTargetAtAddress(Address address); |
| 159 | static inline void SetTargetAtAddress(Address address, Code* target); |
| 160 | |
| 161 | private: |
| 162 | // Frame pointer for the frame that uses (calls) the IC. |
| 163 | Address fp_; |
| 164 | |
| 165 | // All access to the program counter of an IC structure is indirect |
| 166 | // to make the code GC safe. This feature is crucial since |
| 167 | // GetProperty and SetProperty are called and they in turn might |
| 168 | // invoke the garbage collector. |
| 169 | Address* pc_address_; |
| 170 | |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 171 | Isolate* isolate_; |
| 172 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 173 | DISALLOW_IMPLICIT_CONSTRUCTORS(IC); |
| 174 | }; |
| 175 | |
| 176 | |
| 177 | // An IC_Utility encapsulates IC::UtilityId. It exists mainly because you |
| 178 | // cannot make forward declarations to an enum. |
| 179 | class IC_Utility { |
| 180 | public: |
| 181 | explicit IC_Utility(IC::UtilityId id) |
| 182 | : address_(IC::AddressFromUtilityId(id)), id_(id) {} |
| 183 | |
| 184 | Address address() const { return address_; } |
| 185 | |
| 186 | IC::UtilityId id() const { return id_; } |
| 187 | private: |
| 188 | Address address_; |
| 189 | IC::UtilityId id_; |
| 190 | }; |
| 191 | |
| 192 | |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 193 | class CallICBase: public IC { |
| 194 | protected: |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 195 | CallICBase(Code::Kind kind, Isolate* isolate) |
| 196 | : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {} |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 197 | |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 198 | public: |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 199 | MUST_USE_RESULT MaybeObject* LoadFunction(State state, |
Ben Murdoch | b8e0da2 | 2011-05-16 14:20:40 +0100 | [diff] [blame] | 200 | Code::ExtraICState extra_ic_state, |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 201 | Handle<Object> object, |
| 202 | Handle<String> name); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 203 | |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 204 | protected: |
| 205 | Code::Kind kind_; |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 206 | |
Ben Murdoch | b8e0da2 | 2011-05-16 14:20:40 +0100 | [diff] [blame] | 207 | bool TryUpdateExtraICState(LookupResult* lookup, |
| 208 | Handle<Object> object, |
| 209 | Code::ExtraICState* extra_ic_state); |
| 210 | |
| 211 | MUST_USE_RESULT MaybeObject* ComputeMonomorphicStub( |
| 212 | LookupResult* lookup, |
| 213 | State state, |
| 214 | Code::ExtraICState extra_ic_state, |
| 215 | Handle<Object> object, |
| 216 | Handle<String> name); |
| 217 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 218 | // Update the inline cache and the global stub cache based on the |
| 219 | // lookup result. |
| 220 | void UpdateCaches(LookupResult* lookup, |
| 221 | State state, |
Ben Murdoch | b8e0da2 | 2011-05-16 14:20:40 +0100 | [diff] [blame] | 222 | Code::ExtraICState extra_ic_state, |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 223 | Handle<Object> object, |
| 224 | Handle<String> name); |
| 225 | |
| 226 | // Returns a JSFunction if the object can be called as a function, |
| 227 | // and patches the stack to be ready for the call. |
| 228 | // Otherwise, it returns the undefined value. |
| 229 | Object* TryCallAsFunction(Object* object); |
| 230 | |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 231 | void ReceiverToObjectIfRequired(Handle<Object> callee, Handle<Object> object); |
Leon Clarke | e46be81 | 2010-01-19 14:06:41 +0000 | [diff] [blame] | 232 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 233 | static void Clear(Address address, Code* target); |
| 234 | friend class IC; |
| 235 | }; |
| 236 | |
| 237 | |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 238 | class CallIC: public CallICBase { |
| 239 | public: |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 240 | explicit CallIC(Isolate* isolate) : CallICBase(Code::CALL_IC, isolate) { |
| 241 | ASSERT(target()->is_call_stub()); |
| 242 | } |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 243 | |
| 244 | // Code generator routines. |
| 245 | static void GenerateInitialize(MacroAssembler* masm, int argc) { |
| 246 | GenerateMiss(masm, argc); |
| 247 | } |
| 248 | static void GenerateMiss(MacroAssembler* masm, int argc); |
| 249 | static void GenerateMegamorphic(MacroAssembler* masm, int argc); |
| 250 | static void GenerateNormal(MacroAssembler* masm, int argc); |
| 251 | }; |
| 252 | |
| 253 | |
| 254 | class KeyedCallIC: public CallICBase { |
| 255 | public: |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 256 | explicit KeyedCallIC(Isolate* isolate) |
| 257 | : CallICBase(Code::KEYED_CALL_IC, isolate) { |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 258 | ASSERT(target()->is_keyed_call_stub()); |
| 259 | } |
| 260 | |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 261 | MUST_USE_RESULT MaybeObject* LoadFunction(State state, |
| 262 | Handle<Object> object, |
| 263 | Handle<Object> key); |
Ben Murdoch | 7f4d5bd | 2010-06-15 11:15:29 +0100 | [diff] [blame] | 264 | |
| 265 | // Code generator routines. |
| 266 | static void GenerateInitialize(MacroAssembler* masm, int argc) { |
| 267 | GenerateMiss(masm, argc); |
| 268 | } |
| 269 | static void GenerateMiss(MacroAssembler* masm, int argc); |
| 270 | static void GenerateMegamorphic(MacroAssembler* masm, int argc); |
| 271 | static void GenerateNormal(MacroAssembler* masm, int argc); |
| 272 | }; |
| 273 | |
| 274 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 275 | class LoadIC: public IC { |
| 276 | public: |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 277 | explicit LoadIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { |
| 278 | ASSERT(target()->is_load_stub()); |
| 279 | } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 280 | |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 281 | MUST_USE_RESULT MaybeObject* Load(State state, |
| 282 | Handle<Object> object, |
| 283 | Handle<String> name); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 284 | |
| 285 | // Code generator routines. |
Andrei Popescu | 402d937 | 2010-02-26 13:31:12 +0000 | [diff] [blame] | 286 | static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
| 287 | static void GeneratePreMonomorphic(MacroAssembler* masm) { |
| 288 | GenerateMiss(masm); |
| 289 | } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 290 | static void GenerateMiss(MacroAssembler* masm); |
| 291 | static void GenerateMegamorphic(MacroAssembler* masm); |
| 292 | static void GenerateNormal(MacroAssembler* masm); |
| 293 | |
| 294 | // Specialized code generator routines. |
| 295 | static void GenerateArrayLength(MacroAssembler* masm); |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 296 | static void GenerateStringLength(MacroAssembler* masm, |
| 297 | bool support_wrappers); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 298 | static void GenerateFunctionPrototype(MacroAssembler* masm); |
| 299 | |
Kristian Monsen | 25f6136 | 2010-05-21 11:50:48 +0100 | [diff] [blame] | 300 | // Clear the use of the inlined version. |
| 301 | static void ClearInlinedVersion(Address address); |
| 302 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 303 | // The offset from the inlined patch site to the start of the |
| 304 | // inlined load instruction. It is architecture-dependent, and not |
| 305 | // used on ARM. |
| 306 | static const int kOffsetToLoadInstruction; |
| 307 | |
| 308 | private: |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 309 | // Update the inline cache and the global stub cache based on the |
| 310 | // lookup result. |
| 311 | void UpdateCaches(LookupResult* lookup, |
| 312 | State state, |
| 313 | Handle<Object> object, |
| 314 | Handle<String> name); |
| 315 | |
| 316 | // Stub accessors. |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 317 | Code* megamorphic_stub() { |
| 318 | return isolate()->builtins()->builtin( |
| 319 | Builtins::kLoadIC_Megamorphic); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 320 | } |
| 321 | static Code* initialize_stub() { |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 322 | return Isolate::Current()->builtins()->builtin( |
| 323 | Builtins::kLoadIC_Initialize); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 324 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 325 | Code* pre_monomorphic_stub() { |
| 326 | return isolate()->builtins()->builtin( |
| 327 | Builtins::kLoadIC_PreMonomorphic); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 328 | } |
| 329 | |
| 330 | static void Clear(Address address, Code* target); |
| 331 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 332 | static bool PatchInlinedLoad(Address address, Object* map, int index); |
| 333 | |
Kristian Monsen | 0d5e116 | 2010-09-30 15:31:59 +0100 | [diff] [blame] | 334 | static bool PatchInlinedContextualLoad(Address address, |
| 335 | Object* map, |
Ben Murdoch | f87a203 | 2010-10-22 12:50:53 +0100 | [diff] [blame] | 336 | Object* cell, |
| 337 | bool is_dont_delete); |
Kristian Monsen | 0d5e116 | 2010-09-30 15:31:59 +0100 | [diff] [blame] | 338 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 339 | friend class IC; |
| 340 | }; |
| 341 | |
| 342 | |
| 343 | class KeyedLoadIC: public IC { |
| 344 | public: |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 345 | explicit KeyedLoadIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { |
| 346 | ASSERT(target()->is_keyed_load_stub()); |
| 347 | } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 348 | |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 349 | MUST_USE_RESULT MaybeObject* Load(State state, |
| 350 | Handle<Object> object, |
| 351 | Handle<Object> key); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 352 | |
| 353 | // Code generator routines. |
| 354 | static void GenerateMiss(MacroAssembler* masm); |
Andrei Popescu | 402d937 | 2010-02-26 13:31:12 +0000 | [diff] [blame] | 355 | static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
| 356 | static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
| 357 | static void GeneratePreMonomorphic(MacroAssembler* masm) { |
| 358 | GenerateMiss(masm); |
| 359 | } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 360 | static void GenerateGeneric(MacroAssembler* masm); |
Leon Clarke | e46be81 | 2010-01-19 14:06:41 +0000 | [diff] [blame] | 361 | static void GenerateString(MacroAssembler* masm); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 362 | |
Andrei Popescu | 402d937 | 2010-02-26 13:31:12 +0000 | [diff] [blame] | 363 | static void GenerateIndexedInterceptor(MacroAssembler* masm); |
Steve Block | 3ce2e20 | 2009-11-05 08:53:23 +0000 | [diff] [blame] | 364 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 365 | // Clear the use of the inlined version. |
| 366 | static void ClearInlinedVersion(Address address); |
| 367 | |
Leon Clarke | d91b9f7 | 2010-01-27 17:25:45 +0000 | [diff] [blame] | 368 | // Bit mask to be tested against bit field for the cases when |
| 369 | // generic stub should go into slow case. |
| 370 | // Access check is necessary explicitly since generic stub does not perform |
| 371 | // map checks. |
| 372 | static const int kSlowCaseBitFieldMask = |
| 373 | (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); |
| 374 | |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 375 | private: |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 376 | // Update the inline cache. |
| 377 | void UpdateCaches(LookupResult* lookup, |
| 378 | State state, |
| 379 | Handle<Object> object, |
| 380 | Handle<String> name); |
| 381 | |
| 382 | // Stub accessors. |
| 383 | static Code* initialize_stub() { |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 384 | return Isolate::Current()->builtins()->builtin( |
| 385 | Builtins::kKeyedLoadIC_Initialize); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 386 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 387 | Code* megamorphic_stub() { |
| 388 | return isolate()->builtins()->builtin( |
| 389 | Builtins::kKeyedLoadIC_Generic); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 390 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 391 | Code* generic_stub() { |
| 392 | return isolate()->builtins()->builtin( |
| 393 | Builtins::kKeyedLoadIC_Generic); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 394 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 395 | Code* pre_monomorphic_stub() { |
| 396 | return isolate()->builtins()->builtin( |
| 397 | Builtins::kKeyedLoadIC_PreMonomorphic); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 398 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 399 | Code* string_stub() { |
| 400 | return isolate()->builtins()->builtin( |
| 401 | Builtins::kKeyedLoadIC_String); |
Leon Clarke | e46be81 | 2010-01-19 14:06:41 +0000 | [diff] [blame] | 402 | } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 403 | |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 404 | Code* indexed_interceptor_stub() { |
| 405 | return isolate()->builtins()->builtin( |
| 406 | Builtins::kKeyedLoadIC_IndexedInterceptor); |
Andrei Popescu | 402d937 | 2010-02-26 13:31:12 +0000 | [diff] [blame] | 407 | } |
| 408 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 409 | static void Clear(Address address, Code* target); |
| 410 | |
| 411 | // Support for patching the map that is checked in an inlined |
| 412 | // version of keyed load. |
| 413 | static bool PatchInlinedLoad(Address address, Object* map); |
| 414 | |
| 415 | friend class IC; |
| 416 | }; |
| 417 | |
| 418 | |
| 419 | class StoreIC: public IC { |
| 420 | public: |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 421 | explicit StoreIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { |
| 422 | ASSERT(target()->is_store_stub()); |
| 423 | } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 424 | |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 425 | MUST_USE_RESULT MaybeObject* Store(State state, |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 426 | StrictModeFlag strict_mode, |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 427 | Handle<Object> object, |
| 428 | Handle<String> name, |
| 429 | Handle<Object> value); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 430 | |
| 431 | // Code generators for stub routines. Only called once at startup. |
Leon Clarke | 4515c47 | 2010-02-03 11:58:03 +0000 | [diff] [blame] | 432 | static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 433 | static void GenerateMiss(MacroAssembler* masm); |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 434 | static void GenerateMegamorphic(MacroAssembler* masm, |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 435 | StrictModeFlag strict_mode); |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 436 | static void GenerateArrayLength(MacroAssembler* masm); |
Steve Block | 8defd9f | 2010-07-08 12:39:36 +0100 | [diff] [blame] | 437 | static void GenerateNormal(MacroAssembler* masm); |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 438 | static void GenerateGlobalProxy(MacroAssembler* masm, |
| 439 | StrictModeFlag strict_mode); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 440 | |
Kristian Monsen | 50ef84f | 2010-07-29 15:18:00 +0100 | [diff] [blame] | 441 | // Clear the use of an inlined version. |
| 442 | static void ClearInlinedVersion(Address address); |
| 443 | |
| 444 | // The offset from the inlined patch site to the start of the |
| 445 | // inlined store instruction. |
| 446 | static const int kOffsetToStoreInstruction; |
| 447 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 448 | private: |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 449 | // Update the inline cache and the global stub cache based on the |
| 450 | // lookup result. |
| 451 | void UpdateCaches(LookupResult* lookup, |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 452 | State state, |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 453 | StrictModeFlag strict_mode, |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 454 | Handle<JSObject> receiver, |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 455 | Handle<String> name, |
| 456 | Handle<Object> value); |
| 457 | |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 458 | void set_target(Code* code) { |
| 459 | // Strict mode must be preserved across IC patching. |
| 460 | ASSERT((code->extra_ic_state() & kStrictMode) == |
| 461 | (target()->extra_ic_state() & kStrictMode)); |
| 462 | IC::set_target(code); |
| 463 | } |
| 464 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 465 | // Stub accessors. |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 466 | Code* megamorphic_stub() { |
| 467 | return isolate()->builtins()->builtin( |
| 468 | Builtins::kStoreIC_Megamorphic); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 469 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 470 | Code* megamorphic_stub_strict() { |
| 471 | return isolate()->builtins()->builtin( |
| 472 | Builtins::kStoreIC_Megamorphic_Strict); |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 473 | } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 474 | static Code* initialize_stub() { |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 475 | return Isolate::Current()->builtins()->builtin( |
| 476 | Builtins::kStoreIC_Initialize); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 477 | } |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 478 | static Code* initialize_stub_strict() { |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 479 | return Isolate::Current()->builtins()->builtin( |
| 480 | Builtins::kStoreIC_Initialize_Strict); |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 481 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 482 | Code* global_proxy_stub() { |
| 483 | return isolate()->builtins()->builtin( |
| 484 | Builtins::kStoreIC_GlobalProxy); |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 485 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 486 | Code* global_proxy_stub_strict() { |
| 487 | return isolate()->builtins()->builtin( |
| 488 | Builtins::kStoreIC_GlobalProxy_Strict); |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 489 | } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 490 | |
| 491 | static void Clear(Address address, Code* target); |
Kristian Monsen | 50ef84f | 2010-07-29 15:18:00 +0100 | [diff] [blame] | 492 | |
| 493 | // Support for patching the index and the map that is checked in an |
| 494 | // inlined version of the named store. |
| 495 | static bool PatchInlinedStore(Address address, Object* map, int index); |
| 496 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 497 | friend class IC; |
| 498 | }; |
| 499 | |
| 500 | |
| 501 | class KeyedStoreIC: public IC { |
| 502 | public: |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 503 | explicit KeyedStoreIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 504 | |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 505 | MUST_USE_RESULT MaybeObject* Store(State state, |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 506 | StrictModeFlag strict_mode, |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 507 | Handle<Object> object, |
| 508 | Handle<Object> name, |
| 509 | Handle<Object> value); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 510 | |
| 511 | // Code generators for stub routines. Only called once at startup. |
Andrei Popescu | 402d937 | 2010-02-26 13:31:12 +0000 | [diff] [blame] | 512 | static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 513 | static void GenerateMiss(MacroAssembler* masm); |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 514 | static void GenerateRuntimeSetProperty(MacroAssembler* masm, |
| 515 | StrictModeFlag strict_mode); |
| 516 | static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 517 | |
| 518 | // Clear the inlined version so the IC is always hit. |
| 519 | static void ClearInlinedVersion(Address address); |
| 520 | |
| 521 | // Restore the inlined version so the fast case can get hit. |
| 522 | static void RestoreInlinedVersion(Address address); |
| 523 | |
| 524 | private: |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 525 | // Update the inline cache. |
| 526 | void UpdateCaches(LookupResult* lookup, |
| 527 | State state, |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 528 | StrictModeFlag strict_mode, |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 529 | Handle<JSObject> receiver, |
| 530 | Handle<String> name, |
| 531 | Handle<Object> value); |
| 532 | |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 533 | void set_target(Code* code) { |
| 534 | // Strict mode must be preserved across IC patching. |
| 535 | ASSERT((code->extra_ic_state() & kStrictMode) == |
| 536 | (target()->extra_ic_state() & kStrictMode)); |
| 537 | IC::set_target(code); |
| 538 | } |
| 539 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 540 | // Stub accessors. |
| 541 | static Code* initialize_stub() { |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 542 | return Isolate::Current()->builtins()->builtin( |
| 543 | Builtins::kKeyedStoreIC_Initialize); |
| 544 | } |
| 545 | Code* megamorphic_stub() { |
| 546 | return isolate()->builtins()->builtin( |
| 547 | Builtins::kKeyedStoreIC_Generic); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 548 | } |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 549 | static Code* initialize_stub_strict() { |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 550 | return Isolate::Current()->builtins()->builtin( |
| 551 | Builtins::kKeyedStoreIC_Initialize_Strict); |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 552 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 553 | Code* megamorphic_stub_strict() { |
| 554 | return isolate()->builtins()->builtin( |
| 555 | Builtins::kKeyedStoreIC_Generic_Strict); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 556 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 557 | Code* generic_stub() { |
| 558 | return isolate()->builtins()->builtin( |
| 559 | Builtins::kKeyedStoreIC_Generic); |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 560 | } |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 561 | Code* generic_stub_strict() { |
| 562 | return isolate()->builtins()->builtin( |
| 563 | Builtins::kKeyedStoreIC_Generic_Strict); |
Ben Murdoch | e0cee9b | 2011-05-25 10:26:03 +0100 | [diff] [blame] | 564 | } |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 565 | |
| 566 | static void Clear(Address address, Code* target); |
| 567 | |
| 568 | // Support for patching the map that is checked in an inlined |
| 569 | // version of keyed store. |
| 570 | // The address is the patch point for the IC call |
| 571 | // (Assembler::kCallTargetAddressOffset before the end of |
| 572 | // the call/return address). |
| 573 | // The map is the new map that the inlined code should check against. |
| 574 | static bool PatchInlinedStore(Address address, Object* map); |
| 575 | |
| 576 | friend class IC; |
| 577 | }; |
| 578 | |
| 579 | |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 580 | class BinaryOpIC: public IC { |
| 581 | public: |
| 582 | |
| 583 | enum TypeInfo { |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 584 | UNINIT_OR_SMI, |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 585 | DEFAULT, // Initial state. When first executed, patches to one |
| 586 | // of the following states depending on the operands types. |
| 587 | HEAP_NUMBERS, // Both arguments are HeapNumbers. |
| 588 | STRINGS, // At least one of the arguments is String. |
| 589 | GENERIC // Non-specialized case (processes any type combination). |
| 590 | }; |
| 591 | |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 592 | explicit BinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 593 | |
| 594 | void patch(Code* code); |
| 595 | |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 596 | static const char* GetName(TypeInfo type_info); |
| 597 | |
| 598 | static State ToState(TypeInfo type_info); |
| 599 | |
| 600 | static TypeInfo GetTypeInfo(Object* left, Object* right); |
| 601 | }; |
| 602 | |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 603 | |
| 604 | // Type Recording BinaryOpIC, that records the types of the inputs and outputs. |
| 605 | class TRBinaryOpIC: public IC { |
| 606 | public: |
| 607 | |
| 608 | enum TypeInfo { |
| 609 | UNINITIALIZED, |
| 610 | SMI, |
| 611 | INT32, |
| 612 | HEAP_NUMBER, |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 613 | ODDBALL, |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 614 | STRING, // Only used for addition operation. At least one string operand. |
| 615 | GENERIC |
| 616 | }; |
| 617 | |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 618 | explicit TRBinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 619 | |
| 620 | void patch(Code* code); |
| 621 | |
| 622 | static const char* GetName(TypeInfo type_info); |
| 623 | |
| 624 | static State ToState(TypeInfo type_info); |
| 625 | |
| 626 | static TypeInfo GetTypeInfo(Handle<Object> left, Handle<Object> right); |
| 627 | |
| 628 | static TypeInfo JoinTypes(TypeInfo x, TypeInfo y); |
| 629 | }; |
| 630 | |
| 631 | |
| 632 | class CompareIC: public IC { |
| 633 | public: |
| 634 | enum State { |
| 635 | UNINITIALIZED, |
| 636 | SMIS, |
| 637 | HEAP_NUMBERS, |
| 638 | OBJECTS, |
| 639 | GENERIC |
| 640 | }; |
| 641 | |
Steve Block | 44f0eee | 2011-05-26 01:26:41 +0100 | [diff] [blame^] | 642 | CompareIC(Isolate* isolate, Token::Value op) |
| 643 | : IC(EXTRA_CALL_FRAME, isolate), op_(op) { } |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 644 | |
| 645 | // Update the inline cache for the given operands. |
| 646 | void UpdateCaches(Handle<Object> x, Handle<Object> y); |
| 647 | |
| 648 | // Factory method for getting an uninitialized compare stub. |
| 649 | static Handle<Code> GetUninitialized(Token::Value op); |
| 650 | |
| 651 | // Helper function for computing the condition for a compare operation. |
| 652 | static Condition ComputeCondition(Token::Value op); |
| 653 | |
| 654 | // Helper function for determining the state of a compare IC. |
| 655 | static State ComputeState(Code* target); |
| 656 | |
| 657 | static const char* GetStateName(State state); |
| 658 | |
| 659 | private: |
| 660 | State TargetState(State state, bool has_inlined_smi_code, |
| 661 | Handle<Object> x, Handle<Object> y); |
| 662 | |
| 663 | bool strict() const { return op_ == Token::EQ_STRICT; } |
| 664 | Condition GetCondition() const { return ComputeCondition(op_); } |
| 665 | State GetState() { return ComputeState(target()); } |
| 666 | |
| 667 | Token::Value op_; |
| 668 | }; |
| 669 | |
| 670 | // Helper for TRBinaryOpIC and CompareIC. |
| 671 | void PatchInlinedSmiCode(Address address); |
| 672 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 673 | } } // namespace v8::internal |
| 674 | |
| 675 | #endif // V8_IC_H_ |