| 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/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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 LocationSignature::Builder locations(zone, return_count, parameter_count); | 235 LocationSignature::Builder locations(zone, return_count, parameter_count); |
| 236 MachineSignature::Builder types(zone, return_count, parameter_count); | 236 MachineSignature::Builder types(zone, return_count, parameter_count); |
| 237 | 237 |
| 238 // Add returns. | 238 // Add returns. |
| 239 if (locations.return_count_ > 0) { | 239 if (locations.return_count_ > 0) { |
| 240 locations.AddReturn(regloc(kReturnRegister0)); | 240 locations.AddReturn(regloc(kReturnRegister0)); |
| 241 } | 241 } |
| 242 if (locations.return_count_ > 1) { | 242 if (locations.return_count_ > 1) { |
| 243 locations.AddReturn(regloc(kReturnRegister1)); | 243 locations.AddReturn(regloc(kReturnRegister1)); |
| 244 } | 244 } |
| 245 if (locations.return_count_ > 2) { |
| 246 locations.AddReturn(regloc(kReturnRegister2)); |
| 247 } |
| 245 for (size_t i = 0; i < return_count; i++) { | 248 for (size_t i = 0; i < return_count; i++) { |
| 246 types.AddReturn(MachineType::AnyTagged()); | 249 types.AddReturn(MachineType::AnyTagged()); |
| 247 } | 250 } |
| 248 | 251 |
| 249 // All parameters to the runtime call go on the stack. | 252 // All parameters to the runtime call go on the stack. |
| 250 for (int i = 0; i < js_parameter_count; i++) { | 253 for (int i = 0; i < js_parameter_count; i++) { |
| 251 locations.AddParam( | 254 locations.AddParam( |
| 252 LinkageLocation::ForCallerFrameSlot(i - js_parameter_count)); | 255 LinkageLocation::ForCallerFrameSlot(i - js_parameter_count)); |
| 253 types.AddParam(MachineType::AnyTagged()); | 256 types.AddParam(MachineType::AnyTagged()); |
| 254 } | 257 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 LocationSignature::Builder locations(zone, return_count, parameter_count); | 444 LocationSignature::Builder locations(zone, return_count, parameter_count); |
| 442 MachineSignature::Builder types(zone, return_count, parameter_count); | 445 MachineSignature::Builder types(zone, return_count, parameter_count); |
| 443 | 446 |
| 444 // Add returns. | 447 // Add returns. |
| 445 if (locations.return_count_ > 0) { | 448 if (locations.return_count_ > 0) { |
| 446 locations.AddReturn(regloc(kReturnRegister0)); | 449 locations.AddReturn(regloc(kReturnRegister0)); |
| 447 } | 450 } |
| 448 if (locations.return_count_ > 1) { | 451 if (locations.return_count_ > 1) { |
| 449 locations.AddReturn(regloc(kReturnRegister1)); | 452 locations.AddReturn(regloc(kReturnRegister1)); |
| 450 } | 453 } |
| 454 if (locations.return_count_ > 2) { |
| 455 locations.AddReturn(regloc(kReturnRegister2)); |
| 456 } |
| 451 for (size_t i = 0; i < return_count; i++) { | 457 for (size_t i = 0; i < return_count; i++) { |
| 452 types.AddReturn(return_type); | 458 types.AddReturn(return_type); |
| 453 } | 459 } |
| 454 | 460 |
| 455 // Add parameters in registers and on the stack. | 461 // Add parameters in registers and on the stack. |
| 456 for (int i = 0; i < js_parameter_count; i++) { | 462 for (int i = 0; i < js_parameter_count; i++) { |
| 457 if (i < register_parameter_count) { | 463 if (i < register_parameter_count) { |
| 458 // The first parameters go in registers. | 464 // The first parameters go in registers. |
| 459 Register reg = descriptor.GetRegisterParameter(i); | 465 Register reg = descriptor.GetRegisterParameter(i); |
| 460 Representation rep = | 466 Representation rep = |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 } else { | 536 } else { |
| 531 DCHECK(loc == regloc(kContextRegister)); | 537 DCHECK(loc == regloc(kContextRegister)); |
| 532 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); | 538 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); |
| 533 } | 539 } |
| 534 } | 540 } |
| 535 | 541 |
| 536 | 542 |
| 537 } // namespace compiler | 543 } // namespace compiler |
| 538 } // namespace internal | 544 } // namespace internal |
| 539 } // namespace v8 | 545 } // namespace v8 |
| OLD | NEW |