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

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

Issue 1864703003: 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
20 // Keyed 16 // Keyed
21 static Handle<Code> ComputeKeyedLoadMonomorphicHandler( 17 static Handle<Code> ComputeKeyedLoadMonomorphicHandler(
22 Handle<Map> receiver_map, ExtraICState extra_ic_state); 18 Handle<Map> receiver_map, ExtraICState extra_ic_state);
23 19
24 static Handle<Code> ComputeKeyedStoreMonomorphicHandler( 20 static Handle<Code> ComputeKeyedStoreMonomorphicHandler(
25 Handle<Map> receiver_map, LanguageMode language_mode, 21 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode);
26 KeyedAccessStoreMode store_mode);
27 static void ComputeKeyedStorePolymorphicHandlers( 22 static void ComputeKeyedStorePolymorphicHandlers(
28 MapHandleList* receiver_maps, MapHandleList* transitioned_maps, 23 MapHandleList* receiver_maps, MapHandleList* transitioned_maps,
29 CodeHandleList* handlers, KeyedAccessStoreMode store_mode, 24 CodeHandleList* handlers, KeyedAccessStoreMode store_mode);
30 LanguageMode language_mode);
31 25
32 // Helpers 26 // Helpers
33 // TODO(verwaest): Move all uses of these helpers to the PropertyICCompiler 27 // TODO(verwaest): Move all uses of these helpers to the PropertyICCompiler
34 // and make the helpers private. 28 // and make the helpers private.
35 static void GenerateRuntimeSetProperty(MacroAssembler* masm, 29 static void GenerateRuntimeSetProperty(MacroAssembler* masm,
36 LanguageMode language_mode); 30 LanguageMode language_mode);
37 31
38 32
39 private: 33 private:
40 PropertyICCompiler(Isolate* isolate, Code::Kind kind, 34 explicit PropertyICCompiler(Isolate* isolate)
41 ExtraICState extra_ic_state = kNoExtraICState, 35 : PropertyAccessCompiler(isolate, Code::KEYED_STORE_IC,
42 CacheHolderFlag cache_holder = kCacheOnReceiver) 36 kCacheOnReceiver) {}
43 : PropertyAccessCompiler(isolate, kind, cache_holder),
44 extra_ic_state_(extra_ic_state) {}
45
46 Handle<Code> CompileStoreMegamorphic(Code::Flags flags);
47 37
48 Handle<Code> CompileKeyedStoreMonomorphicHandler( 38 Handle<Code> CompileKeyedStoreMonomorphicHandler(
49 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode); 39 Handle<Map> receiver_map, KeyedAccessStoreMode store_mode);
50 void CompileKeyedStorePolymorphicHandlers(MapHandleList* receiver_maps, 40 void CompileKeyedStorePolymorphicHandlers(MapHandleList* receiver_maps,
51 MapHandleList* transitioned_maps, 41 MapHandleList* transitioned_maps,
52 CodeHandleList* handlers, 42 CodeHandleList* handlers,
53 KeyedAccessStoreMode store_mode); 43 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_;
78 }; 44 };
79 45
80 46
81 } // namespace internal 47 } // namespace internal
82 } // namespace v8 48 } // namespace v8
83 49
84 #endif // V8_IC_IC_COMPILER_H_ 50 #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