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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
427 | 427 |
428 static void Clear(Isolate* isolate, Address address, Code* target, | 428 static void Clear(Isolate* isolate, Address address, Code* target, |
429 ConstantPoolArray* constant_pool); | 429 ConstantPoolArray* constant_pool); |
430 | 430 |
431 friend class IC; | 431 friend class IC; |
432 }; | 432 }; |
433 | 433 |
434 | 434 |
435 class KeyedLoadIC : public LoadIC { | 435 class KeyedLoadIC : public LoadIC { |
436 public: | 436 public: |
437 static ExtraICState ComputeExtraICState(IcCheckType key_type) { | |
438 return KeyedLoadICState(key_type).GetExtraICState(); | |
439 } | |
440 | |
441 IcCheckType GetKeyType() const { | |
442 return KeyedLoadICState::GetKeyType(extra_ic_state()); | |
443 } | |
444 | |
437 explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate) | 445 explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate) |
438 : LoadIC(depth, isolate) { | 446 : LoadIC(depth, isolate) { |
439 DCHECK(target()->is_keyed_load_stub()); | 447 DCHECK(target()->is_keyed_load_stub()); |
440 } | 448 } |
441 | 449 |
442 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, | 450 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, |
443 Handle<Object> key); | 451 Handle<Object> key); |
444 | 452 |
445 // Code generator routines. | 453 // Code generator routines. |
446 static void GenerateMiss(MacroAssembler* masm); | 454 static void GenerateMiss(MacroAssembler* masm); |
(...skipping 11 matching lines...) Expand all Loading... | |
458 static const int kSlowCaseBitFieldMask = | 466 static const int kSlowCaseBitFieldMask = |
459 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); | 467 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); |
460 | 468 |
461 static Handle<Code> initialize_stub(Isolate* isolate); | 469 static Handle<Code> initialize_stub(Isolate* isolate); |
462 static Handle<Code> initialize_stub_in_optimized_code(Isolate* isolate); | 470 static Handle<Code> initialize_stub_in_optimized_code(Isolate* isolate); |
463 static Handle<Code> generic_stub(Isolate* isolate); | 471 static Handle<Code> generic_stub(Isolate* isolate); |
464 static Handle<Code> pre_monomorphic_stub(Isolate* isolate); | 472 static Handle<Code> pre_monomorphic_stub(Isolate* isolate); |
465 | 473 |
466 protected: | 474 protected: |
467 // receiver is HeapObject because it could be a String or a JSObject | 475 // receiver is HeapObject because it could be a String or a JSObject |
468 Handle<Code> LoadElementStub(Handle<HeapObject> receiver); | 476 Handle<Code> LoadElementStub(Handle<HeapObject> receiver, |
477 Handle<Object> key); | |
469 virtual Handle<Code> pre_monomorphic_stub() const { | 478 virtual Handle<Code> pre_monomorphic_stub() const { |
470 return pre_monomorphic_stub(isolate()); | 479 return pre_monomorphic_stub(isolate()); |
471 } | 480 } |
472 | 481 |
473 private: | 482 private: |
483 inline void set_target(Code* code); | |
Jakob Kummerow
2014/12/10 15:21:18
Why do you need to override this? Can you explain
| |
474 Handle<Code> generic_stub() const { return generic_stub(isolate()); } | 484 Handle<Code> generic_stub() const { return generic_stub(isolate()); } |
475 | 485 |
476 static void Clear(Isolate* isolate, Address address, Code* target, | 486 static void Clear(Isolate* isolate, Address address, Code* target, |
477 ConstantPoolArray* constant_pool); | 487 ConstantPoolArray* constant_pool); |
478 | 488 |
479 friend class IC; | 489 friend class IC; |
480 }; | 490 }; |
481 | 491 |
482 | 492 |
483 class StoreIC : public IC { | 493 class StoreIC : public IC { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
732 | 742 |
733 // Support functions for interceptor handlers. | 743 // Support functions for interceptor handlers. |
734 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); | 744 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); |
735 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); | 745 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); |
736 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); | 746 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); |
737 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); | 747 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); |
738 } | 748 } |
739 } // namespace v8::internal | 749 } // namespace v8::internal |
740 | 750 |
741 #endif // V8_IC_H_ | 751 #endif // V8_IC_H_ |
OLD | NEW |