OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 Failure* TypeError(const char* type, | 158 Failure* TypeError(const char* type, |
159 Handle<Object> object, | 159 Handle<Object> object, |
160 Handle<Object> key); | 160 Handle<Object> key); |
161 Failure* ReferenceError(const char* type, Handle<String> name); | 161 Failure* ReferenceError(const char* type, Handle<String> name); |
162 | 162 |
163 // Access the target code for the given IC address. | 163 // Access the target code for the given IC address. |
164 static inline Code* GetTargetAtAddress(Address address); | 164 static inline Code* GetTargetAtAddress(Address address); |
165 static inline void SetTargetAtAddress(Address address, Code* target); | 165 static inline void SetTargetAtAddress(Address address, Code* target); |
166 static void PostPatching(Address address, Code* target, Code* old_target); | 166 static void PostPatching(Address address, Code* target, Code* old_target); |
167 | 167 |
168 virtual void UpdateMonomorphicIC(Handle<JSObject> receiver, | |
169 Handle<Code> handler, | |
170 Handle<String> name) { | |
Jakob Kummerow
2013/03/01 22:21:04
I find it slightly less than ideal that we have a
| |
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); | |
168 void PatchCache(State state, | 178 void PatchCache(State state, |
169 StrictModeFlag strict_mode, | 179 StrictModeFlag strict_mode, |
170 Handle<JSObject> receiver, | 180 Handle<JSObject> receiver, |
171 Handle<String> name, | 181 Handle<String> name, |
172 Handle<Code> code); | 182 Handle<Code> code); |
173 virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code); | 183 virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code); |
174 virtual Handle<Code> megamorphic_stub() { | 184 virtual Handle<Code> megamorphic_stub() { |
175 UNREACHABLE(); | 185 UNREACHABLE(); |
176 return Handle<Code>::null(); | 186 return Handle<Code>::null(); |
177 } | 187 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 virtual Handle<Code> megamorphic_stub() { | 380 virtual Handle<Code> megamorphic_stub() { |
371 return isolate()->builtins()->LoadIC_Megamorphic(); | 381 return isolate()->builtins()->LoadIC_Megamorphic(); |
372 } | 382 } |
373 | 383 |
374 // Update the inline cache and the global stub cache based on the | 384 // Update the inline cache and the global stub cache based on the |
375 // lookup result. | 385 // lookup result. |
376 void UpdateCaches(LookupResult* lookup, | 386 void UpdateCaches(LookupResult* lookup, |
377 State state, | 387 State state, |
378 Handle<Object> object, | 388 Handle<Object> object, |
379 Handle<String> name); | 389 Handle<String> name); |
380 virtual Handle<Code> ComputeLoadMonomorphic(LookupResult* lookup, | 390 virtual void UpdateMonomorphicIC(Handle<JSObject> receiver, |
381 Handle<JSObject> receiver, | 391 Handle<Code> handler, |
382 Handle<String> name); | 392 Handle<String> name); |
393 virtual Handle<Code> ComputeLoadHandler(LookupResult* lookup, | |
394 Handle<JSObject> receiver, | |
395 Handle<String> name); | |
383 | 396 |
384 private: | 397 private: |
385 // Stub accessors. | 398 // Stub accessors. |
386 static Handle<Code> initialize_stub() { | 399 static Handle<Code> initialize_stub() { |
387 return Isolate::Current()->builtins()->LoadIC_Initialize(); | 400 return Isolate::Current()->builtins()->LoadIC_Initialize(); |
388 } | 401 } |
389 virtual Handle<Code> pre_monomorphic_stub() { | 402 virtual Handle<Code> pre_monomorphic_stub() { |
390 return isolate()->builtins()->LoadIC_PreMonomorphic(); | 403 return isolate()->builtins()->LoadIC_PreMonomorphic(); |
391 } | 404 } |
392 | 405 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
441 Handle<Code> LoadElementStub(Handle<JSObject> receiver); | 454 Handle<Code> LoadElementStub(Handle<JSObject> receiver); |
442 | 455 |
443 virtual Handle<Code> megamorphic_stub() { | 456 virtual Handle<Code> megamorphic_stub() { |
444 return isolate()->builtins()->KeyedLoadIC_Generic(); | 457 return isolate()->builtins()->KeyedLoadIC_Generic(); |
445 } | 458 } |
446 virtual Handle<Code> generic_stub() const { | 459 virtual Handle<Code> generic_stub() const { |
447 return isolate()->builtins()->KeyedLoadIC_Generic(); | 460 return isolate()->builtins()->KeyedLoadIC_Generic(); |
448 } | 461 } |
449 | 462 |
450 // Update the inline cache. | 463 // Update the inline cache. |
451 virtual Handle<Code> ComputeLoadMonomorphic(LookupResult* lookup, | 464 virtual void UpdateMonomorphicIC(Handle<JSObject> receiver, |
452 Handle<JSObject> receiver, | 465 Handle<Code> handler, |
453 Handle<String> name); | 466 Handle<String> name); |
467 virtual Handle<Code> ComputeLoadHandler(LookupResult* lookup, | |
468 Handle<JSObject> receiver, | |
469 Handle<String> name); | |
454 virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code) { } | 470 virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code) { } |
455 | 471 |
456 private: | 472 private: |
457 // Stub accessors. | 473 // Stub accessors. |
458 static Handle<Code> initialize_stub() { | 474 static Handle<Code> initialize_stub() { |
459 return Isolate::Current()->builtins()->KeyedLoadIC_Initialize(); | 475 return Isolate::Current()->builtins()->KeyedLoadIC_Initialize(); |
460 } | 476 } |
461 virtual Handle<Code> pre_monomorphic_stub() { | 477 virtual Handle<Code> pre_monomorphic_stub() { |
462 return isolate()->builtins()->KeyedLoadIC_PreMonomorphic(); | 478 return isolate()->builtins()->KeyedLoadIC_PreMonomorphic(); |
463 } | 479 } |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
812 // Helper for BinaryOpIC and CompareIC. | 828 // Helper for BinaryOpIC and CompareIC. |
813 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 829 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
814 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); | 830 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); |
815 | 831 |
816 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_Miss); | 832 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_Miss); |
817 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); | 833 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); |
818 | 834 |
819 } } // namespace v8::internal | 835 } } // namespace v8::internal |
820 | 836 |
821 #endif // V8_IC_H_ | 837 #endif // V8_IC_H_ |
OLD | NEW |