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

Side by Side Diff: src/stub-cache.h

Issue 12451003: Make IC patching resilient to flushing of the original target() ic. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 9 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/objects-inl.h ('k') | src/stub-cache.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 Name* key; 70 Name* key;
71 Code* value; 71 Code* value;
72 Map* map; 72 Map* map;
73 }; 73 };
74 74
75 void Initialize(); 75 void Initialize();
76 76
77 Handle<JSObject> StubHolder(Handle<JSObject> receiver, 77 Handle<JSObject> StubHolder(Handle<JSObject> receiver,
78 Handle<JSObject> holder); 78 Handle<JSObject> holder);
79 79
80 Handle<Code> FindIC(Handle<Name> name,
81 Handle<JSObject> stub_holder,
82 Code::Kind kind,
83 Code::StubType type);
84
80 Handle<Code> FindStub(Handle<Name> name, 85 Handle<Code> FindStub(Handle<Name> name,
81 Handle<JSObject> stub_holder, 86 Handle<JSObject> stub_holder,
82 Code::Kind kind, 87 Code::Kind kind,
83 Code::StubType type, 88 Code::StubType type);
84 Code::IcFragment fragment);
85
86 Handle<Code> FindHandler(Handle<Name> name,
87 Handle<JSObject> stub_holder,
88 Code::Kind kind,
89 Code::StubType type);
90 89
91 Handle<Code> ComputeMonomorphicIC(Handle<JSObject> receiver, 90 Handle<Code> ComputeMonomorphicIC(Handle<JSObject> receiver,
92 Handle<Code> handler, 91 Handle<Code> handler,
93 Handle<Name> name); 92 Handle<Name> name);
94 Handle<Code> ComputeKeyedMonomorphicIC(Handle<JSObject> receiver, 93 Handle<Code> ComputeKeyedMonomorphicIC(Handle<JSObject> receiver,
95 Handle<Code> handler, 94 Handle<Code> handler,
96 Handle<Name> name); 95 Handle<Name> name);
97 96
98 // Computes the right stub matching. Inserts the result in the 97 // Computes the right stub matching. Inserts the result in the
99 // cache before returning. This might compile a stub if needed. 98 // cache before returning. This might compile a stub if needed.
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 void GenerateLoadInterceptor(Register holder_reg, 658 void GenerateLoadInterceptor(Register holder_reg,
660 Handle<JSObject> object, 659 Handle<JSObject> object,
661 Handle<JSObject> holder, 660 Handle<JSObject> holder,
662 LookupResult* lookup, 661 LookupResult* lookup,
663 Handle<Name> name); 662 Handle<Name> name);
664 void GenerateLoadPostInterceptor(Register reg, 663 void GenerateLoadPostInterceptor(Register reg,
665 Handle<JSObject> interceptor_holder, 664 Handle<JSObject> interceptor_holder,
666 Handle<Name> name, 665 Handle<Name> name,
667 LookupResult* lookup); 666 LookupResult* lookup);
668 667
669 Handle<Code> GetCode(Code::IcFragment fragment, 668 Handle<Code> GetICCode(Code::Kind kind,
669 Code::StubType type,
670 Handle<Name> name,
671 InlineCacheState state = MONOMORPHIC);
672
673 Handle<Code> GetCode(Code::Kind kind,
670 Code::StubType type, 674 Code::StubType type,
671 Handle<Name> name, 675 Handle<Name> name);
672 InlineCacheState state = MONOMORPHIC);
673 676
674 Register receiver() { return registers_[0]; } 677 Register receiver() { return registers_[0]; }
675 Register name() { return registers_[1]; } 678 Register name() { return registers_[1]; }
676 Register scratch1() { return registers_[2]; } 679 Register scratch1() { return registers_[2]; }
677 Register scratch2() { return registers_[3]; } 680 Register scratch2() { return registers_[3]; }
678 Register scratch3() { return registers_[4]; } 681 Register scratch3() { return registers_[4]; }
679 Register scratch4() { return registers_[5]; } 682 Register scratch4() { return registers_[5]; }
680 683
681 private: 684 private:
682 virtual Code::Kind kind() = 0; 685 virtual Code::Kind kind() = 0;
(...skipping 29 matching lines...) Expand all
712 Handle<JSGlobalPropertyCell> cell, 715 Handle<JSGlobalPropertyCell> cell,
713 Handle<Name> name, 716 Handle<Name> name,
714 bool is_dont_delete); 717 bool is_dont_delete);
715 718
716 static Register receiver() { return registers()[0]; } 719 static Register receiver() { return registers()[0]; }
717 720
718 private: 721 private:
719 static Register* registers(); 722 static Register* registers();
720 virtual Code::Kind kind() { return Code::LOAD_IC; } 723 virtual Code::Kind kind() { return Code::LOAD_IC; }
721 virtual Logger::LogEventsAndTags log_kind(Handle<Code> code) { 724 virtual Logger::LogEventsAndTags log_kind(Handle<Code> code) {
725 if (!code->is_inline_cache_stub()) return Logger::STUB_TAG;
722 return code->ic_state() == MONOMORPHIC 726 return code->ic_state() == MONOMORPHIC
723 ? Logger::LOAD_IC_TAG : Logger::LOAD_POLYMORPHIC_IC_TAG; 727 ? Logger::LOAD_IC_TAG : Logger::LOAD_POLYMORPHIC_IC_TAG;
724 } 728 }
725 virtual void JitEvent(Handle<Name> name, Handle<Code> code); 729 virtual void JitEvent(Handle<Name> name, Handle<Code> code);
726 }; 730 };
727 731
728 732
729 class KeyedLoadStubCompiler: public BaseLoadStubCompiler { 733 class KeyedLoadStubCompiler: public BaseLoadStubCompiler {
730 public: 734 public:
731 explicit KeyedLoadStubCompiler(Isolate* isolate) 735 explicit KeyedLoadStubCompiler(Isolate* isolate)
732 : BaseLoadStubCompiler(isolate, registers()) { } 736 : BaseLoadStubCompiler(isolate, registers()) { }
733 737
734 Handle<Code> CompileLoadElement(Handle<Map> receiver_map); 738 Handle<Code> CompileLoadElement(Handle<Map> receiver_map);
735 739
736 void CompileElementHandlers(MapHandleList* receiver_maps, 740 void CompileElementHandlers(MapHandleList* receiver_maps,
737 CodeHandleList* handlers); 741 CodeHandleList* handlers);
738 742
739 Handle<Code> CompileLoadElementPolymorphic(MapHandleList* receiver_maps); 743 Handle<Code> CompileLoadElementPolymorphic(MapHandleList* receiver_maps);
740 744
741 static void GenerateLoadDictionaryElement(MacroAssembler* masm); 745 static void GenerateLoadDictionaryElement(MacroAssembler* masm);
742 746
743 static Register receiver() { return registers()[0]; } 747 static Register receiver() { return registers()[0]; }
744 748
745 private: 749 private:
746 static Register* registers(); 750 static Register* registers();
747 virtual Code::Kind kind() { return Code::KEYED_LOAD_IC; } 751 virtual Code::Kind kind() { return Code::KEYED_LOAD_IC; }
748 virtual Logger::LogEventsAndTags log_kind(Handle<Code> code) { 752 virtual Logger::LogEventsAndTags log_kind(Handle<Code> code) {
753 if (!code->is_inline_cache_stub()) return Logger::STUB_TAG;
749 return code->ic_state() == MONOMORPHIC 754 return code->ic_state() == MONOMORPHIC
750 ? Logger::KEYED_LOAD_IC_TAG : Logger::KEYED_LOAD_POLYMORPHIC_IC_TAG; 755 ? Logger::KEYED_LOAD_IC_TAG : Logger::KEYED_LOAD_POLYMORPHIC_IC_TAG;
751 } 756 }
752 virtual void JitEvent(Handle<Name> name, Handle<Code> code); 757 virtual void JitEvent(Handle<Name> name, Handle<Code> code);
753 virtual void GenerateNameCheck(Handle<Name> name, 758 virtual void GenerateNameCheck(Handle<Name> name,
754 Register name_reg, 759 Register name_reg,
755 Label* miss); 760 Label* miss);
756 }; 761 };
757 762
758 763
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 Handle<JSFunction> constant_function_; 1008 Handle<JSFunction> constant_function_;
1004 bool is_simple_api_call_; 1009 bool is_simple_api_call_;
1005 Handle<FunctionTemplateInfo> expected_receiver_type_; 1010 Handle<FunctionTemplateInfo> expected_receiver_type_;
1006 Handle<CallHandlerInfo> api_call_info_; 1011 Handle<CallHandlerInfo> api_call_info_;
1007 }; 1012 };
1008 1013
1009 1014
1010 } } // namespace v8::internal 1015 } } // namespace v8::internal
1011 1016
1012 #endif // V8_STUB_CACHE_H_ 1017 #endif // V8_STUB_CACHE_H_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698