Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: src/ic/ic.h

Issue 584043002: Add MEGAMORPHIC state support for KeyedStoreIC (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased for landing Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ic/ia32/ic-ia32.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 694
688 // Support functions for interceptor handlers. 695 // Support functions for interceptor handlers.
689 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); 696 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly);
690 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); 697 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor);
691 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); 698 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor);
692 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); 699 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor);
693 } 700 }
694 } // namespace v8::internal 701 } // namespace v8::internal
695 702
696 #endif // V8_IC_H_ 703 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/ic/ia32/ic-ia32.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698