| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 for (int i = 0; i < target_maps_.length(); i++) { | 216 for (int i = 0; i < target_maps_.length(); i++) { |
| 217 list->Add(MapToType<HeapType>(target_maps_.at(i), isolate_)); | 217 list->Add(MapToType<HeapType>(target_maps_.at(i), isolate_)); |
| 218 } | 218 } |
| 219 } | 219 } |
| 220 | 220 |
| 221 Map* FirstTargetMap() { | 221 Map* FirstTargetMap() { |
| 222 FindTargetMaps(); | 222 FindTargetMaps(); |
| 223 return target_maps_.length() > 0 ? *target_maps_.at(0) : NULL; | 223 return target_maps_.length() > 0 ? *target_maps_.at(0) : NULL; |
| 224 } | 224 } |
| 225 | 225 |
| 226 protected: | |
| 227 inline void UpdateTarget(); | 226 inline void UpdateTarget(); |
| 228 | 227 |
| 229 private: | 228 private: |
| 230 inline Code* raw_target() const; | 229 inline Code* raw_target() const; |
| 231 inline ConstantPoolArray* constant_pool() const; | 230 inline ConstantPoolArray* constant_pool() const; |
| 232 inline ConstantPoolArray* raw_constant_pool() const; | 231 inline ConstantPoolArray* raw_constant_pool() const; |
| 233 | 232 |
| 234 void FindTargetMaps() { | 233 void FindTargetMaps() { |
| 235 if (target_maps_set_) return; | 234 if (target_maps_set_) return; |
| 236 target_maps_set_ = true; | 235 target_maps_set_ = true; |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 friend class IC; | 518 friend class IC; |
| 520 }; | 519 }; |
| 521 | 520 |
| 522 | 521 |
| 523 enum KeyedStoreCheckMap { kDontCheckMap, kCheckMap }; | 522 enum KeyedStoreCheckMap { kDontCheckMap, kCheckMap }; |
| 524 | 523 |
| 525 | 524 |
| 526 enum KeyedStoreIncrementLength { kDontIncrementLength, kIncrementLength }; | 525 enum KeyedStoreIncrementLength { kDontIncrementLength, kIncrementLength }; |
| 527 | 526 |
| 528 | 527 |
| 528 enum KeyedStoreStubCacheRequirement { |
| 529 kCallRuntimeOnMissingHandler, |
| 530 kMissOnMissingHandler |
| 531 }; |
| 532 |
| 533 |
| 529 class KeyedStoreIC : public StoreIC { | 534 class KeyedStoreIC : public StoreIC { |
| 530 public: | 535 public: |
| 531 // ExtraICState bits (building on IC) | 536 // ExtraICState bits (building on IC) |
| 532 // ExtraICState bits | 537 // ExtraICState bits |
| 533 class ExtraICStateKeyedAccessStoreMode | 538 class ExtraICStateKeyedAccessStoreMode |
| 534 : public BitField<KeyedAccessStoreMode, 2, 4> {}; // NOLINT | 539 : public BitField<KeyedAccessStoreMode, 2, 4> {}; // NOLINT |
| 535 | 540 |
| 536 static ExtraICState ComputeExtraICState(StrictMode flag, | 541 static ExtraICState ComputeExtraICState(StrictMode flag, |
| 537 KeyedAccessStoreMode mode) { | 542 KeyedAccessStoreMode mode) { |
| 538 return StrictModeState::encode(flag) | | 543 return StrictModeState::encode(flag) | |
| (...skipping 13 matching lines...) Expand all Loading... |
| 552 Handle<Object> name, | 557 Handle<Object> name, |
| 553 Handle<Object> value); | 558 Handle<Object> value); |
| 554 | 559 |
| 555 // Code generators for stub routines. Only called once at startup. | 560 // Code generators for stub routines. Only called once at startup. |
| 556 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 561 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
| 557 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 562 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
| 558 GenerateMiss(masm); | 563 GenerateMiss(masm); |
| 559 } | 564 } |
| 560 static void GenerateMiss(MacroAssembler* masm); | 565 static void GenerateMiss(MacroAssembler* masm); |
| 561 static void GenerateSlow(MacroAssembler* masm); | 566 static void GenerateSlow(MacroAssembler* masm); |
| 562 static void GenerateGeneric(MacroAssembler* masm, StrictMode strict_mode); | 567 static void GenerateGeneric( |
| 568 MacroAssembler* masm, StrictMode strict_mode, |
| 569 KeyedStoreStubCacheRequirement handler_requirement); |
| 563 static void GenerateSloppyArguments(MacroAssembler* masm); | 570 static void GenerateSloppyArguments(MacroAssembler* masm); |
| 564 | 571 |
| 565 protected: | 572 protected: |
| 566 virtual Handle<Code> pre_monomorphic_stub() const { | 573 virtual Handle<Code> pre_monomorphic_stub() const { |
| 567 return pre_monomorphic_stub(isolate(), strict_mode()); | 574 return pre_monomorphic_stub(isolate(), strict_mode()); |
| 568 } | 575 } |
| 569 static Handle<Code> pre_monomorphic_stub(Isolate* isolate, | 576 static Handle<Code> pre_monomorphic_stub(Isolate* isolate, |
| 570 StrictMode strict_mode) { | 577 StrictMode strict_mode) { |
| 571 if (strict_mode == STRICT) { | 578 if (strict_mode == STRICT) { |
| 572 return isolate->builtins()->KeyedStoreIC_PreMonomorphic_Strict(); | 579 return isolate->builtins()->KeyedStoreIC_PreMonomorphic_Strict(); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 | 695 |
| 689 // Support functions for interceptor handlers. | 696 // Support functions for interceptor handlers. |
| 690 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); | 697 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); |
| 691 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); | 698 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); |
| 692 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); | 699 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); |
| 693 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); | 700 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); |
| 694 } | 701 } |
| 695 } // namespace v8::internal | 702 } // namespace v8::internal |
| 696 | 703 |
| 697 #endif // V8_IC_H_ | 704 #endif // V8_IC_H_ |
| OLD | NEW |