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

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

Issue 1875033003: Revert of Turn StoreIC::Megamorphic into a builtin, get rid of the non-monomorphic-cache (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « src/ic/ic.cc ('k') | src/ic/ic-compiler.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_IC_COMPILER_H_ 5 #ifndef V8_IC_IC_COMPILER_H_
6 #define V8_IC_IC_COMPILER_H_ 6 #define V8_IC_IC_COMPILER_H_
7 7
8 #include "src/ic/access-compiler.h" 8 #include "src/ic/access-compiler.h"
9 9
10 namespace v8 { 10 namespace v8 {
11 namespace internal { 11 namespace internal {
12 12
13 13
14 class PropertyICCompiler : public PropertyAccessCompiler { 14 class PropertyICCompiler : public PropertyAccessCompiler {
15 public: 15 public:
16 // Named
17 static Handle<Code> ComputeStore(Isolate* isolate, InlineCacheState ic_state,
18 ExtraICState extra_state);
19
16 // Keyed 20 // Keyed
17 static Handle<Code> ComputeKeyedLoadMonomorphicHandler( 21 static Handle<Code> ComputeKeyedLoadMonomorphicHandler(
18 Handle<Map> receiver_map, ExtraICState extra_ic_state); 22 Handle<Map> receiver_map, ExtraICState extra_ic_state);
19 23
20 static Handle<Code> ComputeKeyedStoreMonomorphicHandler( 24 static Handle<Code> ComputeKeyedStoreMonomorphicHandler(
21 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode); 25 Handle<Map> receiver_map, LanguageMode language_mode,
26 KeyedAccessStoreMode store_mode);
22 static void ComputeKeyedStorePolymorphicHandlers( 27 static void ComputeKeyedStorePolymorphicHandlers(
23 MapHandleList* receiver_maps, MapHandleList* transitioned_maps, 28 MapHandleList* receiver_maps, MapHandleList* transitioned_maps,
24 CodeHandleList* handlers, KeyedAccessStoreMode store_mode); 29 CodeHandleList* handlers, KeyedAccessStoreMode store_mode,
30 LanguageMode language_mode);
25 31
26 // Helpers 32 // Helpers
27 // TODO(verwaest): Move all uses of these helpers to the PropertyICCompiler 33 // TODO(verwaest): Move all uses of these helpers to the PropertyICCompiler
28 // and make the helpers private. 34 // and make the helpers private.
29 static void GenerateRuntimeSetProperty(MacroAssembler* masm, 35 static void GenerateRuntimeSetProperty(MacroAssembler* masm,
30 LanguageMode language_mode); 36 LanguageMode language_mode);
31 37
32 38
33 private: 39 private:
34 explicit PropertyICCompiler(Isolate* isolate) 40 PropertyICCompiler(Isolate* isolate, Code::Kind kind,
35 : PropertyAccessCompiler(isolate, Code::KEYED_STORE_IC, 41 ExtraICState extra_ic_state = kNoExtraICState,
36 kCacheOnReceiver) {} 42 CacheHolderFlag cache_holder = kCacheOnReceiver)
43 : PropertyAccessCompiler(isolate, kind, cache_holder),
44 extra_ic_state_(extra_ic_state) {}
45
46 Handle<Code> CompileStoreMegamorphic(Code::Flags flags);
37 47
38 Handle<Code> CompileKeyedStoreMonomorphicHandler( 48 Handle<Code> CompileKeyedStoreMonomorphicHandler(
39 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode); 49 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode);
40 void CompileKeyedStorePolymorphicHandlers(MapHandleList* receiver_maps, 50 void CompileKeyedStorePolymorphicHandlers(MapHandleList* receiver_maps,
41 MapHandleList* transitioned_maps, 51 MapHandleList* transitioned_maps,
42 CodeHandleList* handlers, 52 CodeHandleList* handlers,
43 KeyedAccessStoreMode store_mode); 53 KeyedAccessStoreMode store_mode);
54
55 Handle<Code> GetCode(Code::Kind kind, Handle<Name> name,
56 InlineCacheState state = MONOMORPHIC);
57
58 Logger::LogEventsAndTags log_kind(Handle<Code> code) {
59 if (kind() == Code::LOAD_IC) {
60 return code->ic_state() == MONOMORPHIC ? Logger::LOAD_IC_TAG
61 : Logger::LOAD_POLYMORPHIC_IC_TAG;
62 } else if (kind() == Code::KEYED_LOAD_IC) {
63 return code->ic_state() == MONOMORPHIC
64 ? Logger::KEYED_LOAD_IC_TAG
65 : Logger::KEYED_LOAD_POLYMORPHIC_IC_TAG;
66 } else if (kind() == Code::STORE_IC) {
67 return code->ic_state() == MONOMORPHIC ? Logger::STORE_IC_TAG
68 : Logger::STORE_POLYMORPHIC_IC_TAG;
69 } else {
70 DCHECK_EQ(Code::KEYED_STORE_IC, kind());
71 return code->ic_state() == MONOMORPHIC
72 ? Logger::KEYED_STORE_IC_TAG
73 : Logger::KEYED_STORE_POLYMORPHIC_IC_TAG;
74 }
75 }
76
77 const ExtraICState extra_ic_state_;
44 }; 78 };
45 79
46 80
47 } // namespace internal 81 } // namespace internal
48 } // namespace v8 82 } // namespace v8
49 83
50 #endif // V8_IC_IC_COMPILER_H_ 84 #endif // V8_IC_IC_COMPILER_H_
OLDNEW
« no previous file with comments | « src/ic/ic.cc ('k') | src/ic/ic-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698