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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, | 480 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, |
481 Handle<Object> key); | 481 Handle<Object> key); |
482 | 482 |
483 // Code generator routines. | 483 // Code generator routines. |
484 static void GenerateMiss(MacroAssembler* masm); | 484 static void GenerateMiss(MacroAssembler* masm); |
485 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 485 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
486 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 486 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
487 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 487 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
488 GenerateMiss(masm); | 488 GenerateMiss(masm); |
489 } | 489 } |
490 static void GenerateGeneric(MacroAssembler* masm); | 490 static void GenerateMegamorphic(MacroAssembler* masm); |
491 | 491 |
492 // Bit mask to be tested against bit field for the cases when | 492 // Bit mask to be tested against bit field for the cases when |
493 // generic stub should go into slow case. | 493 // generic stub should go into slow case. |
494 // Access check is necessary explicitly since generic stub does not perform | 494 // Access check is necessary explicitly since generic stub does not perform |
495 // map checks. | 495 // map checks. |
496 static const int kSlowCaseBitFieldMask = | 496 static const int kSlowCaseBitFieldMask = |
497 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); | 497 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); |
498 | 498 |
499 static Handle<Code> initialize_stub(Isolate* isolate); | 499 static Handle<Code> initialize_stub(Isolate* isolate); |
500 static Handle<Code> initialize_stub_in_optimized_code(Isolate* isolate); | 500 static Handle<Code> initialize_stub_in_optimized_code(Isolate* isolate); |
501 static Handle<Code> generic_stub(Isolate* isolate); | 501 static Handle<Code> megamorphic_stub(Isolate* isolate); |
502 static Handle<Code> pre_monomorphic_stub(Isolate* isolate); | 502 static Handle<Code> pre_monomorphic_stub(Isolate* isolate); |
503 | 503 |
504 static void Clear(Isolate* isolate, Code* host, KeyedLoadICNexus* nexus); | 504 static void Clear(Isolate* isolate, Code* host, KeyedLoadICNexus* nexus); |
505 | 505 |
506 protected: | 506 protected: |
507 // receiver is HeapObject because it could be a String or a JSObject | 507 // receiver is HeapObject because it could be a String or a JSObject |
508 Handle<Code> LoadElementStub(Handle<HeapObject> receiver); | 508 Handle<Code> LoadElementStub(Handle<HeapObject> receiver); |
509 virtual Handle<Code> pre_monomorphic_stub() const { | 509 virtual Handle<Code> pre_monomorphic_stub() const { |
510 return pre_monomorphic_stub(isolate()); | 510 return pre_monomorphic_stub(isolate()); |
511 } | 511 } |
512 | 512 |
513 private: | 513 private: |
514 Handle<Code> generic_stub() const { return generic_stub(isolate()); } | |
515 | |
516 static void Clear(Isolate* isolate, Address address, Code* target, | 514 static void Clear(Isolate* isolate, Address address, Code* target, |
517 ConstantPoolArray* constant_pool); | 515 ConstantPoolArray* constant_pool); |
518 | 516 |
519 friend class IC; | 517 friend class IC; |
520 }; | 518 }; |
521 | 519 |
522 | 520 |
523 class StoreIC : public IC { | 521 class StoreIC : public IC { |
524 public: | 522 public: |
525 class StrictModeState : public BitField<StrictMode, 1, 1> {}; | 523 class StrictModeState : public BitField<StrictMode, 1, 1> {}; |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 | 766 |
769 // Support functions for interceptor handlers. | 767 // Support functions for interceptor handlers. |
770 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); | 768 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); |
771 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); | 769 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); |
772 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); | 770 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); |
773 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); | 771 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); |
774 } | 772 } |
775 } // namespace v8::internal | 773 } // namespace v8::internal |
776 | 774 |
777 #endif // V8_IC_H_ | 775 #endif // V8_IC_H_ |
OLD | NEW |