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

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

Issue 3001463002: [gardening] Revert "Eliminate dependencies on assemblers and code stubs in precompiled runtime." (Closed)
Patch Set: Created 3 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
« no previous file with comments | « runtime/vm/runtime_entry_x64.cc ('k') | runtime/vm/stub_code.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 RUNTIME_VM_STUB_CODE_H_ 5 #ifndef RUNTIME_VM_STUB_CODE_H_
6 #define RUNTIME_VM_STUB_CODE_H_ 6 #define RUNTIME_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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 static void EntryAtPut(intptr_t index, StubEntry* entry) { 162 static void EntryAtPut(intptr_t index, StubEntry* entry) {
163 entries_[index] = entry; 163 entries_[index] = entry;
164 } 164 }
165 static intptr_t NumEntries() { return kNumStubEntries; } 165 static intptr_t NumEntries() { return kNumStubEntries; }
166 166
167 private: 167 private:
168 friend class MegamorphicCacheTable; 168 friend class MegamorphicCacheTable;
169 169
170 static const intptr_t kStubCodeSize = 4 * KB; 170 static const intptr_t kStubCodeSize = 4 * KB;
171 171
172 #define STUB_CODE_GENERATE(name) \
173 static void Generate##name##Stub(Assembler* assembler);
174 VM_STUB_CODE_LIST(STUB_CODE_GENERATE)
175 #undef STUB_CODE_GENERATE
176
172 enum { 177 enum {
173 #define STUB_CODE_ENTRY(name) k##name##Index, 178 #define STUB_CODE_ENTRY(name) k##name##Index,
174 VM_STUB_CODE_LIST(STUB_CODE_ENTRY) 179 VM_STUB_CODE_LIST(STUB_CODE_ENTRY)
175 #undef STUB_CODE_ENTRY 180 #undef STUB_CODE_ENTRY
176 kNumStubEntries 181 kNumStubEntries
177 }; 182 };
178 183
179 static StubEntry* entries_[kNumStubEntries]; 184 static StubEntry* entries_[kNumStubEntries];
180 185
181 #if !defined(DART_PRECOMPILED_RUNTIME)
182 #define STUB_CODE_GENERATE(name) \
183 static void Generate##name##Stub(Assembler* assembler);
184 VM_STUB_CODE_LIST(STUB_CODE_GENERATE)
185 #undef STUB_CODE_GENERATE
186
187 // Generate the stub and finalize the generated code into the stub 186 // Generate the stub and finalize the generated code into the stub
188 // code executable area. 187 // code executable area.
189 static RawCode* Generate(const char* name, 188 static RawCode* Generate(const char* name,
190 void (*GenerateStub)(Assembler* assembler)); 189 void (*GenerateStub)(Assembler* assembler));
191 190
192 static void GenerateMegamorphicMissStub(Assembler* assembler); 191 static void GenerateMegamorphicMissStub(Assembler* assembler);
193 static void GenerateAllocationStubForClass(Assembler* assembler, 192 static void GenerateAllocationStubForClass(Assembler* assembler,
194 const Class& cls); 193 const Class& cls);
195 static void GenerateNArgsCheckInlineCacheStub( 194 static void GenerateNArgsCheckInlineCacheStub(
196 Assembler* assembler, 195 Assembler* assembler,
197 intptr_t num_args, 196 intptr_t num_args,
198 const RuntimeEntry& handle_ic_miss, 197 const RuntimeEntry& handle_ic_miss,
199 Token::Kind kind, 198 Token::Kind kind,
200 bool optimized = false); 199 bool optimized = false);
201 static void GenerateUsageCounterIncrement(Assembler* assembler, 200 static void GenerateUsageCounterIncrement(Assembler* assembler,
202 Register temp_reg); 201 Register temp_reg);
203 static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler); 202 static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler);
204 #endif // !defined(DART_PRECOMPILED_RUNTIME)
205 }; 203 };
206 204
207 enum DeoptStubKind { kLazyDeoptFromReturn, kLazyDeoptFromThrow, kEagerDeopt }; 205 enum DeoptStubKind { kLazyDeoptFromReturn, kLazyDeoptFromThrow, kEagerDeopt };
208 206
209 // Zap value used to indicate unused CODE_REG in deopt. 207 // Zap value used to indicate unused CODE_REG in deopt.
210 static const uword kZapCodeReg = 0xf1f1f1f1; 208 static const uword kZapCodeReg = 0xf1f1f1f1;
211 209
212 // Zap value used to indicate unused return address in deopt. 210 // Zap value used to indicate unused return address in deopt.
213 static const uword kZapReturnAddress = 0xe1e1e1e1; 211 static const uword kZapReturnAddress = 0xe1e1e1e1;
214 212
215 } // namespace dart 213 } // namespace dart
216 214
217 #endif // RUNTIME_VM_STUB_CODE_H_ 215 #endif // RUNTIME_VM_STUB_CODE_H_
OLDNEW
« no previous file with comments | « runtime/vm/runtime_entry_x64.cc ('k') | runtime/vm/stub_code.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698