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

Side by Side Diff: test/cctest/test-code-stubs-x87.cc

Issue 1410393004: X87: Re-reland: Remove register index/code indirection. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « src/x87/macro-assembler-x87.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 __ push(esi); 63 __ push(esi);
64 __ push(edi); 64 __ push(edi);
65 65
66 if (!source_reg.is(esp)) { 66 if (!source_reg.is(esp)) {
67 __ lea(source_reg, MemOperand(esp, 6 * kPointerSize - offset)); 67 __ lea(source_reg, MemOperand(esp, 6 * kPointerSize - offset));
68 } 68 }
69 69
70 int param_offset = 7 * kPointerSize; 70 int param_offset = 7 * kPointerSize;
71 // Save registers make sure they don't get clobbered. 71 // Save registers make sure they don't get clobbered.
72 int reg_num = 0; 72 int reg_num = 0;
73 for (; reg_num < Register::NumAllocatableRegisters(); ++reg_num) { 73 for (; reg_num < Register::kNumRegisters; ++reg_num) {
74 Register reg = Register::FromAllocationIndex(reg_num); 74 Register reg = Register::from_code(reg_num);
75 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) { 75 if (reg.IsAllocatable()) {
76 __ push(reg); 76 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) {
77 param_offset += kPointerSize; 77 __ push(reg);
78 param_offset += kPointerSize;
79 }
78 } 80 }
79 } 81 }
80 82
81 // Re-push the double argument 83 // Re-push the double argument
82 __ push(MemOperand(esp, param_offset)); 84 __ push(MemOperand(esp, param_offset));
83 __ push(MemOperand(esp, param_offset)); 85 __ push(MemOperand(esp, param_offset));
84 86
85 // Call through to the actual stub 87 // Call through to the actual stub
86 __ call(start, RelocInfo::EXTERNAL_REFERENCE); 88 __ call(start, RelocInfo::EXTERNAL_REFERENCE);
87 89
88 __ add(esp, Immediate(kDoubleSize)); 90 __ add(esp, Immediate(kDoubleSize));
89 91
90 // Make sure no registers have been unexpectedly clobbered 92 // Make sure no registers have been unexpectedly clobbered
91 for (--reg_num; reg_num >= 0; --reg_num) { 93 for (--reg_num; reg_num >= 0; --reg_num) {
92 Register reg = Register::FromAllocationIndex(reg_num); 94 Register reg = Register::from_code(reg_num);
93 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) { 95 if (reg.IsAllocatable()) {
94 __ cmp(reg, MemOperand(esp, 0)); 96 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) {
95 __ Assert(equal, kRegisterWasClobbered); 97 __ cmp(reg, MemOperand(esp, 0));
96 __ add(esp, Immediate(kPointerSize)); 98 __ Assert(equal, kRegisterWasClobbered);
99 __ add(esp, Immediate(kPointerSize));
100 }
97 } 101 }
98 } 102 }
99 103
100 __ mov(eax, destination_reg); 104 __ mov(eax, destination_reg);
101 105
102 __ pop(edi); 106 __ pop(edi);
103 __ pop(esi); 107 __ pop(esi);
104 __ pop(edx); 108 __ pop(edx);
105 __ pop(ecx); 109 __ pop(ecx);
106 __ pop(ebx); 110 __ pop(ebx);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 143
140 for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) { 144 for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) {
141 for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) { 145 for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
142 RunAllTruncationTests( 146 RunAllTruncationTests(
143 MakeConvertDToIFuncTrampoline(isolate, 147 MakeConvertDToIFuncTrampoline(isolate,
144 source_registers[s], 148 source_registers[s],
145 dest_registers[d])); 149 dest_registers[d]));
146 } 150 }
147 } 151 }
148 } 152 }
OLDNEW
« no previous file with comments | « src/x87/macro-assembler-x87.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698