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

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

Issue 1405673003: provides a mechanism for optimizing compilers to select the different Register configuration. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add the TODO comments. Created 5 years, 2 months 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
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 #include <cmath> 5 #include <cmath>
6 #include <functional> 6 #include <functional>
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/assembler.h" 9 #include "src/assembler.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 11 matching lines...) Expand all
22 using namespace v8::internal; 22 using namespace v8::internal;
23 using namespace v8::internal::compiler; 23 using namespace v8::internal::compiler;
24 24
25 25
26 namespace { 26 namespace {
27 27
28 CallDescriptor* GetCallDescriptor(Zone* zone, int return_count, 28 CallDescriptor* GetCallDescriptor(Zone* zone, int return_count,
29 int param_count) { 29 int param_count) {
30 MachineSignature::Builder msig(zone, return_count, param_count); 30 MachineSignature::Builder msig(zone, return_count, param_count);
31 LocationSignature::Builder locations(zone, return_count, param_count); 31 LocationSignature::Builder locations(zone, return_count, param_count);
32 const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); 32 const RegisterConfiguration* config =
33 RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN);
33 34
34 // Add return location(s). 35 // Add return location(s).
35 DCHECK(return_count <= config->num_allocatable_general_registers()); 36 DCHECK(return_count <= config->num_allocatable_general_registers());
36 for (int i = 0; i < return_count; i++) { 37 for (int i = 0; i < return_count; i++) {
37 msig.AddReturn(compiler::kMachInt32); 38 msig.AddReturn(compiler::kMachInt32);
38 locations.AddReturn( 39 locations.AddReturn(
39 LinkageLocation::ForRegister(config->allocatable_general_codes()[i])); 40 LinkageLocation::ForRegister(config->allocatable_general_codes()[i]));
40 } 41 }
41 42
42 // Add register and/or stack parameter(s). 43 // Add register and/or stack parameter(s).
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 mt.Return(ret); 107 mt.Return(ret);
107 #ifdef ENABLE_DISASSEMBLER 108 #ifdef ENABLE_DISASSEMBLER
108 Handle<Code> code2 = mt.GetCode(); 109 Handle<Code> code2 = mt.GetCode();
109 if (FLAG_print_code) { 110 if (FLAG_print_code) {
110 OFStream os(stdout); 111 OFStream os(stdout);
111 code2->Disassemble("three_value_call", os); 112 code2->Disassemble("three_value_call", os);
112 } 113 }
113 #endif 114 #endif
114 CHECK_EQ((123 + 456) + (123 - 456) + (123 * 456), mt.Call()); 115 CHECK_EQ((123 + 456) + (123 - 456) + (123 * 456), mt.Call());
115 } 116 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-gap-resolver.cc ('k') | test/cctest/compiler/test-run-native-calls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698