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