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

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

Issue 1294133004: [Interpreter] Pass context to interpreter bytecode handlers and add LoadConstextSlot (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « src/compiler/linkage.h ('k') | src/compiler/raw-machine-assembler.h » ('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 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/code-stubs.h" 5 #include "src/code-stubs.h"
6 #include "src/compiler.h" 6 #include "src/compiler.h"
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/frame.h" 8 #include "src/compiler/frame.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/node.h" 10 #include "src/compiler/node.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 Operator::kNoProperties, // properties 380 Operator::kNoProperties, // properties
381 kNoCalleeSaved, // callee-saved 381 kNoCalleeSaved, // callee-saved
382 kNoCalleeSaved, // callee-saved fp 382 kNoCalleeSaved, // callee-saved fp
383 CallDescriptor::kCanUseRoots | // flags 383 CallDescriptor::kCanUseRoots | // flags
384 flags, // flags 384 flags, // flags
385 "js-call"); 385 "js-call");
386 } 386 }
387 387
388 388
389 CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) { 389 CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) {
390 MachineSignature::Builder types(zone, 0, 5); 390 MachineSignature::Builder types(zone, 0, 6);
391 LocationSignature::Builder locations(zone, 0, 5); 391 LocationSignature::Builder locations(zone, 0, 6);
392 392
393 // Add registers for fixed parameters passed via interpreter dispatch. 393 // Add registers for fixed parameters passed via interpreter dispatch.
394 STATIC_ASSERT(0 == Linkage::kInterpreterAccumulatorParameter); 394 STATIC_ASSERT(0 == Linkage::kInterpreterAccumulatorParameter);
395 types.AddParam(kMachAnyTagged); 395 types.AddParam(kMachAnyTagged);
396 locations.AddParam(regloc(kInterpreterAccumulatorRegister)); 396 locations.AddParam(regloc(kInterpreterAccumulatorRegister));
397 397
398 STATIC_ASSERT(1 == Linkage::kInterpreterRegisterFileParameter); 398 STATIC_ASSERT(1 == Linkage::kInterpreterRegisterFileParameter);
399 types.AddParam(kMachPtr); 399 types.AddParam(kMachPtr);
400 locations.AddParam(regloc(kInterpreterRegisterFileRegister)); 400 locations.AddParam(regloc(kInterpreterRegisterFileRegister));
401 401
402 STATIC_ASSERT(2 == Linkage::kInterpreterBytecodeOffsetParameter); 402 STATIC_ASSERT(2 == Linkage::kInterpreterBytecodeOffsetParameter);
403 types.AddParam(kMachIntPtr); 403 types.AddParam(kMachIntPtr);
404 locations.AddParam(regloc(kInterpreterBytecodeOffsetRegister)); 404 locations.AddParam(regloc(kInterpreterBytecodeOffsetRegister));
405 405
406 STATIC_ASSERT(3 == Linkage::kInterpreterBytecodeArrayParameter); 406 STATIC_ASSERT(3 == Linkage::kInterpreterBytecodeArrayParameter);
407 types.AddParam(kMachAnyTagged); 407 types.AddParam(kMachAnyTagged);
408 locations.AddParam(regloc(kInterpreterBytecodeArrayRegister)); 408 locations.AddParam(regloc(kInterpreterBytecodeArrayRegister));
409 409
410 STATIC_ASSERT(4 == Linkage::kInterpreterDispatchTableParameter); 410 STATIC_ASSERT(4 == Linkage::kInterpreterDispatchTableParameter);
411 types.AddParam(kMachPtr); 411 types.AddParam(kMachPtr);
412 locations.AddParam(regloc(kInterpreterDispatchTableRegister)); 412 locations.AddParam(regloc(kInterpreterDispatchTableRegister));
413 413
414 STATIC_ASSERT(5 == Linkage::kInterpreterContextParameter);
415 types.AddParam(kMachAnyTagged);
416 #if defined(V8_TARGET_ARCH_IA32)
Michael Starzinger 2015/08/20 09:32:02 Just for posterity: Not a huge fan of this #ifdef
rmcilroy 2015/08/24 10:14:38 Acknowledged.
417 locations.AddParam(
418 LinkageLocation::ForCallerFrameSlot(kInterpreterContextSpillSlot));
419 #else
420 locations.AddParam(regloc(kContextRegister));
421 #endif
422
414 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); 423 LinkageLocation target_loc = LinkageLocation::ForAnyRegister();
415 return new (zone) CallDescriptor( // -- 424 return new (zone) CallDescriptor( // --
416 CallDescriptor::kCallCodeObject, // kind 425 CallDescriptor::kCallCodeObject, // kind
417 kMachNone, // target MachineType 426 kMachNone, // target MachineType
418 target_loc, // target location 427 target_loc, // target location
419 types.Build(), // machine_sig 428 types.Build(), // machine_sig
420 locations.Build(), // location_sig 429 locations.Build(), // location_sig
421 0, // stack_parameter_count 430 0, // stack_parameter_count
422 Operator::kNoProperties, // properties 431 Operator::kNoProperties, // properties
423 kNoCalleeSaved, // callee-saved registers 432 kNoCalleeSaved, // callee-saved registers
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 return LinkageLocation::ForCalleeFrameSlot(spill_index); 514 return LinkageLocation::ForCalleeFrameSlot(spill_index);
506 } else { 515 } else {
507 // Parameter. Use the assigned location from the incoming call descriptor. 516 // Parameter. Use the assigned location from the incoming call descriptor.
508 int parameter_index = 1 + index; // skip index 0, which is the target. 517 int parameter_index = 1 + index; // skip index 0, which is the target.
509 return incoming_->GetInputLocation(parameter_index); 518 return incoming_->GetInputLocation(parameter_index);
510 } 519 }
511 } 520 }
512 } // namespace compiler 521 } // namespace compiler
513 } // namespace internal 522 } // namespace internal
514 } // namespace v8 523 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/linkage.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698