OLD | NEW |
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/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 #include "src/compiler/osr.h" | 10 #include "src/compiler/osr.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 Operator::kNoProperties, // properties | 387 Operator::kNoProperties, // properties |
388 kNoCalleeSaved, // callee-saved | 388 kNoCalleeSaved, // callee-saved |
389 kNoCalleeSaved, // callee-saved fp | 389 kNoCalleeSaved, // callee-saved fp |
390 CallDescriptor::kCanUseRoots | // flags | 390 CallDescriptor::kCanUseRoots | // flags |
391 flags, // flags | 391 flags, // flags |
392 "js-call"); | 392 "js-call"); |
393 } | 393 } |
394 | 394 |
395 | 395 |
396 CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) { | 396 CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) { |
397 MachineSignature::Builder types(zone, 0, 3); | 397 MachineSignature::Builder types(zone, 0, 5); |
398 LocationSignature::Builder locations(zone, 0, 3); | 398 LocationSignature::Builder locations(zone, 0, 5); |
399 | 399 |
400 // Add registers for fixed parameters passed via interpreter dispatch. | 400 // Add registers for fixed parameters passed via interpreter dispatch. |
401 STATIC_ASSERT(0 == Linkage::kInterpreterBytecodeOffsetParameter); | 401 STATIC_ASSERT(0 == Linkage::kInterpreterAccumulatorParameter); |
| 402 types.AddParam(kMachAnyTagged); |
| 403 locations.AddParam(regloc(kInterpreterAccumulatorRegister)); |
| 404 |
| 405 STATIC_ASSERT(1 == Linkage::kInterpreterRegisterFileParameter); |
| 406 types.AddParam(kMachPtr); |
| 407 locations.AddParam(regloc(kInterpreterRegisterFileRegister)); |
| 408 |
| 409 STATIC_ASSERT(2 == Linkage::kInterpreterBytecodeOffsetParameter); |
402 types.AddParam(kMachIntPtr); | 410 types.AddParam(kMachIntPtr); |
403 locations.AddParam(regloc(kInterpreterBytecodeOffsetRegister)); | 411 locations.AddParam(regloc(kInterpreterBytecodeOffsetRegister)); |
404 | 412 |
405 STATIC_ASSERT(1 == Linkage::kInterpreterBytecodeArrayParameter); | 413 STATIC_ASSERT(3 == Linkage::kInterpreterBytecodeArrayParameter); |
406 types.AddParam(kMachAnyTagged); | 414 types.AddParam(kMachAnyTagged); |
407 locations.AddParam(regloc(kInterpreterBytecodeArrayRegister)); | 415 locations.AddParam(regloc(kInterpreterBytecodeArrayRegister)); |
408 | 416 |
409 STATIC_ASSERT(2 == Linkage::kInterpreterDispatchTableParameter); | 417 STATIC_ASSERT(4 == Linkage::kInterpreterDispatchTableParameter); |
410 types.AddParam(kMachPtr); | 418 types.AddParam(kMachPtr); |
411 locations.AddParam(regloc(kInterpreterDispatchTableRegister)); | 419 locations.AddParam(regloc(kInterpreterDispatchTableRegister)); |
412 | 420 |
413 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); | 421 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); |
414 return new (zone) CallDescriptor( // -- | 422 return new (zone) CallDescriptor( // -- |
415 CallDescriptor::kCallCodeObject, // kind | 423 CallDescriptor::kCallCodeObject, // kind |
416 kMachNone, // target MachineType | 424 kMachNone, // target MachineType |
417 target_loc, // target location | 425 target_loc, // target location |
418 types.Build(), // machine_sig | 426 types.Build(), // machine_sig |
419 locations.Build(), // location_sig | 427 locations.Build(), // location_sig |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 return LinkageLocation::ForCalleeFrameSlot(spill_index); | 511 return LinkageLocation::ForCalleeFrameSlot(spill_index); |
504 } else { | 512 } else { |
505 // Parameter. Use the assigned location from the incoming call descriptor. | 513 // Parameter. Use the assigned location from the incoming call descriptor. |
506 int parameter_index = 1 + index; // skip index 0, which is the target. | 514 int parameter_index = 1 + index; // skip index 0, which is the target. |
507 return incoming_->GetInputLocation(parameter_index); | 515 return incoming_->GetInputLocation(parameter_index); |
508 } | 516 } |
509 } | 517 } |
510 } // namespace compiler | 518 } // namespace compiler |
511 } // namespace internal | 519 } // namespace internal |
512 } // namespace v8 | 520 } // namespace v8 |
OLD | NEW |