OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 RecordComment("Abort message: "); | 495 RecordComment("Abort message: "); |
496 RecordComment(msg); | 496 RecordComment(msg); |
497 } | 497 } |
498 | 498 |
499 if (FLAG_trap_on_abort) { | 499 if (FLAG_trap_on_abort) { |
500 int3(); | 500 int3(); |
501 return; | 501 return; |
502 } | 502 } |
503 #endif | 503 #endif |
504 | 504 |
505 Push(rax); | |
506 Move(kScratchRegister, Smi::FromInt(static_cast<int>(reason)), | 505 Move(kScratchRegister, Smi::FromInt(static_cast<int>(reason)), |
507 Assembler::RelocInfoNone()); | 506 Assembler::RelocInfoNone()); |
508 Push(kScratchRegister); | 507 Push(kScratchRegister); |
509 | 508 |
510 if (!has_frame_) { | 509 if (!has_frame_) { |
511 // We don't actually want to generate a pile of code for this, so just | 510 // We don't actually want to generate a pile of code for this, so just |
512 // claim there is a stack frame, without generating one. | 511 // claim there is a stack frame, without generating one. |
513 FrameScope scope(this, StackFrame::NONE); | 512 FrameScope scope(this, StackFrame::NONE); |
514 CallRuntime(Runtime::kAbort, 1); | 513 CallRuntime(Runtime::kAbort, 1); |
515 } else { | 514 } else { |
(...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3435 testl(result_reg, result_reg); | 3434 testl(result_reg, result_reg); |
3436 j(not_zero, &done, Label::kNear); | 3435 j(not_zero, &done, Label::kNear); |
3437 movmskpd(result_reg, xmm0); | 3436 movmskpd(result_reg, xmm0); |
3438 andl(result_reg, Immediate(1)); | 3437 andl(result_reg, Immediate(1)); |
3439 j(not_zero, lost_precision, dst); | 3438 j(not_zero, lost_precision, dst); |
3440 } | 3439 } |
3441 bind(&done); | 3440 bind(&done); |
3442 } | 3441 } |
3443 | 3442 |
3444 | 3443 |
3445 void MacroAssembler::Throw(BailoutReason reason) { | |
3446 #ifdef DEBUG | |
3447 const char* msg = GetBailoutReason(reason); | |
3448 if (msg != NULL) { | |
3449 RecordComment("Throw message: "); | |
3450 RecordComment(msg); | |
3451 } | |
3452 #endif | |
3453 | |
3454 Push(rax); | |
3455 Push(Smi::FromInt(reason)); | |
3456 if (!has_frame_) { | |
3457 // We don't actually want to generate a pile of code for this, so just | |
3458 // claim there is a stack frame, without generating one. | |
3459 FrameScope scope(this, StackFrame::NONE); | |
3460 CallRuntime(Runtime::kHiddenThrowMessage, 1); | |
3461 } else { | |
3462 CallRuntime(Runtime::kHiddenThrowMessage, 1); | |
3463 } | |
3464 // Control will not return here. | |
3465 int3(); | |
3466 } | |
3467 | |
3468 | |
3469 void MacroAssembler::ThrowIf(Condition cc, BailoutReason reason) { | |
3470 Label L; | |
3471 j(NegateCondition(cc), &L); | |
3472 Throw(reason); | |
3473 // will not return here | |
3474 bind(&L); | |
3475 } | |
3476 | |
3477 | |
3478 void MacroAssembler::LoadInstanceDescriptors(Register map, | 3444 void MacroAssembler::LoadInstanceDescriptors(Register map, |
3479 Register descriptors) { | 3445 Register descriptors) { |
3480 movp(descriptors, FieldOperand(map, Map::kDescriptorsOffset)); | 3446 movp(descriptors, FieldOperand(map, Map::kDescriptorsOffset)); |
3481 } | 3447 } |
3482 | 3448 |
3483 | 3449 |
3484 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { | 3450 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { |
3485 movl(dst, FieldOperand(map, Map::kBitField3Offset)); | 3451 movl(dst, FieldOperand(map, Map::kBitField3Offset)); |
3486 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); | 3452 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); |
3487 } | 3453 } |
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5211 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); | 5177 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); |
5212 movl(rax, dividend); | 5178 movl(rax, dividend); |
5213 shrl(rax, Immediate(31)); | 5179 shrl(rax, Immediate(31)); |
5214 addl(rdx, rax); | 5180 addl(rdx, rax); |
5215 } | 5181 } |
5216 | 5182 |
5217 | 5183 |
5218 } } // namespace v8::internal | 5184 } } // namespace v8::internal |
5219 | 5185 |
5220 #endif // V8_TARGET_ARCH_X64 | 5186 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |