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