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

Side by Side Diff: src/compiler/linkage.cc

Issue 1673333004: [Interpreter] Make InterpreterAssembler a subclass of CodeStubAssembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix debug-code Created 4 years, 10 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 #include "src/ast/scopes.h" 5 #include "src/ast/scopes.h"
6 #include "src/code-stubs.h" 6 #include "src/code-stubs.h"
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/common-operator.h" 8 #include "src/compiler/common-operator.h"
9 #include "src/compiler/frame.h" 9 #include "src/compiler/frame.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 locations.Build(), // location_sig 359 locations.Build(), // location_sig
360 js_parameter_count, // stack_parameter_count 360 js_parameter_count, // stack_parameter_count
361 Operator::kNoProperties, // properties 361 Operator::kNoProperties, // properties
362 kNoCalleeSaved, // callee-saved 362 kNoCalleeSaved, // callee-saved
363 kNoCalleeSaved, // callee-saved fp 363 kNoCalleeSaved, // callee-saved fp
364 CallDescriptor::kCanUseRoots | // flags 364 CallDescriptor::kCanUseRoots | // flags
365 flags, // flags 365 flags, // flags
366 "js-call"); 366 "js-call");
367 } 367 }
368 368
369
370 CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) {
371 MachineSignature::Builder types(zone, 0, 6);
372 LocationSignature::Builder locations(zone, 0, 6);
373
374 // Add registers for fixed parameters passed via interpreter dispatch.
375 STATIC_ASSERT(0 == Linkage::kInterpreterAccumulatorParameter);
376 types.AddParam(MachineType::AnyTagged());
377 locations.AddParam(regloc(kInterpreterAccumulatorRegister));
378
379 STATIC_ASSERT(1 == Linkage::kInterpreterRegisterFileParameter);
380 types.AddParam(MachineType::Pointer());
381 locations.AddParam(regloc(kInterpreterRegisterFileRegister));
382
383 STATIC_ASSERT(2 == Linkage::kInterpreterBytecodeOffsetParameter);
384 types.AddParam(MachineType::IntPtr());
385 locations.AddParam(regloc(kInterpreterBytecodeOffsetRegister));
386
387 STATIC_ASSERT(3 == Linkage::kInterpreterBytecodeArrayParameter);
388 types.AddParam(MachineType::AnyTagged());
389 locations.AddParam(regloc(kInterpreterBytecodeArrayRegister));
390
391 STATIC_ASSERT(4 == Linkage::kInterpreterDispatchTableParameter);
392 types.AddParam(MachineType::Pointer());
393 #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X87)
394 // TODO(rmcilroy): Make the context param the one spilled to the stack once
395 // Turbofan supports modified stack arguments in tail calls.
396 locations.AddParam(
397 LinkageLocation::ForCallerFrameSlot(kInterpreterDispatchTableSpillSlot));
398 #else
399 locations.AddParam(regloc(kInterpreterDispatchTableRegister));
400 #endif
401
402 STATIC_ASSERT(5 == Linkage::kInterpreterContextParameter);
403 types.AddParam(MachineType::AnyTagged());
404 locations.AddParam(regloc(kContextRegister));
405
406 LinkageLocation target_loc = LinkageLocation::ForAnyRegister();
407 return new (zone) CallDescriptor( // --
408 CallDescriptor::kCallCodeObject, // kind
409 MachineType::None(), // target MachineType
410 target_loc, // target location
411 types.Build(), // machine_sig
412 locations.Build(), // location_sig
413 0, // stack_parameter_count
414 Operator::kNoProperties, // properties
415 kNoCalleeSaved, // callee-saved registers
416 kNoCalleeSaved, // callee-saved fp regs
417 CallDescriptor::kSupportsTailCalls | // flags
418 CallDescriptor::kCanUseRoots, // flags
419 "interpreter-dispatch");
420 }
421
422
423 // TODO(all): Add support for return representations/locations to 369 // TODO(all): Add support for return representations/locations to
424 // CallInterfaceDescriptor. 370 // CallInterfaceDescriptor.
425 // TODO(turbofan): cache call descriptors for code stub calls. 371 // TODO(turbofan): cache call descriptors for code stub calls.
426 CallDescriptor* Linkage::GetStubCallDescriptor( 372 CallDescriptor* Linkage::GetStubCallDescriptor(
427 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, 373 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
428 int stack_parameter_count, CallDescriptor::Flags flags, 374 int stack_parameter_count, CallDescriptor::Flags flags,
429 Operator::Properties properties, MachineType return_type, 375 Operator::Properties properties, MachineType return_type,
430 size_t return_count) { 376 size_t return_count) {
431 const int register_parameter_count = descriptor.GetRegisterParameterCount(); 377 const int register_parameter_count = descriptor.GetRegisterParameterCount();
432 const int js_parameter_count = 378 const int js_parameter_count =
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 } else { 476 } else {
531 DCHECK(loc == regloc(kContextRegister)); 477 DCHECK(loc == regloc(kContextRegister));
532 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); 478 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot);
533 } 479 }
534 } 480 }
535 481
536 482
537 } // namespace compiler 483 } // namespace compiler
538 } // namespace internal 484 } // namespace internal
539 } // namespace v8 485 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698