| 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 // TODO(jochen): Remove this after the setting is turned on globally. | 5 // TODO(jochen): Remove this after the setting is turned on globally. |
| 6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <functional> | 9 #include <functional> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 CallDescriptor* GetCallDescriptor(Zone* zone, int return_count, | 29 CallDescriptor* GetCallDescriptor(Zone* zone, int return_count, |
| 30 int param_count) { | 30 int param_count) { |
| 31 MachineSignature::Builder msig(zone, return_count, param_count); | 31 MachineSignature::Builder msig(zone, return_count, param_count); |
| 32 LocationSignature::Builder locations(zone, return_count, param_count); | 32 LocationSignature::Builder locations(zone, return_count, param_count); |
| 33 const RegisterConfiguration* config = | 33 const RegisterConfiguration* config = |
| 34 RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN); | 34 RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN); |
| 35 | 35 |
| 36 // Add return location(s). | 36 // Add return location(s). |
| 37 DCHECK(return_count <= config->num_allocatable_general_registers()); | 37 CHECK(return_count <= config->num_allocatable_general_registers()); |
| 38 for (int i = 0; i < return_count; i++) { | 38 for (int i = 0; i < return_count; i++) { |
| 39 msig.AddReturn(kMachInt32); | 39 msig.AddReturn(kMachInt32); |
| 40 locations.AddReturn( | 40 locations.AddReturn( |
| 41 LinkageLocation::ForRegister(config->allocatable_general_codes()[i])); | 41 LinkageLocation::ForRegister(config->allocatable_general_codes()[i])); |
| 42 } | 42 } |
| 43 | 43 |
| 44 // Add register and/or stack parameter(s). | 44 // Add register and/or stack parameter(s). |
| 45 DCHECK(param_count <= config->num_allocatable_general_registers()); | 45 CHECK(param_count <= config->num_allocatable_general_registers()); |
| 46 for (int i = 0; i < param_count; i++) { | 46 for (int i = 0; i < param_count; i++) { |
| 47 msig.AddParam(kMachInt32); | 47 msig.AddParam(kMachInt32); |
| 48 locations.AddParam( | 48 locations.AddParam( |
| 49 LinkageLocation::ForRegister(config->allocatable_general_codes()[i])); | 49 LinkageLocation::ForRegister(config->allocatable_general_codes()[i])); |
| 50 } | 50 } |
| 51 | 51 |
| 52 const RegList kCalleeSaveRegisters = 0; | 52 const RegList kCalleeSaveRegisters = 0; |
| 53 const RegList kCalleeSaveFPRegisters = 0; | 53 const RegList kCalleeSaveFPRegisters = 0; |
| 54 | 54 |
| 55 // The target for WASM calls is always a code object. | 55 // The target for WASM calls is always a code object. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 OFStream os(stdout); | 112 OFStream os(stdout); |
| 113 code2->Disassemble("three_value_call", os); | 113 code2->Disassemble("three_value_call", os); |
| 114 } | 114 } |
| 115 #endif | 115 #endif |
| 116 CHECK_EQ((123 + 456) + (123 - 456) + (123 * 456), mt.Call()); | 116 CHECK_EQ((123 + 456) + (123 - 456) + (123 * 456), mt.Call()); |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace compiler | 119 } // namespace compiler |
| 120 } // namespace internal | 120 } // namespace internal |
| 121 } // namespace v8 | 121 } // namespace v8 |
| OLD | NEW |