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

Side by Side Diff: src/compiler/linkage-impl.h

Issue 1239793002: [interpreter] Add basic framework for bytecode handler code generation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
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_COMPILER_LINKAGE_IMPL_H_ 5 #ifndef V8_COMPILER_LINKAGE_IMPL_H_
6 #define V8_COMPILER_LINKAGE_IMPL_H_ 6 #define V8_COMPILER_LINKAGE_IMPL_H_
7 7
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler/interpreter-assembler.h"
9 #include "src/compiler/osr.h" 10 #include "src/compiler/osr.h"
10 11
11 namespace v8 { 12 namespace v8 {
12 namespace internal { 13 namespace internal {
13 namespace compiler { 14 namespace compiler {
14 15
15 // TODO(titzer): replace uses of int with size_t in LinkageHelper. 16 // TODO(titzer): replace uses of int with size_t in LinkageHelper.
16 template <typename LinkageTraits> 17 template <typename LinkageTraits>
17 class LinkageHelper { 18 class LinkageHelper {
18 public: 19 public:
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 msig, // machine_sig 227 msig, // machine_sig
227 locations.Build(), // location_sig 228 locations.Build(), // location_sig
228 0, // js_parameter_count 229 0, // js_parameter_count
229 Operator::kNoProperties, // properties 230 Operator::kNoProperties, // properties
230 LinkageTraits::CCalleeSaveRegisters(), // callee-saved registers 231 LinkageTraits::CCalleeSaveRegisters(), // callee-saved registers
231 LinkageTraits::CCalleeSaveFPRegisters(), // callee-saved fp regs 232 LinkageTraits::CCalleeSaveFPRegisters(), // callee-saved fp regs
232 CallDescriptor::kNoFlags, // flags 233 CallDescriptor::kNoFlags, // flags
233 "c-call"); 234 "c-call");
234 } 235 }
235 236
236 static CallDescriptor* GetInterpreterDispatchDescriptor( 237 static CallDescriptor* GetInterpreterDispatchDescriptor(Zone* zone,
237 Zone* zone, const MachineSignature* msig) { 238 bool needs_return) {
238 DCHECK_EQ(0, msig->parameter_count()); 239 int return_count = needs_return ? 1 : 0;
239 LocationSignature::Builder locations(zone, msig->return_count(), 240 MachineSignature::Builder types(zone, return_count, 2);
240 msig->parameter_count()); 241 LocationSignature::Builder locations(zone, return_count, 2);
241 AddReturnLocations(&locations); 242
243 DCHECK_EQ(0, InterpreterAssembler::kBytecodePointerParameter);
oth 2015/07/15 13:22:01 One line comment explaining types purpose (reservi
rmcilroy 2015/07/15 16:55:58 Done.
244 types.AddParam(kMachPtr);
245 locations.AddParam(regloc(LinkageTraits::InterpreterBytecodePointerReg()));
246
247 DCHECK_EQ(1, InterpreterAssembler::kDispatchTablePointerParameter);
248 types.AddParam(kMachPtr);
249 locations.AddParam(regloc(LinkageTraits::InterpreterDispatchTableReg()));
250
251 if (needs_return) {
252 types.AddReturn(kMachAnyTagged);
253 AddReturnLocations(&locations);
254 }
255
242 LinkageLocation target_loc = LinkageLocation::AnyRegister(); 256 LinkageLocation target_loc = LinkageLocation::AnyRegister();
243 return new (zone) CallDescriptor( // -- 257 return new (zone) CallDescriptor( // --
244 CallDescriptor::kInterpreterDispatch, // kind 258 CallDescriptor::kInterpreterDispatch, // kind
245 kMachNone, // target MachineType 259 kMachNone, // target MachineType
246 target_loc, // target location 260 target_loc, // target location
247 msig, // machine_sig 261 types.Build(), // machine_sig
248 locations.Build(), // location_sig 262 locations.Build(), // location_sig
249 0, // js_parameter_count 263 0, // js_parameter_count
250 Operator::kNoProperties, // properties 264 Operator::kNoProperties, // properties
251 kNoCalleeSaved, // callee-saved registers 265 kNoCalleeSaved, // callee-saved registers
252 kNoCalleeSaved, // callee-saved fp regs 266 kNoCalleeSaved, // callee-saved fp regs
253 CallDescriptor::kSupportsTailCalls, // flags 267 CallDescriptor::kSupportsTailCalls, // flags
254 "interpreter-dispatch"); 268 "interpreter-dispatch");
255 } 269 }
256 270
257 static LinkageLocation regloc(Register reg) { 271 static LinkageLocation regloc(Register reg) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 int parameter_index = 1 + index; // skip index 0, which is the target. 329 int parameter_index = 1 + index; // skip index 0, which is the target.
316 return incoming_->GetInputLocation(parameter_index); 330 return incoming_->GetInputLocation(parameter_index);
317 } 331 }
318 } 332 }
319 333
320 } // namespace compiler 334 } // namespace compiler
321 } // namespace internal 335 } // namespace internal
322 } // namespace v8 336 } // namespace v8
323 337
324 #endif // V8_COMPILER_LINKAGE_IMPL_H_ 338 #endif // V8_COMPILER_LINKAGE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698