ulan@chromium.org | 65a89c2 | 2012-02-14 11:46:07 +0000 | [diff] [blame] | 1 | // Copyright 2012 the V8 project authors. All rights reserved. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 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 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 31 | #include "macro-assembler.h" |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 32 | #include "type-info.h" |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 33 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 34 | namespace v8 { |
| 35 | namespace internal { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 36 | |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 37 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 38 | // IC_UTIL_LIST defines all utility functions called from generated |
| 39 | // inline caching code. The argument for the macro, ICU, is the function name. |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 40 | #define IC_UTIL_LIST(ICU) \ |
| 41 | ICU(LoadIC_Miss) \ |
| 42 | ICU(KeyedLoadIC_Miss) \ |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 43 | ICU(KeyedLoadIC_MissForceGeneric) \ |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 44 | ICU(CallIC_Miss) \ |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 45 | ICU(KeyedCallIC_Miss) \ |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 46 | ICU(StoreIC_Miss) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 47 | ICU(StoreIC_ArrayLength) \ |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 48 | ICU(SharedStoreIC_ExtendStorage) \ |
| 49 | ICU(KeyedStoreIC_Miss) \ |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 50 | ICU(KeyedStoreIC_MissForceGeneric) \ |
| 51 | ICU(KeyedStoreIC_Slow) \ |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 52 | /* Utilities for IC stubs. */ \ |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 53 | ICU(StoreCallbackProperty) \ |
| 54 | ICU(LoadPropertyWithInterceptorOnly) \ |
| 55 | ICU(LoadPropertyWithInterceptorForLoad) \ |
| 56 | ICU(LoadPropertyWithInterceptorForCall) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 57 | ICU(KeyedLoadPropertyWithInterceptor) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 58 | ICU(StoreInterceptorProperty) \ |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 59 | ICU(UnaryOp_Patch) \ |
| 60 | ICU(BinaryOp_Patch) \ |
ricow@chromium.org | 9fa0967 | 2011-07-25 11:05:35 +0000 | [diff] [blame] | 61 | ICU(CompareIC_Miss) \ |
| 62 | ICU(ToBoolean_Patch) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 63 | // |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 64 | // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC, |
| 65 | // and KeyedStoreIC. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 66 | // |
| 67 | class IC { |
| 68 | public: |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 69 | // The ids for utility called from the generated code. |
| 70 | enum UtilityId { |
| 71 | #define CONST_NAME(name) k##name, |
| 72 | IC_UTIL_LIST(CONST_NAME) |
| 73 | #undef CONST_NAME |
| 74 | kUtilityCount |
| 75 | }; |
| 76 | |
| 77 | // Looks up the address of the named utility. |
| 78 | static Address AddressFromUtilityId(UtilityId id); |
| 79 | |
| 80 | // Alias the inline cache state type to make the IC code more readable. |
| 81 | typedef InlineCacheState State; |
| 82 | |
| 83 | // The IC code is either invoked with no extra frames on the stack |
| 84 | // or with a single extra frame for supporting calls. |
| 85 | enum FrameDepth { |
| 86 | NO_EXTRA_FRAME = 0, |
| 87 | EXTRA_CALL_FRAME = 1 |
| 88 | }; |
| 89 | |
| 90 | // Construct the IC structure with the given number of extra |
| 91 | // JavaScript frames on the stack. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 92 | IC(FrameDepth depth, Isolate* isolate); |
ricow@chromium.org | 64e3a4b | 2011-12-13 08:07:27 +0000 | [diff] [blame] | 93 | virtual ~IC() {} |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 94 | |
| 95 | // Get the call-site target; used for determining the state. |
ricow@chromium.org | 64e3a4b | 2011-12-13 08:07:27 +0000 | [diff] [blame] | 96 | Code* target() const { return GetTargetAtAddress(address()); } |
| 97 | inline Address address() const; |
| 98 | |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 99 | // Compute the current IC state based on the target stub, receiver and name. |
| 100 | static State StateFrom(Code* target, Object* receiver, Object* name); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 101 | |
| 102 | // Clear the inline cache to initial state. |
| 103 | static void Clear(Address address); |
| 104 | |
| 105 | // Computes the reloc info for this IC. This is a fairly expensive |
| 106 | // operation as it has to search through the heap to find the code |
| 107 | // object that contains this IC site. |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 108 | RelocInfo::Mode ComputeMode(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 109 | |
| 110 | // Returns if this IC is for contextual (no explicit receiver) |
| 111 | // access to properties. |
mvstanton@chromium.org | c47dff5 | 2013-01-23 16:28:41 +0000 | [diff] [blame] | 112 | bool IsUndeclaredGlobal(Handle<Object> receiver) { |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 113 | if (receiver->IsGlobalObject()) { |
mvstanton@chromium.org | c47dff5 | 2013-01-23 16:28:41 +0000 | [diff] [blame] | 114 | return SlowIsUndeclaredGlobal(); |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 115 | } else { |
mvstanton@chromium.org | c47dff5 | 2013-01-23 16:28:41 +0000 | [diff] [blame] | 116 | ASSERT(!SlowIsUndeclaredGlobal()); |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 117 | return false; |
| 118 | } |
| 119 | } |
| 120 | |
mvstanton@chromium.org | c47dff5 | 2013-01-23 16:28:41 +0000 | [diff] [blame] | 121 | bool SlowIsUndeclaredGlobal() { |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 122 | return ComputeMode() == RelocInfo::CODE_TARGET_CONTEXT; |
| 123 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 124 | |
kmillikin@chromium.org | 69ea396 | 2010-07-05 11:01:40 +0000 | [diff] [blame] | 125 | // Determines which map must be used for keeping the code stub. |
| 126 | // These methods should not be called with undefined or null. |
| 127 | static inline InlineCacheHolderFlag GetCodeCacheForObject(Object* object, |
| 128 | JSObject* holder); |
| 129 | static inline InlineCacheHolderFlag GetCodeCacheForObject(JSObject* object, |
| 130 | JSObject* holder); |
hpayer@chromium.org | 8432c91 | 2013-02-28 15:55:26 +0000 | [diff] [blame] | 131 | static inline JSObject* GetCodeCacheHolder(Isolate* isolate, |
| 132 | Object* object, |
ricow@chromium.org | 65fae84 | 2010-08-25 15:26:24 +0000 | [diff] [blame] | 133 | InlineCacheHolderFlag holder); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 134 | |
| 135 | protected: |
| 136 | Address fp() const { return fp_; } |
| 137 | Address pc() const { return *pc_address_; } |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 138 | Isolate* isolate() const { return isolate_; } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 139 | |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 140 | #ifdef ENABLE_DEBUGGER_SUPPORT |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 141 | // Computes the address in the original code when the code running is |
| 142 | // containing break points (calls to DebugBreakXXX builtins). |
ricow@chromium.org | 64e3a4b | 2011-12-13 08:07:27 +0000 | [diff] [blame] | 143 | Address OriginalCodeAddress() const; |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 144 | #endif |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 145 | |
| 146 | // Set the call-site target. |
| 147 | void set_target(Code* code) { SetTargetAtAddress(address(), code); } |
| 148 | |
| 149 | #ifdef DEBUG |
ricow@chromium.org | 64e3a4b | 2011-12-13 08:07:27 +0000 | [diff] [blame] | 150 | char TransitionMarkFromState(IC::State state); |
| 151 | |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 152 | void TraceIC(const char* type, |
| 153 | Handle<Object> name, |
| 154 | State old_state, |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 155 | Code* new_target); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 156 | #endif |
| 157 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 158 | Failure* TypeError(const char* type, |
| 159 | Handle<Object> object, |
| 160 | Handle<Object> key); |
| 161 | Failure* ReferenceError(const char* type, Handle<String> name); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 162 | |
| 163 | // Access the target code for the given IC address. |
| 164 | static inline Code* GetTargetAtAddress(Address address); |
| 165 | static inline void SetTargetAtAddress(Address address, Code* target); |
jkummerow@chromium.org | f7a5884 | 2012-02-21 10:08:21 +0000 | [diff] [blame] | 166 | static void PostPatching(Address address, Code* target, Code* old_target); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 167 | |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame^] | 168 | virtual void UpdateMonomorphicIC(Handle<JSObject> receiver, |
| 169 | Handle<Code> handler, |
| 170 | Handle<String> name) { |
| 171 | set_target(*handler); |
| 172 | } |
| 173 | bool UpdatePolymorphicIC(State state, |
| 174 | StrictModeFlag strict_mode, |
| 175 | Handle<JSObject> receiver, |
| 176 | Handle<String> name, |
| 177 | Handle<Code> code); |
mvstanton@chromium.org | d16d853 | 2013-01-25 13:29:10 +0000 | [diff] [blame] | 178 | void PatchCache(State state, |
| 179 | StrictModeFlag strict_mode, |
| 180 | Handle<JSObject> receiver, |
| 181 | Handle<String> name, |
| 182 | Handle<Code> code); |
| 183 | virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code); |
| 184 | virtual Handle<Code> megamorphic_stub() { |
| 185 | UNREACHABLE(); |
| 186 | return Handle<Code>::null(); |
| 187 | } |
| 188 | virtual Handle<Code> megamorphic_stub_strict() { |
| 189 | UNREACHABLE(); |
| 190 | return Handle<Code>::null(); |
| 191 | } |
mstarzinger@chromium.org | 068ea0a | 2013-01-30 09:39:44 +0000 | [diff] [blame] | 192 | virtual Handle<Code> generic_stub() const { |
| 193 | UNREACHABLE(); |
| 194 | return Handle<Code>::null(); |
| 195 | } |
| 196 | virtual Handle<Code> generic_stub_strict() const { |
| 197 | UNREACHABLE(); |
| 198 | return Handle<Code>::null(); |
| 199 | } |
mvstanton@chromium.org | d16d853 | 2013-01-25 13:29:10 +0000 | [diff] [blame] | 200 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 201 | private: |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 202 | // Frame pointer for the frame that uses (calls) the IC. |
| 203 | Address fp_; |
| 204 | |
| 205 | // All access to the program counter of an IC structure is indirect |
| 206 | // to make the code GC safe. This feature is crucial since |
| 207 | // GetProperty and SetProperty are called and they in turn might |
| 208 | // invoke the garbage collector. |
| 209 | Address* pc_address_; |
mads.s.ager | 31e7138 | 2008-08-13 09:32:07 +0000 | [diff] [blame] | 210 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 211 | Isolate* isolate_; |
| 212 | |
mads.s.ager | 31e7138 | 2008-08-13 09:32:07 +0000 | [diff] [blame] | 213 | DISALLOW_IMPLICIT_CONSTRUCTORS(IC); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 214 | }; |
| 215 | |
| 216 | |
| 217 | // An IC_Utility encapsulates IC::UtilityId. It exists mainly because you |
| 218 | // cannot make forward declarations to an enum. |
| 219 | class IC_Utility { |
| 220 | public: |
| 221 | explicit IC_Utility(IC::UtilityId id) |
| 222 | : address_(IC::AddressFromUtilityId(id)), id_(id) {} |
| 223 | |
| 224 | Address address() const { return address_; } |
| 225 | |
| 226 | IC::UtilityId id() const { return id_; } |
| 227 | private: |
| 228 | Address address_; |
| 229 | IC::UtilityId id_; |
| 230 | }; |
| 231 | |
| 232 | |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 233 | class CallICBase: public IC { |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 234 | public: |
| 235 | class Contextual: public BitField<bool, 0, 1> {}; |
| 236 | class StringStubState: public BitField<StringStubFeedback, 1, 1> {}; |
| 237 | |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 238 | // Returns a JSFunction or a Failure. |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 239 | MUST_USE_RESULT MaybeObject* LoadFunction(State state, |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 240 | Code::ExtraICState extra_ic_state, |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 241 | Handle<Object> object, |
| 242 | Handle<String> name); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 243 | |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 244 | protected: |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 245 | CallICBase(Code::Kind kind, Isolate* isolate) |
| 246 | : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {} |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 247 | |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 248 | bool TryUpdateExtraICState(LookupResult* lookup, |
| 249 | Handle<Object> object, |
| 250 | Code::ExtraICState* extra_ic_state); |
| 251 | |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 252 | // Compute a monomorphic stub if possible, otherwise return a null handle. |
| 253 | Handle<Code> ComputeMonomorphicStub(LookupResult* lookup, |
| 254 | State state, |
| 255 | Code::ExtraICState extra_state, |
| 256 | Handle<Object> object, |
| 257 | Handle<String> name); |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 258 | |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 259 | // Update the inline cache and the global stub cache based on the lookup |
| 260 | // result. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 261 | void UpdateCaches(LookupResult* lookup, |
| 262 | State state, |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 263 | Code::ExtraICState extra_ic_state, |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 264 | Handle<Object> object, |
| 265 | Handle<String> name); |
| 266 | |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 267 | // Returns a JSFunction if the object can be called as a function, and |
| 268 | // patches the stack to be ready for the call. Otherwise, it returns the |
| 269 | // undefined value. |
| 270 | Handle<Object> TryCallAsFunction(Handle<Object> object); |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 271 | |
fschneider@chromium.org | 3a5fd78 | 2011-02-24 10:10:44 +0000 | [diff] [blame] | 272 | void ReceiverToObjectIfRequired(Handle<Object> callee, Handle<Object> object); |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 273 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 274 | static void Clear(Address address, Code* target); |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 275 | |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 276 | // Platform-specific code generation functions used by both call and |
| 277 | // keyed call. |
| 278 | static void GenerateMiss(MacroAssembler* masm, |
| 279 | int argc, |
| 280 | IC::UtilityId id, |
| 281 | Code::ExtraICState extra_state); |
| 282 | |
| 283 | static void GenerateNormal(MacroAssembler* masm, int argc); |
| 284 | |
| 285 | static void GenerateMonomorphicCacheProbe(MacroAssembler* masm, |
| 286 | int argc, |
| 287 | Code::Kind kind, |
| 288 | Code::ExtraICState extra_state); |
| 289 | |
| 290 | Code::Kind kind_; |
| 291 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 292 | friend class IC; |
| 293 | }; |
| 294 | |
| 295 | |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 296 | class CallIC: public CallICBase { |
| 297 | public: |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 298 | explicit CallIC(Isolate* isolate) : CallICBase(Code::CALL_IC, isolate) { |
| 299 | ASSERT(target()->is_call_stub()); |
| 300 | } |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 301 | |
| 302 | // Code generator routines. |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 303 | static void GenerateInitialize(MacroAssembler* masm, |
| 304 | int argc, |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 305 | Code::ExtraICState extra_state) { |
| 306 | GenerateMiss(masm, argc, extra_state); |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 307 | } |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 308 | |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 309 | static void GenerateMiss(MacroAssembler* masm, |
| 310 | int argc, |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 311 | Code::ExtraICState extra_state) { |
| 312 | CallICBase::GenerateMiss(masm, argc, IC::kCallIC_Miss, extra_state); |
| 313 | } |
| 314 | |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 315 | static void GenerateMegamorphic(MacroAssembler* masm, |
| 316 | int argc, |
| 317 | Code::ExtraICState extra_ic_state); |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 318 | |
| 319 | static void GenerateNormal(MacroAssembler* masm, int argc) { |
| 320 | CallICBase::GenerateNormal(masm, argc); |
| 321 | GenerateMiss(masm, argc, Code::kNoExtraICState); |
| 322 | } |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 323 | }; |
| 324 | |
| 325 | |
| 326 | class KeyedCallIC: public CallICBase { |
| 327 | public: |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 328 | explicit KeyedCallIC(Isolate* isolate) |
| 329 | : CallICBase(Code::KEYED_CALL_IC, isolate) { |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 330 | ASSERT(target()->is_keyed_call_stub()); |
| 331 | } |
| 332 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 333 | MUST_USE_RESULT MaybeObject* LoadFunction(State state, |
| 334 | Handle<Object> object, |
| 335 | Handle<Object> key); |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 336 | |
| 337 | // Code generator routines. |
| 338 | static void GenerateInitialize(MacroAssembler* masm, int argc) { |
| 339 | GenerateMiss(masm, argc); |
| 340 | } |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 341 | |
| 342 | static void GenerateMiss(MacroAssembler* masm, int argc) { |
| 343 | CallICBase::GenerateMiss(masm, argc, IC::kKeyedCallIC_Miss, |
| 344 | Code::kNoExtraICState); |
| 345 | } |
| 346 | |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 347 | static void GenerateMegamorphic(MacroAssembler* masm, int argc); |
| 348 | static void GenerateNormal(MacroAssembler* masm, int argc); |
whesse@chromium.org | 7b26015 | 2011-06-20 15:33:18 +0000 | [diff] [blame] | 349 | static void GenerateNonStrictArguments(MacroAssembler* masm, int argc); |
lrn@chromium.org | 1af7e1b | 2010-06-07 11:12:01 +0000 | [diff] [blame] | 350 | }; |
| 351 | |
| 352 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 353 | class LoadIC: public IC { |
| 354 | public: |
mstarzinger@chromium.org | e3b8d0f | 2013-02-01 09:06:41 +0000 | [diff] [blame] | 355 | explicit LoadIC(FrameDepth depth, Isolate* isolate) : IC(depth, isolate) { |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 356 | ASSERT(target()->is_load_stub() || target()->is_keyed_load_stub()); |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 357 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 358 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 359 | // Code generator routines. |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 360 | static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
| 361 | static void GeneratePreMonomorphic(MacroAssembler* masm) { |
| 362 | GenerateMiss(masm); |
| 363 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 364 | static void GenerateMiss(MacroAssembler* masm); |
| 365 | static void GenerateMegamorphic(MacroAssembler* masm); |
| 366 | static void GenerateNormal(MacroAssembler* masm); |
| 367 | |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 368 | MUST_USE_RESULT MaybeObject* Load(State state, |
| 369 | Handle<Object> object, |
| 370 | Handle<String> name); |
| 371 | |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 372 | protected: |
| 373 | virtual Code::Kind kind() const { return Code::LOAD_IC; } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 374 | |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 375 | virtual Handle<Code> generic_stub() const { |
| 376 | UNREACHABLE(); |
| 377 | return Handle<Code>::null(); |
| 378 | } |
| 379 | |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 380 | virtual Handle<Code> megamorphic_stub() { |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 381 | return isolate()->builtins()->LoadIC_Megamorphic(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 382 | } |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 383 | |
| 384 | // Update the inline cache and the global stub cache based on the |
| 385 | // lookup result. |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 386 | void UpdateCaches(LookupResult* lookup, |
| 387 | State state, |
| 388 | Handle<Object> object, |
| 389 | Handle<String> name); |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame^] | 390 | virtual void UpdateMonomorphicIC(Handle<JSObject> receiver, |
| 391 | Handle<Code> handler, |
| 392 | Handle<String> name); |
| 393 | virtual Handle<Code> ComputeLoadHandler(LookupResult* lookup, |
| 394 | Handle<JSObject> receiver, |
| 395 | Handle<String> name); |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 396 | |
| 397 | private: |
| 398 | // Stub accessors. |
| 399 | static Handle<Code> initialize_stub() { |
| 400 | return Isolate::Current()->builtins()->LoadIC_Initialize(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 401 | } |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 402 | virtual Handle<Code> pre_monomorphic_stub() { |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 403 | return isolate()->builtins()->LoadIC_PreMonomorphic(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | static void Clear(Address address, Code* target); |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 407 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 408 | friend class IC; |
| 409 | }; |
| 410 | |
| 411 | |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 412 | enum ICMissMode { |
| 413 | MISS_FORCE_GENERIC, |
| 414 | MISS |
| 415 | }; |
| 416 | |
| 417 | |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 418 | class KeyedLoadIC: public LoadIC { |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 419 | public: |
mstarzinger@chromium.org | e3b8d0f | 2013-02-01 09:06:41 +0000 | [diff] [blame] | 420 | explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate) |
| 421 | : LoadIC(depth, isolate) { |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 422 | ASSERT(target()->is_keyed_load_stub()); |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 423 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 424 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 425 | MUST_USE_RESULT MaybeObject* Load(State state, |
| 426 | Handle<Object> object, |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 427 | Handle<Object> key, |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 428 | ICMissMode force_generic); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 429 | |
| 430 | // Code generator routines. |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 431 | static void GenerateMiss(MacroAssembler* masm, ICMissMode force_generic); |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 432 | static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 433 | static void GenerateInitialize(MacroAssembler* masm) { |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 434 | GenerateMiss(masm, MISS); |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 435 | } |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 436 | static void GeneratePreMonomorphic(MacroAssembler* masm) { |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 437 | GenerateMiss(masm, MISS); |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 438 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 439 | static void GenerateGeneric(MacroAssembler* masm); |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 440 | static void GenerateString(MacroAssembler* masm); |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 441 | static void GenerateIndexedInterceptor(MacroAssembler* masm); |
whesse@chromium.org | 7b26015 | 2011-06-20 15:33:18 +0000 | [diff] [blame] | 442 | static void GenerateNonStrictArguments(MacroAssembler* masm); |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 443 | |
kasperl@chromium.org | eac059f | 2010-01-25 11:02:06 +0000 | [diff] [blame] | 444 | // Bit mask to be tested against bit field for the cases when |
| 445 | // generic stub should go into slow case. |
| 446 | // Access check is necessary explicitly since generic stub does not perform |
| 447 | // map checks. |
| 448 | static const int kSlowCaseBitFieldMask = |
| 449 | (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); |
| 450 | |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 451 | protected: |
| 452 | virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; } |
| 453 | |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 454 | Handle<Code> LoadElementStub(Handle<JSObject> receiver); |
| 455 | |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 456 | virtual Handle<Code> megamorphic_stub() { |
| 457 | return isolate()->builtins()->KeyedLoadIC_Generic(); |
| 458 | } |
| 459 | virtual Handle<Code> generic_stub() const { |
| 460 | return isolate()->builtins()->KeyedLoadIC_Generic(); |
| 461 | } |
| 462 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 463 | // Update the inline cache. |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame^] | 464 | virtual void UpdateMonomorphicIC(Handle<JSObject> receiver, |
| 465 | Handle<Code> handler, |
| 466 | Handle<String> name); |
| 467 | virtual Handle<Code> ComputeLoadHandler(LookupResult* lookup, |
| 468 | Handle<JSObject> receiver, |
| 469 | Handle<String> name); |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 470 | virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code) { } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 471 | |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 472 | private: |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 473 | // Stub accessors. |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 474 | static Handle<Code> initialize_stub() { |
| 475 | return Isolate::Current()->builtins()->KeyedLoadIC_Initialize(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 476 | } |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 477 | virtual Handle<Code> pre_monomorphic_stub() { |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 478 | return isolate()->builtins()->KeyedLoadIC_PreMonomorphic(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 479 | } |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 480 | Handle<Code> indexed_interceptor_stub() { |
| 481 | return isolate()->builtins()->KeyedLoadIC_IndexedInterceptor(); |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 482 | } |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 483 | Handle<Code> non_strict_arguments_stub() { |
| 484 | return isolate()->builtins()->KeyedLoadIC_NonStrictArguments(); |
whesse@chromium.org | 7b26015 | 2011-06-20 15:33:18 +0000 | [diff] [blame] | 485 | } |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 486 | Handle<Code> string_stub() { |
| 487 | return isolate()->builtins()->KeyedLoadIC_String(); |
| 488 | } |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 489 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 490 | static void Clear(Address address, Code* target); |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 491 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 492 | friend class IC; |
| 493 | }; |
| 494 | |
| 495 | |
| 496 | class StoreIC: public IC { |
| 497 | public: |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 498 | explicit StoreIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 499 | ASSERT(target()->is_store_stub() || target()->is_keyed_store_stub()); |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 500 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 501 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 502 | // Code generators for stub routines. Only called once at startup. |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 503 | static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 504 | static void GenerateMiss(MacroAssembler* masm); |
sgjesse@chromium.org | 496c03a | 2011-02-14 12:05:43 +0000 | [diff] [blame] | 505 | static void GenerateMegamorphic(MacroAssembler* masm, |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 506 | StrictModeFlag strict_mode); |
kmillikin@chromium.org | 69ea396 | 2010-07-05 11:01:40 +0000 | [diff] [blame] | 507 | static void GenerateNormal(MacroAssembler* masm); |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 508 | static void GenerateGlobalProxy(MacroAssembler* masm, |
| 509 | StrictModeFlag strict_mode); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 510 | |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 511 | MUST_USE_RESULT MaybeObject* Store( |
| 512 | State state, |
| 513 | StrictModeFlag strict_mode, |
| 514 | Handle<Object> object, |
| 515 | Handle<String> name, |
| 516 | Handle<Object> value, |
| 517 | JSReceiver::StoreFromKeyed store_mode = |
| 518 | JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED); |
| 519 | |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 520 | protected: |
| 521 | virtual Code::Kind kind() const { return Code::STORE_IC; } |
| 522 | virtual Handle<Code> megamorphic_stub() { |
| 523 | return isolate()->builtins()->StoreIC_Megamorphic(); |
| 524 | } |
| 525 | // Stub accessors. |
| 526 | virtual Handle<Code> megamorphic_stub_strict() { |
| 527 | return isolate()->builtins()->StoreIC_Megamorphic_Strict(); |
| 528 | } |
| 529 | virtual Handle<Code> global_proxy_stub() { |
| 530 | return isolate()->builtins()->StoreIC_GlobalProxy(); |
| 531 | } |
| 532 | virtual Handle<Code> global_proxy_stub_strict() { |
| 533 | return isolate()->builtins()->StoreIC_GlobalProxy_Strict(); |
| 534 | } |
| 535 | |
| 536 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 537 | // Update the inline cache and the global stub cache based on the |
| 538 | // lookup result. |
mvstanton@chromium.org | d16d853 | 2013-01-25 13:29:10 +0000 | [diff] [blame] | 539 | void UpdateCaches(LookupResult* lookup, |
| 540 | State state, |
| 541 | StrictModeFlag strict_mode, |
| 542 | Handle<JSObject> receiver, |
| 543 | Handle<String> name, |
| 544 | Handle<Object> value); |
| 545 | // Compute the code stub for this store; used for rewriting to |
| 546 | // monomorphic state and making sure that the code stub is in the |
| 547 | // stub cache. |
| 548 | virtual Handle<Code> ComputeStoreMonomorphic(LookupResult* lookup, |
| 549 | StrictModeFlag strict_mode, |
| 550 | Handle<JSObject> receiver, |
| 551 | Handle<String> name); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 552 | |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 553 | private: |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 554 | void set_target(Code* code) { |
| 555 | // Strict mode must be preserved across IC patching. |
ulan@chromium.org | 65a89c2 | 2012-02-14 11:46:07 +0000 | [diff] [blame] | 556 | ASSERT(Code::GetStrictMode(code->extra_ic_state()) == |
| 557 | Code::GetStrictMode(target()->extra_ic_state())); |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 558 | IC::set_target(code); |
| 559 | } |
| 560 | |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 561 | static Handle<Code> initialize_stub() { |
| 562 | return Isolate::Current()->builtins()->StoreIC_Initialize(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 563 | } |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 564 | static Handle<Code> initialize_stub_strict() { |
| 565 | return Isolate::Current()->builtins()->StoreIC_Initialize_Strict(); |
sgjesse@chromium.org | 496c03a | 2011-02-14 12:05:43 +0000 | [diff] [blame] | 566 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 567 | static void Clear(Address address, Code* target); |
fschneider@chromium.org | ed78ffd | 2010-07-21 11:05:19 +0000 | [diff] [blame] | 568 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 569 | friend class IC; |
| 570 | }; |
| 571 | |
| 572 | |
verwaest@chromium.org | 33e09c8 | 2012-10-10 17:07:22 +0000 | [diff] [blame] | 573 | enum KeyedStoreCheckMap { |
| 574 | kDontCheckMap, |
| 575 | kCheckMap |
| 576 | }; |
| 577 | |
| 578 | |
| 579 | enum KeyedStoreIncrementLength { |
| 580 | kDontIncrementLength, |
| 581 | kIncrementLength |
| 582 | }; |
| 583 | |
| 584 | |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 585 | class KeyedStoreIC: public StoreIC { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 586 | public: |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 587 | enum StubKind { |
| 588 | STORE_NO_TRANSITION, |
| 589 | STORE_TRANSITION_SMI_TO_OBJECT, |
| 590 | STORE_TRANSITION_SMI_TO_DOUBLE, |
| 591 | STORE_TRANSITION_DOUBLE_TO_OBJECT, |
| 592 | STORE_TRANSITION_HOLEY_SMI_TO_OBJECT, |
| 593 | STORE_TRANSITION_HOLEY_SMI_TO_DOUBLE, |
| 594 | STORE_TRANSITION_HOLEY_DOUBLE_TO_OBJECT, |
| 595 | STORE_AND_GROW_NO_TRANSITION, |
| 596 | STORE_AND_GROW_TRANSITION_SMI_TO_OBJECT, |
| 597 | STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE, |
| 598 | STORE_AND_GROW_TRANSITION_DOUBLE_TO_OBJECT, |
| 599 | STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_OBJECT, |
| 600 | STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_DOUBLE, |
| 601 | STORE_AND_GROW_TRANSITION_HOLEY_DOUBLE_TO_OBJECT |
| 602 | }; |
| 603 | |
| 604 | static const int kGrowICDelta = STORE_AND_GROW_NO_TRANSITION - |
| 605 | STORE_NO_TRANSITION; |
| 606 | STATIC_ASSERT(kGrowICDelta == |
| 607 | STORE_AND_GROW_TRANSITION_SMI_TO_OBJECT - |
| 608 | STORE_TRANSITION_SMI_TO_OBJECT); |
| 609 | STATIC_ASSERT(kGrowICDelta == |
| 610 | STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE - |
| 611 | STORE_TRANSITION_SMI_TO_DOUBLE); |
| 612 | STATIC_ASSERT(kGrowICDelta == |
| 613 | STORE_AND_GROW_TRANSITION_DOUBLE_TO_OBJECT - |
| 614 | STORE_TRANSITION_DOUBLE_TO_OBJECT); |
| 615 | |
| 616 | static inline StubKind GetGrowStubKind(StubKind stub_kind) { |
| 617 | if (stub_kind < STORE_AND_GROW_NO_TRANSITION) { |
| 618 | stub_kind = static_cast<StubKind>(static_cast<int>(stub_kind) + |
| 619 | kGrowICDelta); |
| 620 | } |
| 621 | return stub_kind; |
| 622 | } |
| 623 | |
| 624 | explicit KeyedStoreIC(Isolate* isolate) : StoreIC(isolate) { |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 625 | ASSERT(target()->is_keyed_store_stub()); |
| 626 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 627 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 628 | MUST_USE_RESULT MaybeObject* Store(State state, |
verwaest@chromium.org | 33e09c8 | 2012-10-10 17:07:22 +0000 | [diff] [blame] | 629 | StrictModeFlag strict_mode, |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 630 | Handle<Object> object, |
| 631 | Handle<Object> name, |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 632 | Handle<Object> value, |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 633 | ICMissMode force_generic); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 634 | |
| 635 | // Code generators for stub routines. Only called once at startup. |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 636 | static void GenerateInitialize(MacroAssembler* masm) { |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 637 | GenerateMiss(masm, MISS); |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 638 | } |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 639 | static void GenerateMiss(MacroAssembler* masm, ICMissMode force_generic); |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 640 | static void GenerateSlow(MacroAssembler* masm); |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 641 | static void GenerateRuntimeSetProperty(MacroAssembler* masm, |
| 642 | StrictModeFlag strict_mode); |
| 643 | static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); |
whesse@chromium.org | 7b26015 | 2011-06-20 15:33:18 +0000 | [diff] [blame] | 644 | static void GenerateNonStrictArguments(MacroAssembler* masm); |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 645 | static void GenerateTransitionElementsSmiToDouble(MacroAssembler* masm); |
| 646 | static void GenerateTransitionElementsDoubleToObject(MacroAssembler* masm); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 647 | |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 648 | protected: |
| 649 | virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } |
| 650 | |
mvstanton@chromium.org | d16d853 | 2013-01-25 13:29:10 +0000 | [diff] [blame] | 651 | virtual Handle<Code> ComputeStoreMonomorphic(LookupResult* lookup, |
| 652 | StrictModeFlag strict_mode, |
| 653 | Handle<JSObject> receiver, |
| 654 | Handle<String> name); |
| 655 | virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code) { } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 656 | |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 657 | virtual Handle<Code> megamorphic_stub() { |
| 658 | return isolate()->builtins()->KeyedStoreIC_Generic(); |
| 659 | } |
| 660 | virtual Handle<Code> megamorphic_stub_strict() { |
| 661 | return isolate()->builtins()->KeyedStoreIC_Generic_Strict(); |
| 662 | } |
| 663 | |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 664 | Handle<Code> StoreElementStub(Handle<JSObject> receiver, |
| 665 | StubKind stub_kind, |
| 666 | StrictModeFlag strict_mode); |
| 667 | |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 668 | private: |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 669 | void set_target(Code* code) { |
| 670 | // Strict mode must be preserved across IC patching. |
ulan@chromium.org | 65a89c2 | 2012-02-14 11:46:07 +0000 | [diff] [blame] | 671 | ASSERT(Code::GetStrictMode(code->extra_ic_state()) == |
| 672 | Code::GetStrictMode(target()->extra_ic_state())); |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 673 | IC::set_target(code); |
| 674 | } |
| 675 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 676 | // Stub accessors. |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 677 | static Handle<Code> initialize_stub() { |
| 678 | return Isolate::Current()->builtins()->KeyedStoreIC_Initialize(); |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 679 | } |
mvstanton@chromium.org | 6bec009 | 2013-01-23 13:46:53 +0000 | [diff] [blame] | 680 | static Handle<Code> initialize_stub_strict() { |
| 681 | return Isolate::Current()->builtins()->KeyedStoreIC_Initialize_Strict(); |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 682 | } |
ricow@chromium.org | 64e3a4b | 2011-12-13 08:07:27 +0000 | [diff] [blame] | 683 | Handle<Code> generic_stub() const { |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 684 | return isolate()->builtins()->KeyedStoreIC_Generic(); |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 685 | } |
ricow@chromium.org | 64e3a4b | 2011-12-13 08:07:27 +0000 | [diff] [blame] | 686 | Handle<Code> generic_stub_strict() const { |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 687 | return isolate()->builtins()->KeyedStoreIC_Generic_Strict(); |
| 688 | } |
| 689 | Handle<Code> non_strict_arguments_stub() { |
| 690 | return isolate()->builtins()->KeyedStoreIC_NonStrictArguments(); |
whesse@chromium.org | 7b26015 | 2011-06-20 15:33:18 +0000 | [diff] [blame] | 691 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 692 | |
| 693 | static void Clear(Address address, Code* target); |
ager@chromium.org | eadaf22 | 2009-06-16 09:43:10 +0000 | [diff] [blame] | 694 | |
ulan@chromium.org | 65a89c2 | 2012-02-14 11:46:07 +0000 | [diff] [blame] | 695 | StubKind GetStubKind(Handle<JSObject> receiver, |
| 696 | Handle<Object> key, |
| 697 | Handle<Object> value); |
| 698 | |
yangguo@chromium.org | 003650e | 2013-01-24 16:31:08 +0000 | [diff] [blame] | 699 | static bool IsTransitionStubKind(StubKind stub_kind) { |
| 700 | return stub_kind > STORE_NO_TRANSITION && |
| 701 | stub_kind != STORE_AND_GROW_NO_TRANSITION; |
| 702 | } |
| 703 | |
| 704 | static bool IsGrowStubKind(StubKind stub_kind) { |
| 705 | return stub_kind >= STORE_AND_GROW_NO_TRANSITION; |
| 706 | } |
| 707 | |
| 708 | static StubKind GetNoTransitionStubKind(StubKind stub_kind) { |
| 709 | if (!IsTransitionStubKind(stub_kind)) return stub_kind; |
| 710 | if (IsGrowStubKind(stub_kind)) return STORE_AND_GROW_NO_TRANSITION; |
| 711 | return STORE_NO_TRANSITION; |
| 712 | } |
| 713 | |
| 714 | Handle<Map> ComputeTransitionedMap(Handle<JSObject> receiver, |
| 715 | StubKind stub_kind); |
| 716 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 717 | friend class IC; |
| 718 | }; |
| 719 | |
| 720 | |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 721 | class UnaryOpIC: public IC { |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 722 | public: |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 723 | // sorted: increasingly more unspecific (ignoring UNINITIALIZED) |
| 724 | // TODO(svenpanne) Using enums+switch is an antipattern, use a class instead. |
| 725 | enum TypeInfo { |
| 726 | UNINITIALIZED, |
| 727 | SMI, |
hpayer@chromium.org | 8432c91 | 2013-02-28 15:55:26 +0000 | [diff] [blame] | 728 | NUMBER, |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 729 | GENERIC |
| 730 | }; |
| 731 | |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 732 | explicit UnaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 733 | |
| 734 | void patch(Code* code); |
| 735 | |
| 736 | static const char* GetName(TypeInfo type_info); |
| 737 | |
| 738 | static State ToState(TypeInfo type_info); |
| 739 | |
| 740 | static TypeInfo GetTypeInfo(Handle<Object> operand); |
| 741 | |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 742 | static TypeInfo ComputeNewType(TypeInfo type, TypeInfo previous); |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 743 | }; |
| 744 | |
| 745 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 746 | // Type Recording BinaryOpIC, that records the types of the inputs and outputs. |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 747 | class BinaryOpIC: public IC { |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 748 | public: |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 749 | enum TypeInfo { |
| 750 | UNINITIALIZED, |
| 751 | SMI, |
| 752 | INT32, |
hpayer@chromium.org | 8432c91 | 2013-02-28 15:55:26 +0000 | [diff] [blame] | 753 | NUMBER, |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 754 | ODDBALL, |
yangguo@chromium.org | fb37721 | 2012-11-16 14:43:43 +0000 | [diff] [blame] | 755 | STRING, // Only used for addition operation. |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 756 | GENERIC |
| 757 | }; |
| 758 | |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 759 | explicit BinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 760 | |
| 761 | void patch(Code* code); |
| 762 | |
| 763 | static const char* GetName(TypeInfo type_info); |
| 764 | |
| 765 | static State ToState(TypeInfo type_info); |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 766 | }; |
| 767 | |
| 768 | |
| 769 | class CompareIC: public IC { |
| 770 | public: |
hpayer@chromium.org | 8432c91 | 2013-02-28 15:55:26 +0000 | [diff] [blame] | 771 | // The type/state lattice is defined by the following inequations: |
| 772 | // UNINITIALIZED < ... |
| 773 | // ... < GENERIC |
| 774 | // SMI < NUMBER |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame^] | 775 | // INTERNALIZED_STRING < STRING |
hpayer@chromium.org | 8432c91 | 2013-02-28 15:55:26 +0000 | [diff] [blame] | 776 | // KNOWN_OBJECT < OBJECT |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 777 | enum State { |
| 778 | UNINITIALIZED, |
yangguo@chromium.org | fb37721 | 2012-11-16 14:43:43 +0000 | [diff] [blame] | 779 | SMI, |
hpayer@chromium.org | 8432c91 | 2013-02-28 15:55:26 +0000 | [diff] [blame] | 780 | NUMBER, |
yangguo@chromium.org | fb37721 | 2012-11-16 14:43:43 +0000 | [diff] [blame] | 781 | STRING, |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame^] | 782 | INTERNALIZED_STRING, |
| 783 | UNIQUE_NAME, // Symbol or InternalizedString |
hpayer@chromium.org | 8432c91 | 2013-02-28 15:55:26 +0000 | [diff] [blame] | 784 | OBJECT, // JSObject |
| 785 | KNOWN_OBJECT, // JSObject with specific map (faster check) |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 786 | GENERIC |
| 787 | }; |
| 788 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 789 | CompareIC(Isolate* isolate, Token::Value op) |
| 790 | : IC(EXTRA_CALL_FRAME, isolate), op_(op) { } |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 791 | |
| 792 | // Update the inline cache for the given operands. |
| 793 | void UpdateCaches(Handle<Object> x, Handle<Object> y); |
| 794 | |
yangguo@chromium.org | fb37721 | 2012-11-16 14:43:43 +0000 | [diff] [blame] | 795 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 796 | // Factory method for getting an uninitialized compare stub. |
hpayer@chromium.org | 8432c91 | 2013-02-28 15:55:26 +0000 | [diff] [blame] | 797 | static Handle<Code> GetUninitialized(Isolate* isolate, Token::Value op); |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 798 | |
| 799 | // Helper function for computing the condition for a compare operation. |
| 800 | static Condition ComputeCondition(Token::Value op); |
| 801 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 802 | static const char* GetStateName(State state); |
| 803 | |
| 804 | private: |
yangguo@chromium.org | fb37721 | 2012-11-16 14:43:43 +0000 | [diff] [blame] | 805 | static bool HasInlinedSmiCode(Address address); |
| 806 | |
| 807 | State TargetState(State old_state, |
| 808 | State old_left, |
| 809 | State old_right, |
| 810 | bool has_inlined_smi_code, |
| 811 | Handle<Object> x, |
| 812 | Handle<Object> y); |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 813 | |
| 814 | bool strict() const { return op_ == Token::EQ_STRICT; } |
| 815 | Condition GetCondition() const { return ComputeCondition(op_); } |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 816 | |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 817 | static Code* GetRawUninitialized(Token::Value op); |
| 818 | |
| 819 | static void Clear(Address address, Code* target); |
| 820 | |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 821 | Token::Value op_; |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 822 | |
| 823 | friend class IC; |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 824 | }; |
| 825 | |
ricow@chromium.org | 9fa0967 | 2011-07-25 11:05:35 +0000 | [diff] [blame] | 826 | |
| 827 | class ToBooleanIC: public IC { |
| 828 | public: |
| 829 | explicit ToBooleanIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } |
| 830 | |
| 831 | void patch(Code* code); |
| 832 | }; |
| 833 | |
| 834 | |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 835 | // Helper for BinaryOpIC and CompareIC. |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 836 | enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 837 | void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 838 | |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 839 | DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_Miss); |
mstarzinger@chromium.org | e3b8d0f | 2013-02-01 09:06:41 +0000 | [diff] [blame] | 840 | DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 841 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 842 | } } // namespace v8::internal |
| 843 | |
| 844 | #endif // V8_IC_H_ |