| OLD | NEW |
| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 __ movq(kScratchRegister, reg); |
| 130 #if !V8_USE_31_BITS_SMI_VALUE |
| 130 __ Integer32ToSmi(reg, reg); | 131 __ Integer32ToSmi(reg, reg); |
| 131 __ push(reg); | 132 __ push(reg); |
| 132 __ sar(kScratchRegister, Immediate(32)); | 133 __ sar(kScratchRegister, Immediate(32)); |
| 133 __ Integer32ToSmi(kScratchRegister, kScratchRegister); | 134 __ Integer32ToSmi(kScratchRegister, kScratchRegister); |
| 134 __ push(kScratchRegister); | 135 __ push(kScratchRegister); |
| 136 #else |
| 137 __ shr(reg, Immediate(63)); |
| 138 __ shll(reg, Immediate(1)); |
| 139 __ push(reg); |
| 140 __ shl(kScratchRegister, Immediate(1)); |
| 141 __ push(kScratchRegister); |
| 142 #endif |
| 135 } | 143 } |
| 136 } | 144 } |
| 137 | 145 |
| 138 #ifdef DEBUG | 146 #ifdef DEBUG |
| 139 __ RecordComment("// Calling from debug break to runtime - come in - over"); | 147 __ RecordComment("// Calling from debug break to runtime - come in - over"); |
| 140 #endif | 148 #endif |
| 141 __ Set(rax, 0); // No arguments (argc == 0). | 149 __ Set(rax, 0); // No arguments (argc == 0). |
| 142 __ movq(rbx, ExternalReference::debug_break(masm->isolate())); | 150 __ movq(rbx, ExternalReference::debug_break(masm->isolate())); |
| 143 | 151 |
| 144 CEntryStub ceb(1); | 152 CEntryStub ceb(1); |
| 145 __ CallStub(&ceb); | 153 __ CallStub(&ceb); |
| 146 | 154 |
| 147 // Restore the register values from the expression stack. | 155 // Restore the register values from the expression stack. |
| 148 for (int i = kNumJSCallerSaved - 1; i >= 0; i--) { | 156 for (int i = kNumJSCallerSaved - 1; i >= 0; i--) { |
| 149 int r = JSCallerSavedCode(i); | 157 int r = JSCallerSavedCode(i); |
| 150 Register reg = { r }; | 158 Register reg = { r }; |
| 151 if (FLAG_debug_code) { | 159 if (FLAG_debug_code) { |
| 152 __ Set(reg, kDebugZapValue); | 160 __ Set(reg, kDebugZapValue); |
| 153 } | 161 } |
| 154 if ((object_regs & (1 << r)) != 0) { | 162 if ((object_regs & (1 << r)) != 0) { |
| 155 __ pop(reg); | 163 __ pop(reg); |
| 156 } | 164 } |
| 157 // Reconstruct the 64-bit value from two smis. | 165 // Reconstruct the 64-bit value from two smis. |
| 158 if ((non_object_regs & (1 << r)) != 0) { | 166 if ((non_object_regs & (1 << r)) != 0) { |
| 159 __ pop(kScratchRegister); | 167 __ pop(kScratchRegister); |
| 168 #if !V8_USE_31_BITS_SMI_VALUE |
| 160 __ SmiToInteger32(kScratchRegister, kScratchRegister); | 169 __ SmiToInteger32(kScratchRegister, kScratchRegister); |
| 161 __ shl(kScratchRegister, Immediate(32)); | 170 __ shl(kScratchRegister, Immediate(32)); |
| 162 __ pop(reg); | 171 __ pop(reg); |
| 163 __ SmiToInteger32(reg, reg); | 172 __ SmiToInteger32(reg, reg); |
| 164 __ or_(reg, kScratchRegister); | 173 __ or_(reg, kScratchRegister); |
| 174 #else |
| 175 __ shr(kScratchRegister, Immediate(1)); |
| 176 __ pop(reg); |
| 177 __ shl(reg, Immediate(62)); |
| 178 __ or_(reg, kScratchRegister); |
| 179 #endif |
| 165 } | 180 } |
| 166 } | 181 } |
| 167 | 182 |
| 168 // Read current padding counter and skip corresponding number of words. | 183 // Read current padding counter and skip corresponding number of words. |
| 169 __ pop(kScratchRegister); | 184 __ pop(kScratchRegister); |
| 170 __ SmiToInteger32(kScratchRegister, kScratchRegister); | 185 __ SmiToInteger32(kScratchRegister, kScratchRegister); |
| 171 __ lea(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0)); | 186 __ lea(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0)); |
| 172 | 187 |
| 173 // Get rid of the internal frame. | 188 // Get rid of the internal frame. |
| 174 } | 189 } |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 369 |
| 355 const bool Debug::kFrameDropperSupported = true; | 370 const bool Debug::kFrameDropperSupported = true; |
| 356 | 371 |
| 357 #undef __ | 372 #undef __ |
| 358 | 373 |
| 359 #endif // ENABLE_DEBUGGER_SUPPORT | 374 #endif // ENABLE_DEBUGGER_SUPPORT |
| 360 | 375 |
| 361 } } // namespace v8::internal | 376 } } // namespace v8::internal |
| 362 | 377 |
| 363 #endif // V8_TARGET_ARCH_X64 | 378 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |