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

Side by Side Diff: src/ic.h

Issue 23442016: Add premonomorphic store ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment Created 7 years, 3 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/builtins.cc ('k') | src/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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 520
521 class StoreIC: public IC { 521 class StoreIC: public IC {
522 public: 522 public:
523 StoreIC(FrameDepth depth, Isolate* isolate) : IC(depth, isolate) { 523 StoreIC(FrameDepth depth, Isolate* isolate) : IC(depth, isolate) {
524 ASSERT(target()->is_store_stub() || target()->is_keyed_store_stub()); 524 ASSERT(target()->is_store_stub() || target()->is_keyed_store_stub());
525 } 525 }
526 526
527 // Code generators for stub routines. Only called once at startup. 527 // Code generators for stub routines. Only called once at startup.
528 static void GenerateSlow(MacroAssembler* masm); 528 static void GenerateSlow(MacroAssembler* masm);
529 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } 529 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
530 static void GeneratePreMonomorphic(MacroAssembler* masm) {
531 GenerateMiss(masm);
532 }
530 static void GenerateMiss(MacroAssembler* masm); 533 static void GenerateMiss(MacroAssembler* masm);
531 static void GenerateMegamorphic(MacroAssembler* masm, 534 static void GenerateMegamorphic(MacroAssembler* masm,
532 StrictModeFlag strict_mode); 535 StrictModeFlag strict_mode);
533 static void GenerateNormal(MacroAssembler* masm); 536 static void GenerateNormal(MacroAssembler* masm);
534 static void GenerateRuntimeSetProperty(MacroAssembler* masm, 537 static void GenerateRuntimeSetProperty(MacroAssembler* masm,
535 StrictModeFlag strict_mode); 538 StrictModeFlag strict_mode);
536 539
537 MUST_USE_RESULT MaybeObject* Store( 540 MUST_USE_RESULT MaybeObject* Store(
538 State state, 541 State state,
539 StrictModeFlag strict_mode, 542 StrictModeFlag strict_mode,
(...skipping 11 matching lines...) Expand all
551 // Stub accessors. 554 // Stub accessors.
552 virtual Handle<Code> megamorphic_stub_strict() { 555 virtual Handle<Code> megamorphic_stub_strict() {
553 return isolate()->builtins()->StoreIC_Megamorphic_Strict(); 556 return isolate()->builtins()->StoreIC_Megamorphic_Strict();
554 } 557 }
555 virtual Handle<Code> generic_stub() const { 558 virtual Handle<Code> generic_stub() const {
556 return isolate()->builtins()->StoreIC_Generic(); 559 return isolate()->builtins()->StoreIC_Generic();
557 } 560 }
558 virtual Handle<Code> generic_stub_strict() const { 561 virtual Handle<Code> generic_stub_strict() const {
559 return isolate()->builtins()->StoreIC_Generic_Strict(); 562 return isolate()->builtins()->StoreIC_Generic_Strict();
560 } 563 }
564 virtual Handle<Code> pre_monomorphic_stub() const {
565 return isolate()->builtins()->StoreIC_PreMonomorphic();
566 }
567 virtual Handle<Code> pre_monomorphic_stub_strict() const {
568 return isolate()->builtins()->StoreIC_PreMonomorphic_Strict();
569 }
561 virtual Handle<Code> global_proxy_stub() { 570 virtual Handle<Code> global_proxy_stub() {
562 return isolate()->builtins()->StoreIC_GlobalProxy(); 571 return isolate()->builtins()->StoreIC_GlobalProxy();
563 } 572 }
564 virtual Handle<Code> global_proxy_stub_strict() { 573 virtual Handle<Code> global_proxy_stub_strict() {
565 return isolate()->builtins()->StoreIC_GlobalProxy_Strict(); 574 return isolate()->builtins()->StoreIC_GlobalProxy_Strict();
566 } 575 }
567 576
568 virtual void UpdateMonomorphicIC(Handle<JSObject> receiver, 577 virtual void UpdateMonomorphicIC(Handle<JSObject> receiver,
569 Handle<Code> handler, 578 Handle<Code> handler,
570 Handle<String> name, 579 Handle<String> name,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 StrictModeFlag strict_mode, 645 StrictModeFlag strict_mode,
637 Handle<Object> object, 646 Handle<Object> object,
638 Handle<Object> name, 647 Handle<Object> name,
639 Handle<Object> value, 648 Handle<Object> value,
640 ICMissMode force_generic); 649 ICMissMode force_generic);
641 650
642 // Code generators for stub routines. Only called once at startup. 651 // Code generators for stub routines. Only called once at startup.
643 static void GenerateInitialize(MacroAssembler* masm) { 652 static void GenerateInitialize(MacroAssembler* masm) {
644 GenerateMiss(masm, MISS); 653 GenerateMiss(masm, MISS);
645 } 654 }
655 static void GeneratePreMonomorphic(MacroAssembler* masm) {
656 GenerateMiss(masm, MISS);
657 }
646 static void GenerateMiss(MacroAssembler* masm, ICMissMode force_generic); 658 static void GenerateMiss(MacroAssembler* masm, ICMissMode force_generic);
647 static void GenerateSlow(MacroAssembler* masm); 659 static void GenerateSlow(MacroAssembler* masm);
648 static void GenerateRuntimeSetProperty(MacroAssembler* masm, 660 static void GenerateRuntimeSetProperty(MacroAssembler* masm,
649 StrictModeFlag strict_mode); 661 StrictModeFlag strict_mode);
650 static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); 662 static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode);
651 static void GenerateNonStrictArguments(MacroAssembler* masm); 663 static void GenerateNonStrictArguments(MacroAssembler* masm);
652 664
653 protected: 665 protected:
654 virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } 666 virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; }
655 667
656 virtual Handle<Code> ComputeStoreMonomorphic(LookupResult* lookup, 668 virtual Handle<Code> ComputeStoreMonomorphic(LookupResult* lookup,
657 StrictModeFlag strict_mode, 669 StrictModeFlag strict_mode,
658 Handle<JSObject> receiver, 670 Handle<JSObject> receiver,
659 Handle<String> name, 671 Handle<String> name,
660 Handle<Object> value); 672 Handle<Object> value);
661 virtual void UpdateMegamorphicCache(Map* map, Name* name, Code* code) { } 673 virtual void UpdateMegamorphicCache(Map* map, Name* name, Code* code) { }
662 674
675 virtual Handle<Code> pre_monomorphic_stub() const {
676 return isolate()->builtins()->KeyedStoreIC_PreMonomorphic();
677 }
678 virtual Handle<Code> pre_monomorphic_stub_strict() const {
679 return isolate()->builtins()->KeyedStoreIC_PreMonomorphic_Strict();
680 }
663 virtual Handle<Code> megamorphic_stub() { 681 virtual Handle<Code> megamorphic_stub() {
664 return isolate()->builtins()->KeyedStoreIC_Generic(); 682 return isolate()->builtins()->KeyedStoreIC_Generic();
665 } 683 }
666 virtual Handle<Code> megamorphic_stub_strict() { 684 virtual Handle<Code> megamorphic_stub_strict() {
667 return isolate()->builtins()->KeyedStoreIC_Generic_Strict(); 685 return isolate()->builtins()->KeyedStoreIC_Generic_Strict();
668 } 686 }
669 687
670 Handle<Code> StoreElementStub(Handle<JSObject> receiver, 688 Handle<Code> StoreElementStub(Handle<JSObject> receiver,
671 KeyedAccessStoreMode store_mode, 689 KeyedAccessStoreMode store_mode,
672 StrictModeFlag strict_mode); 690 StrictModeFlag strict_mode);
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss); 867 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss);
850 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); 868 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure);
851 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); 869 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss);
852 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); 870 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss);
853 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); 871 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss);
854 872
855 873
856 } } // namespace v8::internal 874 } } // namespace v8::internal
857 875
858 #endif // V8_IC_H_ 876 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698