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

Side by Side Diff: src/x64/debug-x64.cc

Issue 22348005: Introduce PushInt64AsTwoSmis and PopInt64AsTwoSmis macro instructions for X64 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/x64/macro-assembler-x64.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 ASSERT((object_regs & ~kJSCallerSaved) == 0); 116 ASSERT((object_regs & ~kJSCallerSaved) == 0);
117 ASSERT((non_object_regs & ~kJSCallerSaved) == 0); 117 ASSERT((non_object_regs & ~kJSCallerSaved) == 0);
118 ASSERT((object_regs & non_object_regs) == 0); 118 ASSERT((object_regs & non_object_regs) == 0);
119 for (int i = 0; i < kNumJSCallerSaved; i++) { 119 for (int i = 0; i < kNumJSCallerSaved; i++) {
120 int r = JSCallerSavedCode(i); 120 int r = JSCallerSavedCode(i);
121 Register reg = { r }; 121 Register reg = { r };
122 ASSERT(!reg.is(kScratchRegister)); 122 ASSERT(!reg.is(kScratchRegister));
123 if ((object_regs & (1 << r)) != 0) { 123 if ((object_regs & (1 << r)) != 0) {
124 __ push(reg); 124 __ push(reg);
125 } 125 }
126 // Store the 64-bit value as two smis.
127 if ((non_object_regs & (1 << r)) != 0) { 126 if ((non_object_regs & (1 << r)) != 0) {
128 __ movq(kScratchRegister, reg); 127 __ PushInt64AsTwoSmis(reg);
129 __ Integer32ToSmi(reg, reg);
130 __ push(reg);
131 __ sar(kScratchRegister, Immediate(32));
132 __ Integer32ToSmi(kScratchRegister, kScratchRegister);
133 __ push(kScratchRegister);
134 } 128 }
135 } 129 }
136 130
137 #ifdef DEBUG 131 #ifdef DEBUG
138 __ RecordComment("// Calling from debug break to runtime - come in - over"); 132 __ RecordComment("// Calling from debug break to runtime - come in - over");
139 #endif 133 #endif
140 __ Set(rax, 0); // No arguments (argc == 0). 134 __ Set(rax, 0); // No arguments (argc == 0).
141 __ movq(rbx, ExternalReference::debug_break(masm->isolate())); 135 __ movq(rbx, ExternalReference::debug_break(masm->isolate()));
142 136
143 CEntryStub ceb(1); 137 CEntryStub ceb(1);
144 __ CallStub(&ceb); 138 __ CallStub(&ceb);
145 139
146 // Restore the register values from the expression stack. 140 // Restore the register values from the expression stack.
147 for (int i = kNumJSCallerSaved - 1; i >= 0; i--) { 141 for (int i = kNumJSCallerSaved - 1; i >= 0; i--) {
148 int r = JSCallerSavedCode(i); 142 int r = JSCallerSavedCode(i);
149 Register reg = { r }; 143 Register reg = { r };
150 if (FLAG_debug_code) { 144 if (FLAG_debug_code) {
151 __ Set(reg, kDebugZapValue); 145 __ Set(reg, kDebugZapValue);
152 } 146 }
153 if ((object_regs & (1 << r)) != 0) { 147 if ((object_regs & (1 << r)) != 0) {
154 __ pop(reg); 148 __ pop(reg);
155 } 149 }
156 // Reconstruct the 64-bit value from two smis. 150 // Reconstruct the 64-bit value from two smis.
157 if ((non_object_regs & (1 << r)) != 0) { 151 if ((non_object_regs & (1 << r)) != 0) {
158 __ pop(kScratchRegister); 152 __ PopInt64AsTwoSmis(reg);
159 __ SmiToInteger32(kScratchRegister, kScratchRegister);
160 __ shl(kScratchRegister, Immediate(32));
161 __ pop(reg);
162 __ SmiToInteger32(reg, reg);
163 __ or_(reg, kScratchRegister);
164 } 153 }
165 } 154 }
166 155
167 // Read current padding counter and skip corresponding number of words. 156 // Read current padding counter and skip corresponding number of words.
168 __ pop(kScratchRegister); 157 __ pop(kScratchRegister);
169 __ SmiToInteger32(kScratchRegister, kScratchRegister); 158 __ SmiToInteger32(kScratchRegister, kScratchRegister);
170 __ lea(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0)); 159 __ lea(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0));
171 160
172 // Get rid of the internal frame. 161 // Get rid of the internal frame.
173 } 162 }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 342
354 const bool Debug::kFrameDropperSupported = true; 343 const bool Debug::kFrameDropperSupported = true;
355 344
356 #undef __ 345 #undef __
357 346
358 #endif // ENABLE_DEBUGGER_SUPPORT 347 #endif // ENABLE_DEBUGGER_SUPPORT
359 348
360 } } // namespace v8::internal 349 } } // namespace v8::internal
361 350
362 #endif // V8_TARGET_ARCH_X64 351 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698