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

Side by Side Diff: runtime/vm/stub_code.h

Issue 1418863003: Precompilation: Generate instance calls as IC calls that can switch to Megamoprhic calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « runtime/vm/object_store.h ('k') | runtime/vm/stub_code_arm.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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_STUB_CODE_H_ 5 #ifndef VM_STUB_CODE_H_
6 #define VM_STUB_CODE_H_ 6 #define VM_STUB_CODE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 10
(...skipping 17 matching lines...) Expand all
28 V(PrintStopMessage) \ 28 V(PrintStopMessage) \
29 V(CallToRuntime) \ 29 V(CallToRuntime) \
30 V(LazyCompile) \ 30 V(LazyCompile) \
31 V(CallBootstrapCFunction) \ 31 V(CallBootstrapCFunction) \
32 V(CallNativeCFunction) \ 32 V(CallNativeCFunction) \
33 V(FixCallersTarget) \ 33 V(FixCallersTarget) \
34 V(CallStaticFunction) \ 34 V(CallStaticFunction) \
35 V(OptimizeFunction) \ 35 V(OptimizeFunction) \
36 V(InvokeDartCode) \ 36 V(InvokeDartCode) \
37 V(DebugStepCheck) \ 37 V(DebugStepCheck) \
38 V(ICLookup) \
38 V(MegamorphicLookup) \ 39 V(MegamorphicLookup) \
39 V(FixAllocationStubTarget) \ 40 V(FixAllocationStubTarget) \
40 V(Deoptimize) \ 41 V(Deoptimize) \
41 V(DeoptimizeLazy) \ 42 V(DeoptimizeLazy) \
42 V(UnoptimizedIdenticalWithNumberCheck) \ 43 V(UnoptimizedIdenticalWithNumberCheck) \
43 V(OptimizedIdenticalWithNumberCheck) \ 44 V(OptimizedIdenticalWithNumberCheck) \
44 V(ICCallBreakpoint) \ 45 V(ICCallBreakpoint) \
45 V(RuntimeCallBreakpoint) \ 46 V(RuntimeCallBreakpoint) \
46 V(AllocateArray) \ 47 V(AllocateArray) \
47 V(AllocateContext) \ 48 V(AllocateContext) \
48 V(OneArgCheckInlineCache) \ 49 V(OneArgCheckInlineCache) \
49 V(TwoArgsCheckInlineCache) \ 50 V(TwoArgsCheckInlineCache) \
50 V(SmiAddInlineCache) \ 51 V(SmiAddInlineCache) \
51 V(SmiSubInlineCache) \ 52 V(SmiSubInlineCache) \
52 V(SmiEqualInlineCache) \ 53 V(SmiEqualInlineCache) \
53 V(UnaryRangeCollectingInlineCache) \ 54 V(UnaryRangeCollectingInlineCache) \
54 V(BinaryRangeCollectingInlineCache) \ 55 V(BinaryRangeCollectingInlineCache) \
55 V(OneArgOptimizedCheckInlineCache) \ 56 V(OneArgOptimizedCheckInlineCache) \
56 V(TwoArgsOptimizedCheckInlineCache) \ 57 V(TwoArgsOptimizedCheckInlineCache) \
57 V(ZeroArgsUnoptimizedStaticCall) \ 58 V(ZeroArgsUnoptimizedStaticCall) \
58 V(OneArgUnoptimizedStaticCall) \ 59 V(OneArgUnoptimizedStaticCall) \
59 V(TwoArgsUnoptimizedStaticCall) \ 60 V(TwoArgsUnoptimizedStaticCall) \
60 V(Subtype1TestCache) \ 61 V(Subtype1TestCache) \
61 V(Subtype2TestCache) \ 62 V(Subtype2TestCache) \
62 V(Subtype3TestCache) \ 63 V(Subtype3TestCache) \
63 V(CallClosureNoSuchMethod) 64 V(CallClosureNoSuchMethod) \
64 65
65 // Is it permitted for the stubs above to refer to Object::null(), which is 66 // Is it permitted for the stubs above to refer to Object::null(), which is
66 // allocated in the VM isolate and shared across all isolates. 67 // allocated in the VM isolate and shared across all isolates.
67 // However, in cases where a simple GC-safe placeholder is needed on the stack, 68 // However, in cases where a simple GC-safe placeholder is needed on the stack,
68 // using Smi 0 instead of Object::null() is slightly more efficient, since a Smi 69 // using Smi 0 instead of Object::null() is slightly more efficient, since a Smi
69 // does not require relocation. 70 // does not require relocation.
70 71
71 // class StubEntry is used to describe stub methods generated in dart to 72 // class StubEntry is used to describe stub methods generated in dart to
72 // abstract out common code executed from generated dart code. 73 // abstract out common code executed from generated dart code.
73 class StubEntry { 74 class StubEntry {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 130 }
130 VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR); 131 VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR);
131 #undef STUB_CODE_ACCESSOR 132 #undef STUB_CODE_ACCESSOR
132 133
133 static RawCode* GetAllocationStubForClass(const Class& cls); 134 static RawCode* GetAllocationStubForClass(const Class& cls);
134 135
135 static const StubEntry* UnoptimizedStaticCallEntry(intptr_t num_args_tested); 136 static const StubEntry* UnoptimizedStaticCallEntry(intptr_t num_args_tested);
136 137
137 static const intptr_t kNoInstantiator = 0; 138 static const intptr_t kNoInstantiator = 0;
138 139
139 static void EmitMegamorphicLookup( 140 static void EmitMegamorphicLookup(Assembler* assembler);
140 Assembler*, Register recv, Register cache, Register target);
141 141
142 private: 142 private:
143 friend class MegamorphicCacheTable; 143 friend class MegamorphicCacheTable;
144 144
145 static const intptr_t kStubCodeSize = 4 * KB; 145 static const intptr_t kStubCodeSize = 4 * KB;
146 146
147 #define STUB_CODE_GENERATE(name) \ 147 #define STUB_CODE_GENERATE(name) \
148 static void Generate##name##Stub(Assembler* assembler); 148 static void Generate##name##Stub(Assembler* assembler);
149 VM_STUB_CODE_LIST(STUB_CODE_GENERATE); 149 VM_STUB_CODE_LIST(STUB_CODE_GENERATE);
150 #undef STUB_CODE_GENERATE 150 #undef STUB_CODE_GENERATE
(...skipping 30 matching lines...) Expand all
181 181
182 182
183 enum DeoptStubKind { 183 enum DeoptStubKind {
184 kLazyDeopt, 184 kLazyDeopt,
185 kEagerDeopt 185 kEagerDeopt
186 }; 186 };
187 187
188 } // namespace dart 188 } // namespace dart
189 189
190 #endif // VM_STUB_CODE_H_ 190 #endif // VM_STUB_CODE_H_
OLDNEW
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698