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

Side by Side Diff: test/cctest/compiler/test-multiple-return.cc

Issue 1498833002: Move machine-type.h from src/compiler to src/. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « test/cctest/compiler/c-signature.h ('k') | test/cctest/compiler/test-run-native-calls.cc » ('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 // 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 18 matching lines...) Expand all
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 DCHECK(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(compiler::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 DCHECK(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(compiler::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.
56 MachineType target_type = compiler::kMachAnyTagged; 56 MachineType target_type = kMachAnyTagged;
57 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); 57 LinkageLocation target_loc = LinkageLocation::ForAnyRegister();
58 return new (zone) CallDescriptor( // -- 58 return new (zone) CallDescriptor( // --
59 CallDescriptor::kCallCodeObject, // kind 59 CallDescriptor::kCallCodeObject, // kind
60 target_type, // target MachineType 60 target_type, // target MachineType
61 target_loc, // target location 61 target_loc, // target location
62 msig.Build(), // machine_sig 62 msig.Build(), // machine_sig
63 locations.Build(), // location_sig 63 locations.Build(), // location_sig
64 0, // js_parameter_count 64 0, // js_parameter_count
65 compiler::Operator::kNoProperties, // properties 65 compiler::Operator::kNoProperties, // properties
66 kCalleeSaveRegisters, // callee-saved registers 66 kCalleeSaveRegisters, // callee-saved registers
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « test/cctest/compiler/c-signature.h ('k') | test/cctest/compiler/test-run-native-calls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698