| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_IC_H_ | 5 #ifndef V8_IC_H_ |
| 6 #define V8_IC_H_ | 6 #define V8_IC_H_ |
| 7 | 7 |
| 8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
| 9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
| 10 | 10 |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 Handle<Object> key); | 443 Handle<Object> key); |
| 444 | 444 |
| 445 // Code generator routines. | 445 // Code generator routines. |
| 446 static void GenerateMiss(MacroAssembler* masm); | 446 static void GenerateMiss(MacroAssembler* masm); |
| 447 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 447 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
| 448 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 448 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
| 449 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 449 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
| 450 GenerateMiss(masm); | 450 GenerateMiss(masm); |
| 451 } | 451 } |
| 452 static void GenerateGeneric(MacroAssembler* masm); | 452 static void GenerateGeneric(MacroAssembler* masm); |
| 453 static void GenerateIndexedInterceptor(MacroAssembler* masm); |
| 453 | 454 |
| 454 // Bit mask to be tested against bit field for the cases when | 455 // Bit mask to be tested against bit field for the cases when |
| 455 // generic stub should go into slow case. | 456 // generic stub should go into slow case. |
| 456 // Access check is necessary explicitly since generic stub does not perform | 457 // Access check is necessary explicitly since generic stub does not perform |
| 457 // map checks. | 458 // map checks. |
| 458 static const int kSlowCaseBitFieldMask = | 459 static const int kSlowCaseBitFieldMask = |
| 459 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); | 460 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); |
| 460 | 461 |
| 461 static Handle<Code> initialize_stub(Isolate* isolate); | 462 static Handle<Code> initialize_stub(Isolate* isolate); |
| 462 static Handle<Code> initialize_stub_in_optimized_code(Isolate* isolate); | 463 static Handle<Code> initialize_stub_in_optimized_code(Isolate* isolate); |
| 463 static Handle<Code> generic_stub(Isolate* isolate); | 464 static Handle<Code> generic_stub(Isolate* isolate); |
| 464 static Handle<Code> pre_monomorphic_stub(Isolate* isolate); | 465 static Handle<Code> pre_monomorphic_stub(Isolate* isolate); |
| 465 | 466 |
| 466 protected: | 467 protected: |
| 467 // receiver is HeapObject because it could be a String or a JSObject | 468 // receiver is HeapObject because it could be a String or a JSObject |
| 468 Handle<Code> LoadElementStub(Handle<HeapObject> receiver); | 469 Handle<Code> LoadElementStub(Handle<HeapObject> receiver); |
| 469 virtual Handle<Code> pre_monomorphic_stub() const { | 470 virtual Handle<Code> pre_monomorphic_stub() const { |
| 470 return pre_monomorphic_stub(isolate()); | 471 return pre_monomorphic_stub(isolate()); |
| 471 } | 472 } |
| 472 | 473 |
| 473 private: | 474 private: |
| 474 Handle<Code> generic_stub() const { return generic_stub(isolate()); } | 475 Handle<Code> generic_stub() const { return generic_stub(isolate()); } |
| 476 Handle<Code> indexed_interceptor_stub() { |
| 477 return isolate()->builtins()->KeyedLoadIC_IndexedInterceptor(); |
| 478 } |
| 475 | 479 |
| 476 static void Clear(Isolate* isolate, Address address, Code* target, | 480 static void Clear(Isolate* isolate, Address address, Code* target, |
| 477 ConstantPoolArray* constant_pool); | 481 ConstantPoolArray* constant_pool); |
| 478 | 482 |
| 479 friend class IC; | 483 friend class IC; |
| 480 }; | 484 }; |
| 481 | 485 |
| 482 | 486 |
| 483 class StoreIC : public IC { | 487 class StoreIC : public IC { |
| 484 public: | 488 public: |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 | 736 |
| 733 // Support functions for interceptor handlers. | 737 // Support functions for interceptor handlers. |
| 734 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); | 738 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); |
| 735 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); | 739 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); |
| 736 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); | 740 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); |
| 737 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); | 741 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); |
| 738 } | 742 } |
| 739 } // namespace v8::internal | 743 } // namespace v8::internal |
| 740 | 744 |
| 741 #endif // V8_IC_H_ | 745 #endif // V8_IC_H_ |
| OLD | NEW |