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

Side by Side Diff: src/ic.h

Issue 429053005: Avoid one repeated property lookup when computing load ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 4 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/ia32/stub-cache-ia32.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 // 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/macro-assembler.h" 8 #include "src/macro-assembler.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 // Access the target code for the given IC address. 173 // Access the target code for the given IC address.
174 static inline Code* GetTargetAtAddress(Address address, 174 static inline Code* GetTargetAtAddress(Address address,
175 ConstantPoolArray* constant_pool); 175 ConstantPoolArray* constant_pool);
176 static inline void SetTargetAtAddress(Address address, 176 static inline void SetTargetAtAddress(Address address,
177 Code* target, 177 Code* target,
178 ConstantPoolArray* constant_pool); 178 ConstantPoolArray* constant_pool);
179 static void PostPatching(Address address, Code* target, Code* old_target); 179 static void PostPatching(Address address, Code* target, Code* old_target);
180 180
181 // Compute the handler either by compiling or by retrieving a cached version. 181 // Compute the handler either by compiling or by retrieving a cached version.
182 Handle<Code> ComputeHandler(LookupResult* lookup, 182 Handle<Code> ComputeHandler(LookupIterator* lookup, Handle<Object> object,
183 Handle<Object> object,
184 Handle<String> name, 183 Handle<String> name,
185 Handle<Object> value = Handle<Code>::null()); 184 Handle<Object> value = Handle<Code>::null());
186 virtual Handle<Code> CompileHandler(LookupResult* lookup, 185 virtual Handle<Code> CompileHandler(LookupIterator* lookup,
187 Handle<Object> object, 186 Handle<Object> object,
188 Handle<String> name, Handle<Object> value, 187 Handle<String> name, Handle<Object> value,
189 CacheHolderFlag cache_holder) { 188 CacheHolderFlag cache_holder) {
190 UNREACHABLE(); 189 UNREACHABLE();
191 return Handle<Code>::null(); 190 return Handle<Code>::null();
192 } 191 }
192 // Temporary copy of the above, but using a LookupResult.
193 // TODO(jkummerow): Migrate callers to LookupIterator and delete these.
194 Handle<Code> ComputeStoreHandler(LookupResult* lookup, Handle<Object> object,
195 Handle<String> name,
196 Handle<Object> value = Handle<Code>::null());
197 virtual Handle<Code> CompileStoreHandler(LookupResult* lookup,
198 Handle<Object> object,
199 Handle<String> name,
200 Handle<Object> value,
201 CacheHolderFlag cache_holder) {
202 UNREACHABLE();
203 return Handle<Code>::null();
204 }
193 205
194 void UpdateMonomorphicIC(Handle<Code> handler, Handle<String> name); 206 void UpdateMonomorphicIC(Handle<Code> handler, Handle<String> name);
195 bool UpdatePolymorphicIC(Handle<String> name, Handle<Code> code); 207 bool UpdatePolymorphicIC(Handle<String> name, Handle<Code> code);
196 void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code); 208 void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code);
197 209
198 void CopyICToMegamorphicCache(Handle<String> name); 210 void CopyICToMegamorphicCache(Handle<String> name);
199 bool IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map); 211 bool IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map);
200 void PatchCache(Handle<String> name, Handle<Code> code); 212 void PatchCache(Handle<String> name, Handle<Code> code);
201 Code::Kind kind() const { return kind_; } 213 Code::Kind kind() const { return kind_; }
202 Code::Kind handler_kind() const { 214 Code::Kind handler_kind() const {
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 } else { 479 } else {
468 ASSERT_EQ(Code::KEYED_LOAD_IC, kind()); 480 ASSERT_EQ(Code::KEYED_LOAD_IC, kind());
469 return isolate()->builtins()->KeyedLoadIC_Slow(); 481 return isolate()->builtins()->KeyedLoadIC_Slow();
470 } 482 }
471 } 483 }
472 484
473 virtual Handle<Code> megamorphic_stub(); 485 virtual Handle<Code> megamorphic_stub();
474 486
475 // Update the inline cache and the global stub cache based on the 487 // Update the inline cache and the global stub cache based on the
476 // lookup result. 488 // lookup result.
477 void UpdateCaches(LookupResult* lookup, 489 void UpdateCaches(LookupIterator* lookup, Handle<Object> object,
478 Handle<Object> object,
479 Handle<String> name); 490 Handle<String> name);
480 491
481 virtual Handle<Code> CompileHandler(LookupResult* lookup, 492 virtual Handle<Code> CompileHandler(LookupIterator* lookup,
482 Handle<Object> object, 493 Handle<Object> object,
483 Handle<String> name, 494 Handle<String> name,
484 Handle<Object> unused, 495 Handle<Object> unused,
485 CacheHolderFlag cache_holder); 496 CacheHolderFlag cache_holder);
486 497
487 private: 498 private:
488 virtual Handle<Code> pre_monomorphic_stub() const; 499 virtual Handle<Code> pre_monomorphic_stub() const;
489 static Handle<Code> pre_monomorphic_stub(Isolate* isolate, 500 static Handle<Code> pre_monomorphic_stub(Isolate* isolate,
490 ExtraICState extra_state); 501 ExtraICState extra_state);
491 502
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 642
632 static Handle<Code> pre_monomorphic_stub(Isolate* isolate, 643 static Handle<Code> pre_monomorphic_stub(Isolate* isolate,
633 StrictMode strict_mode); 644 StrictMode strict_mode);
634 645
635 // Update the inline cache and the global stub cache based on the 646 // Update the inline cache and the global stub cache based on the
636 // lookup result. 647 // lookup result.
637 void UpdateCaches(LookupResult* lookup, 648 void UpdateCaches(LookupResult* lookup,
638 Handle<JSObject> receiver, 649 Handle<JSObject> receiver,
639 Handle<String> name, 650 Handle<String> name,
640 Handle<Object> value); 651 Handle<Object> value);
641 virtual Handle<Code> CompileHandler(LookupResult* lookup, 652 virtual Handle<Code> CompileStoreHandler(LookupResult* lookup,
642 Handle<Object> object, 653 Handle<Object> object,
643 Handle<String> name, Handle<Object> value, 654 Handle<String> name,
644 CacheHolderFlag cache_holder); 655 Handle<Object> value,
656 CacheHolderFlag cache_holder);
645 657
646 private: 658 private:
647 void set_target(Code* code) { 659 void set_target(Code* code) {
648 // Strict mode must be preserved across IC patching. 660 // Strict mode must be preserved across IC patching.
649 ASSERT(GetStrictMode(code->extra_ic_state()) == 661 ASSERT(GetStrictMode(code->extra_ic_state()) ==
650 GetStrictMode(target()->extra_ic_state())); 662 GetStrictMode(target()->extra_ic_state()));
651 IC::set_target(code); 663 IC::set_target(code);
652 } 664 }
653 665
654 static void Clear(Isolate* isolate, 666 static void Clear(Isolate* isolate,
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 DECLARE_RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss); 1033 DECLARE_RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss);
1022 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_Miss); 1034 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_Miss);
1023 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite); 1035 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite);
1024 DECLARE_RUNTIME_FUNCTION(CompareNilIC_Miss); 1036 DECLARE_RUNTIME_FUNCTION(CompareNilIC_Miss);
1025 DECLARE_RUNTIME_FUNCTION(ToBooleanIC_Miss); 1037 DECLARE_RUNTIME_FUNCTION(ToBooleanIC_Miss);
1026 1038
1027 1039
1028 } } // namespace v8::internal 1040 } } // namespace v8::internal
1029 1041
1030 #endif // V8_IC_H_ 1042 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698