OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 | 534 |
535 | 535 |
536 Register VirtualFrame::GetTOSRegister() { | 536 Register VirtualFrame::GetTOSRegister() { |
537 if (SpilledScope::is_spilled()) return r0; | 537 if (SpilledScope::is_spilled()) return r0; |
538 | 538 |
539 EnsureOneFreeTOSRegister(); | 539 EnsureOneFreeTOSRegister(); |
540 return kTopRegister[kStateAfterPush[top_of_stack_state_]]; | 540 return kTopRegister[kStateAfterPush[top_of_stack_state_]]; |
541 } | 541 } |
542 | 542 |
543 | 543 |
| 544 void VirtualFrame::EmitPush(Operand operand) { |
| 545 element_count_++; |
| 546 if (SpilledScope::is_spilled()) { |
| 547 __ mov(r0, operand); |
| 548 __ push(r0); |
| 549 return; |
| 550 } |
| 551 EnsureOneFreeTOSRegister(); |
| 552 top_of_stack_state_ = kStateAfterPush[top_of_stack_state_]; |
| 553 __ mov(kTopRegister[top_of_stack_state_], operand); |
| 554 } |
| 555 |
| 556 |
544 void VirtualFrame::EmitPush(MemOperand operand) { | 557 void VirtualFrame::EmitPush(MemOperand operand) { |
545 element_count_++; | 558 element_count_++; |
546 if (SpilledScope::is_spilled()) { | 559 if (SpilledScope::is_spilled()) { |
547 __ ldr(r0, operand); | 560 __ ldr(r0, operand); |
548 __ push(r0); | 561 __ push(r0); |
549 return; | 562 return; |
550 } | 563 } |
551 EnsureOneFreeTOSRegister(); | 564 EnsureOneFreeTOSRegister(); |
552 top_of_stack_state_ = kStateAfterPush[top_of_stack_state_]; | 565 top_of_stack_state_ = kStateAfterPush[top_of_stack_state_]; |
553 __ ldr(kTopRegister[top_of_stack_state_], operand); | 566 __ ldr(kTopRegister[top_of_stack_state_], operand); |
554 } | 567 } |
555 | 568 |
556 | 569 |
| 570 void VirtualFrame::EmitPushRoot(Heap::RootListIndex index) { |
| 571 element_count_++; |
| 572 if (SpilledScope::is_spilled()) { |
| 573 __ LoadRoot(r0, index); |
| 574 __ push(r0); |
| 575 return; |
| 576 } |
| 577 EnsureOneFreeTOSRegister(); |
| 578 top_of_stack_state_ = kStateAfterPush[top_of_stack_state_]; |
| 579 __ LoadRoot(kTopRegister[top_of_stack_state_], index); |
| 580 } |
| 581 |
| 582 |
557 void VirtualFrame::EmitPushMultiple(int count, int src_regs) { | 583 void VirtualFrame::EmitPushMultiple(int count, int src_regs) { |
558 ASSERT(SpilledScope::is_spilled()); | 584 ASSERT(SpilledScope::is_spilled()); |
559 Adjust(count); | 585 Adjust(count); |
560 __ stm(db_w, sp, src_regs); | 586 __ stm(db_w, sp, src_regs); |
561 } | 587 } |
562 | 588 |
563 | 589 |
564 void VirtualFrame::SpillAll() { | 590 void VirtualFrame::SpillAll() { |
565 switch (top_of_stack_state_) { | 591 switch (top_of_stack_state_) { |
566 case R1_R0_TOS: | 592 case R1_R0_TOS: |
(...skipping 15 matching lines...) Expand all Loading... |
582 default: | 608 default: |
583 UNREACHABLE(); | 609 UNREACHABLE(); |
584 break; | 610 break; |
585 } | 611 } |
586 ASSERT(register_allocation_map_ == 0); // Not yet implemented. | 612 ASSERT(register_allocation_map_ == 0); // Not yet implemented. |
587 } | 613 } |
588 | 614 |
589 #undef __ | 615 #undef __ |
590 | 616 |
591 } } // namespace v8::internal | 617 } } // namespace v8::internal |
OLD | NEW |