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

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

Issue 50863002: Use register allocator for context on x64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added comment to test case Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-code-stubs-x64.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 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 __ push(edi); 66 __ push(edi);
67 67
68 if (!source_reg.is(esp)) { 68 if (!source_reg.is(esp)) {
69 __ lea(source_reg, MemOperand(esp, 6 * kPointerSize - offset)); 69 __ lea(source_reg, MemOperand(esp, 6 * kPointerSize - offset));
70 } 70 }
71 71
72 int param_offset = 7 * kPointerSize; 72 int param_offset = 7 * kPointerSize;
73 // Save registers make sure they don't get clobbered. 73 // Save registers make sure they don't get clobbered.
74 int reg_num = 0; 74 int reg_num = 0;
75 for (;reg_num < Register::NumAllocatableRegisters(); ++reg_num) { 75 for (;reg_num < Register::NumAllocatableRegisters(); ++reg_num) {
76 Register reg = Register::from_code(reg_num); 76 Register reg = Register::FromAllocationIndex(reg_num);
77 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) { 77 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) {
78 __ push(reg); 78 __ push(reg);
79 param_offset += kPointerSize; 79 param_offset += kPointerSize;
80 } 80 }
81 } 81 }
82 82
83 // Re-push the double argument 83 // Re-push the double argument
84 __ push(MemOperand(esp, param_offset)); 84 __ push(MemOperand(esp, param_offset));
85 __ push(MemOperand(esp, param_offset)); 85 __ push(MemOperand(esp, param_offset));
86 86
87 // Call through to the actual stub 87 // Call through to the actual stub
88 __ call(start, RelocInfo::EXTERNAL_REFERENCE); 88 __ call(start, RelocInfo::EXTERNAL_REFERENCE);
89 89
90 __ add(esp, Immediate(kDoubleSize)); 90 __ add(esp, Immediate(kDoubleSize));
91 91
92 // Make sure no registers have been unexpectedly clobbered 92 // Make sure no registers have been unexpectedly clobbered
93 for (--reg_num; reg_num >= 0; --reg_num) { 93 for (--reg_num; reg_num >= 0; --reg_num) {
94 Register reg = Register::from_code(reg_num); 94 Register reg = Register::FromAllocationIndex(reg_num);
95 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) { 95 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) {
96 __ cmp(reg, MemOperand(esp, 0)); 96 __ cmp(reg, MemOperand(esp, 0));
97 __ Assert(equal, kRegisterWasClobbered); 97 __ Assert(equal, kRegisterWasClobbered);
98 __ add(esp, Immediate(kPointerSize)); 98 __ add(esp, Immediate(kPointerSize));
99 } 99 }
100 } 100 }
101 101
102 __ mov(eax, destination_reg); 102 __ mov(eax, destination_reg);
103 103
104 __ pop(edi); 104 __ pop(edi);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) { 142 for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) {
143 for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) { 143 for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
144 RunAllTruncationTests( 144 RunAllTruncationTests(
145 MakeConvertDToIFuncTrampoline(isolate, 145 MakeConvertDToIFuncTrampoline(isolate,
146 source_registers[s], 146 source_registers[s],
147 dest_registers[d])); 147 dest_registers[d]));
148 } 148 }
149 } 149 }
150 } 150 }
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698