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

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

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

Powered by Google App Engine
This is Rietveld 408576698