OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 365 |
366 // The deoptimization jump table is the last part of the instruction | 366 // The deoptimization jump table is the last part of the instruction |
367 // sequence. Mark the generated code as done unless we bailed out. | 367 // sequence. Mark the generated code as done unless we bailed out. |
368 if (!is_aborted()) status_ = DONE; | 368 if (!is_aborted()) status_ = DONE; |
369 return !is_aborted(); | 369 return !is_aborted(); |
370 } | 370 } |
371 | 371 |
372 | 372 |
373 bool LCodeGen::GenerateSafepointTable() { | 373 bool LCodeGen::GenerateSafepointTable() { |
374 DCHECK(is_done()); | 374 DCHECK(is_done()); |
375 safepoints_.Emit(masm(), GetTotalFrameSlotCount()); | 375 safepoints_.Emit(masm(), GetStackSlotCount()); |
376 return !is_aborted(); | 376 return !is_aborted(); |
377 } | 377 } |
378 | 378 |
379 | 379 |
380 Register LCodeGen::ToRegister(int index) const { | 380 Register LCodeGen::ToRegister(int index) const { |
381 return Register::from_code(index); | 381 return Register::from_code(index); |
382 } | 382 } |
383 | 383 |
384 | 384 |
385 DoubleRegister LCodeGen::ToDoubleRegister(int index) const { | 385 DoubleRegister LCodeGen::ToDoubleRegister(int index) const { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 DCHECK(index < 0); | 538 DCHECK(index < 0); |
539 return -(index + 1) * kPointerSize; | 539 return -(index + 1) * kPointerSize; |
540 } | 540 } |
541 | 541 |
542 | 542 |
543 MemOperand LCodeGen::ToMemOperand(LOperand* op) const { | 543 MemOperand LCodeGen::ToMemOperand(LOperand* op) const { |
544 DCHECK(!op->IsRegister()); | 544 DCHECK(!op->IsRegister()); |
545 DCHECK(!op->IsDoubleRegister()); | 545 DCHECK(!op->IsDoubleRegister()); |
546 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 546 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
547 if (NeedsEagerFrame()) { | 547 if (NeedsEagerFrame()) { |
548 return MemOperand(fp, FrameSlotToFPOffset(op->index())); | 548 return MemOperand(fp, StackSlotOffset(op->index())); |
549 } else { | 549 } else { |
550 // Retrieve parameter without eager stack-frame relative to the | 550 // Retrieve parameter without eager stack-frame relative to the |
551 // stack-pointer. | 551 // stack-pointer. |
552 return MemOperand(sp, ArgumentsOffsetWithoutFrame(op->index())); | 552 return MemOperand(sp, ArgumentsOffsetWithoutFrame(op->index())); |
553 } | 553 } |
554 } | 554 } |
555 | 555 |
556 | 556 |
557 MemOperand LCodeGen::ToHighMemOperand(LOperand* op) const { | 557 MemOperand LCodeGen::ToHighMemOperand(LOperand* op) const { |
558 DCHECK(op->IsDoubleStackSlot()); | 558 DCHECK(op->IsDoubleStackSlot()); |
559 if (NeedsEagerFrame()) { | 559 if (NeedsEagerFrame()) { |
560 return MemOperand(fp, FrameSlotToFPOffset(op->index()) + kPointerSize); | 560 return MemOperand(fp, StackSlotOffset(op->index()) + kPointerSize); |
561 } else { | 561 } else { |
562 // Retrieve parameter without eager stack-frame relative to the | 562 // Retrieve parameter without eager stack-frame relative to the |
563 // stack-pointer. | 563 // stack-pointer. |
564 return MemOperand( | 564 return MemOperand( |
565 sp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize); | 565 sp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize); |
566 } | 566 } |
567 } | 567 } |
568 | 568 |
569 | 569 |
570 void LCodeGen::WriteTranslation(LEnvironment* environment, | 570 void LCodeGen::WriteTranslation(LEnvironment* environment, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 environment->HasTaggedValueAt(env_offset + i), | 619 environment->HasTaggedValueAt(env_offset + i), |
620 environment->HasUint32ValueAt(env_offset + i), | 620 environment->HasUint32ValueAt(env_offset + i), |
621 object_index_pointer, | 621 object_index_pointer, |
622 dematerialized_index_pointer); | 622 dematerialized_index_pointer); |
623 } | 623 } |
624 return; | 624 return; |
625 } | 625 } |
626 | 626 |
627 if (op->IsStackSlot()) { | 627 if (op->IsStackSlot()) { |
628 int index = op->index(); | 628 int index = op->index(); |
| 629 if (index >= 0) { |
| 630 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 631 } |
629 if (is_tagged) { | 632 if (is_tagged) { |
630 translation->StoreStackSlot(index); | 633 translation->StoreStackSlot(index); |
631 } else if (is_uint32) { | 634 } else if (is_uint32) { |
632 translation->StoreUint32StackSlot(index); | 635 translation->StoreUint32StackSlot(index); |
633 } else { | 636 } else { |
634 translation->StoreInt32StackSlot(index); | 637 translation->StoreInt32StackSlot(index); |
635 } | 638 } |
636 } else if (op->IsDoubleStackSlot()) { | 639 } else if (op->IsDoubleStackSlot()) { |
637 int index = op->index(); | 640 int index = op->index(); |
| 641 if (index >= 0) { |
| 642 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 643 } |
638 translation->StoreDoubleStackSlot(index); | 644 translation->StoreDoubleStackSlot(index); |
639 } else if (op->IsRegister()) { | 645 } else if (op->IsRegister()) { |
640 Register reg = ToRegister(op); | 646 Register reg = ToRegister(op); |
641 if (is_tagged) { | 647 if (is_tagged) { |
642 translation->StoreRegister(reg); | 648 translation->StoreRegister(reg); |
643 } else if (is_uint32) { | 649 } else if (is_uint32) { |
644 translation->StoreUint32Register(reg); | 650 translation->StoreUint32Register(reg); |
645 } else { | 651 } else { |
646 translation->StoreInt32Register(reg); | 652 translation->StoreInt32Register(reg); |
647 } | 653 } |
(...skipping 4919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5567 __ Push(at, ToRegister(instr->function())); | 5573 __ Push(at, ToRegister(instr->function())); |
5568 CallRuntime(Runtime::kPushBlockContext, instr); | 5574 CallRuntime(Runtime::kPushBlockContext, instr); |
5569 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5575 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5570 } | 5576 } |
5571 | 5577 |
5572 | 5578 |
5573 #undef __ | 5579 #undef __ |
5574 | 5580 |
5575 } // namespace internal | 5581 } // namespace internal |
5576 } // namespace v8 | 5582 } // namespace v8 |
OLD | NEW |