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

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

Issue 2092413002: [RegisterConfiguration] Streamline access to arch defaults, simplify Registers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compile. Created 4 years, 5 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 | « test/cctest/test-code-stubs-arm.cc ('k') | test/cctest/test-code-stubs-ia32.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 // Rrdistribution and use in source and binary forms, with or without 2 // Rrdistribution 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 // * Rrdistributions of source code must retain the above copyright 6 // * Rrdistributions 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 // * Rrdistributions in binary form must reproduce the above 8 // * Rrdistributions 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Push the double argument. 67 // Push the double argument.
68 __ Push(d0); 68 __ Push(d0);
69 __ Mov(source_reg, jssp); 69 __ Mov(source_reg, jssp);
70 70
71 MacroAssembler::PushPopQueue queue(&masm); 71 MacroAssembler::PushPopQueue queue(&masm);
72 72
73 // Save registers make sure they don't get clobbered. 73 // Save registers make sure they don't get clobbered.
74 int source_reg_offset = kDoubleSize; 74 int source_reg_offset = kDoubleSize;
75 int reg_num = 0; 75 int reg_num = 0;
76 for (; reg_num < Register::kNumRegisters; ++reg_num) { 76 for (; reg_num < Register::kNumRegisters; ++reg_num) {
77 Register reg = Register::from_code(reg_num); 77 if (RegisterConfiguration::Crankshaft()->IsAllocatableGeneralCode(
78 if (reg.IsAllocatable()) { 78 reg_num)) {
79 Register reg = Register::from_code(reg_num);
79 if (!reg.is(destination_reg)) { 80 if (!reg.is(destination_reg)) {
80 queue.Queue(reg); 81 queue.Queue(reg);
81 source_reg_offset += kPointerSize; 82 source_reg_offset += kPointerSize;
82 } 83 }
83 } 84 }
84 } 85 }
85 // Re-push the double argument. 86 // Re-push the double argument.
86 queue.Queue(d0); 87 queue.Queue(d0);
87 88
88 queue.PushQueued(); 89 queue.PushQueued();
89 90
90 // Call through to the actual stub 91 // Call through to the actual stub
91 if (inline_fastpath) { 92 if (inline_fastpath) {
92 __ Ldr(d0, MemOperand(source_reg)); 93 __ Ldr(d0, MemOperand(source_reg));
93 __ TryConvertDoubleToInt64(destination_reg, d0, &done); 94 __ TryConvertDoubleToInt64(destination_reg, d0, &done);
94 if (destination_reg.is(source_reg)) { 95 if (destination_reg.is(source_reg)) {
95 // Restore clobbered source_reg. 96 // Restore clobbered source_reg.
96 __ add(source_reg, jssp, Operand(source_reg_offset)); 97 __ add(source_reg, jssp, Operand(source_reg_offset));
97 } 98 }
98 } 99 }
99 __ Call(start, RelocInfo::EXTERNAL_REFERENCE); 100 __ Call(start, RelocInfo::EXTERNAL_REFERENCE);
100 __ bind(&done); 101 __ bind(&done);
101 102
102 __ Drop(1, kDoubleSize); 103 __ Drop(1, kDoubleSize);
103 104
104 // // Make sure no registers have been unexpectedly clobbered 105 // // Make sure no registers have been unexpectedly clobbered
105 for (--reg_num; reg_num >= 0; --reg_num) { 106 for (--reg_num; reg_num >= 0; --reg_num) {
106 Register reg = Register::from_code(reg_num); 107 if (RegisterConfiguration::Crankshaft()->IsAllocatableGeneralCode(
107 if (reg.IsAllocatable()) { 108 reg_num)) {
109 Register reg = Register::from_code(reg_num);
108 if (!reg.is(destination_reg)) { 110 if (!reg.is(destination_reg)) {
109 __ Pop(ip0); 111 __ Pop(ip0);
110 __ cmp(reg, ip0); 112 __ cmp(reg, ip0);
111 __ Assert(eq, kRegisterWasClobbered); 113 __ Assert(eq, kRegisterWasClobbered);
112 } 114 }
113 } 115 }
114 } 116 }
115 117
116 __ Drop(1, kDoubleSize); 118 __ Drop(1, kDoubleSize);
117 119
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 false)); 187 false));
186 RunAllTruncationTests( 188 RunAllTruncationTests(
187 RunGeneratedCodeCallWrapper, 189 RunGeneratedCodeCallWrapper,
188 MakeConvertDToIFuncTrampoline(isolate, 190 MakeConvertDToIFuncTrampoline(isolate,
189 source_registers[s], 191 source_registers[s],
190 dest_registers[d], 192 dest_registers[d],
191 true)); 193 true));
192 } 194 }
193 } 195 }
194 } 196 }
OLDNEW
« no previous file with comments | « test/cctest/test-code-stubs-arm.cc ('k') | test/cctest/test-code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698