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

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

Issue 1125623003: Move megamorphic lookup code to stub instead of inlining. Preformance loss < 5%, instruction size r… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 7 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 | « runtime/vm/flow_graph_compiler_x64.cc ('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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 V(Subtype2TestCache) \ 68 V(Subtype2TestCache) \
69 V(Subtype3TestCache) \ 69 V(Subtype3TestCache) \
70 V(Deoptimize) \ 70 V(Deoptimize) \
71 V(DeoptimizeLazy) \ 71 V(DeoptimizeLazy) \
72 V(ICCallBreakpoint) \ 72 V(ICCallBreakpoint) \
73 V(ClosureCallBreakpoint) \ 73 V(ClosureCallBreakpoint) \
74 V(RuntimeCallBreakpoint) \ 74 V(RuntimeCallBreakpoint) \
75 V(UnoptimizedIdenticalWithNumberCheck) \ 75 V(UnoptimizedIdenticalWithNumberCheck) \
76 V(OptimizedIdenticalWithNumberCheck) \ 76 V(OptimizedIdenticalWithNumberCheck) \
77 V(DebugStepCheck) \ 77 V(DebugStepCheck) \
78 V(MegamorphicLookup) \
78 79
79 #define STUB_CODE_LIST(V) \ 80 #define STUB_CODE_LIST(V) \
80 BOOTSTRAP_STUB_CODE_LIST(V) \ 81 BOOTSTRAP_STUB_CODE_LIST(V) \
81 REST_STUB_CODE_LIST(V) 82 REST_STUB_CODE_LIST(V)
82 83
83 // class StubEntry is used to describe stub methods generated in dart to 84 // class StubEntry is used to describe stub methods generated in dart to
84 // abstract out common code executed from generated dart code. 85 // abstract out common code executed from generated dart code.
85 class StubEntry { 86 class StubEntry {
86 public: 87 public:
87 explicit StubEntry(const Code& code); 88 explicit StubEntry(const Code& code);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 STUB_CODE_LIST(STUB_CODE_ACCESSOR); 177 STUB_CODE_LIST(STUB_CODE_ACCESSOR);
177 #undef STUB_CODE_ACCESSOR 178 #undef STUB_CODE_ACCESSOR
178 179
179 static RawCode* GetAllocationStubForClass(const Class& cls); 180 static RawCode* GetAllocationStubForClass(const Class& cls);
180 RawCode* GetAllocateArrayStub(); 181 RawCode* GetAllocateArrayStub();
181 182
182 uword UnoptimizedStaticCallEntryPoint(intptr_t num_args_tested); 183 uword UnoptimizedStaticCallEntryPoint(intptr_t num_args_tested);
183 184
184 static const intptr_t kNoInstantiator = 0; 185 static const intptr_t kNoInstantiator = 0;
185 186
187 static void EmitMegamorphicLookup(
188 Assembler*, Register recv, Register cache, Register target);
189
186 private: 190 private:
187 void GenerateBootstrapStubsFor(Isolate* isolate); 191 void GenerateBootstrapStubsFor(Isolate* isolate);
188 void GenerateStubsFor(Isolate* isolate); 192 void GenerateStubsFor(Isolate* isolate);
189 193
190 friend class MegamorphicCacheTable; 194 friend class MegamorphicCacheTable;
191 195
192 static const intptr_t kStubCodeSize = 4 * KB; 196 static const intptr_t kStubCodeSize = 4 * KB;
193 197
194 #define STUB_CODE_GENERATE(name) \ 198 #define STUB_CODE_GENERATE(name) \
195 static void Generate##name##Stub(Assembler* assembler); 199 static void Generate##name##Stub(Assembler* assembler);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 Assembler* assembler, 242 Assembler* assembler,
239 const Register left, 243 const Register left,
240 const Register right, 244 const Register right,
241 const Register temp1 = kNoRegister, 245 const Register temp1 = kNoRegister,
242 const Register temp2 = kNoRegister); 246 const Register temp2 = kNoRegister);
243 }; 247 };
244 248
245 } // namespace dart 249 } // namespace dart
246 250
247 #endif // VM_STUB_CODE_H_ 251 #endif // VM_STUB_CODE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698