Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: src/arm/virtual-frame-arm.cc

Issue 2828004: ARM: Remove a bunch of spilled scopes. Still a lot to go. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 __ Push(r0, r1); 474 __ Push(r0, r1);
475 __ mov(r0, r1); 475 __ mov(r0, r1);
476 break; 476 break;
477 default: 477 default:
478 UNREACHABLE(); 478 UNREACHABLE();
479 } 479 }
480 top_of_stack_state_ = NO_TOS_REGISTERS; 480 top_of_stack_state_ = NO_TOS_REGISTERS;
481 } 481 }
482 482
483 483
484 void VirtualFrame::SpillAllButCopyTOSToR1() {
485 switch (top_of_stack_state_) {
486 case NO_TOS_REGISTERS:
487 __ ldr(r1, MemOperand(sp, 0));
488 break;
489 case R0_TOS:
490 __ push(r0);
491 __ mov(r1, r0);
492 break;
493 case R1_TOS:
494 __ push(r1);
495 break;
496 case R0_R1_TOS:
497 __ Push(r1, r0);
498 __ mov(r1, r0);
499 break;
500 case R1_R0_TOS:
501 __ Push(r0, r1);
502 break;
503 default:
504 UNREACHABLE();
505 }
506 top_of_stack_state_ = NO_TOS_REGISTERS;
507 }
508
509
484 void VirtualFrame::SpillAllButCopyTOSToR1R0() { 510 void VirtualFrame::SpillAllButCopyTOSToR1R0() {
485 switch (top_of_stack_state_) { 511 switch (top_of_stack_state_) {
486 case NO_TOS_REGISTERS: 512 case NO_TOS_REGISTERS:
487 __ ldr(r1, MemOperand(sp, 0)); 513 __ ldr(r1, MemOperand(sp, 0));
488 __ ldr(r0, MemOperand(sp, kPointerSize)); 514 __ ldr(r0, MemOperand(sp, kPointerSize));
489 break; 515 break;
490 case R0_TOS: 516 case R0_TOS:
491 __ push(r0); 517 __ push(r0);
492 __ mov(r1, r0); 518 __ mov(r1, r0);
493 __ ldr(r0, MemOperand(sp, kPointerSize)); 519 __ ldr(r0, MemOperand(sp, kPointerSize));
(...skipping 22 matching lines...) Expand all
516 top_of_stack_state_ = kStateAfterPush[top_of_stack_state_]; 542 top_of_stack_state_ = kStateAfterPush[top_of_stack_state_];
517 Register answer = kTopRegister[top_of_stack_state_]; 543 Register answer = kTopRegister[top_of_stack_state_];
518 __ pop(answer); 544 __ pop(answer);
519 return answer; 545 return answer;
520 } else { 546 } else {
521 return kTopRegister[top_of_stack_state_]; 547 return kTopRegister[top_of_stack_state_];
522 } 548 }
523 } 549 }
524 550
525 551
552 Register VirtualFrame::Peek2() {
553 AssertIsNotSpilled();
554 switch(top_of_stack_state_) {
555 case NO_TOS_REGISTERS:
556 case R0_TOS:
557 case R0_R1_TOS:
558 MergeTOSTo(R0_R1_TOS);
559 return r0;
560 case R1_TOS:
561 case R1_R0_TOS:
562 MergeTOSTo(R1_R0_TOS);
563 return r1;
564 }
565 UNREACHABLE();
566 return no_reg;
567 }
568
569
526 void VirtualFrame::Dup() { 570 void VirtualFrame::Dup() {
527 if (SpilledScope::is_spilled()) { 571 if (SpilledScope::is_spilled()) {
528 __ ldr(ip, MemOperand(sp, 0)); 572 __ ldr(ip, MemOperand(sp, 0));
529 __ push(ip); 573 __ push(ip);
530 } else { 574 } else {
531 switch (top_of_stack_state_) { 575 switch (top_of_stack_state_) {
532 case NO_TOS_REGISTERS: 576 case NO_TOS_REGISTERS:
533 __ ldr(r0, MemOperand(sp, 0)); 577 __ ldr(r0, MemOperand(sp, 0));
534 top_of_stack_state_ = R0_TOS; 578 top_of_stack_state_ = R0_TOS;
535 break; 579 break;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 break; 824 break;
781 } 825 }
782 ASSERT(register_allocation_map_ == 0); // Not yet implemented. 826 ASSERT(register_allocation_map_ == 0); // Not yet implemented.
783 } 827 }
784 828
785 #undef __ 829 #undef __
786 830
787 } } // namespace v8::internal 831 } } // namespace v8::internal
788 832
789 #endif // V8_TARGET_ARCH_ARM 833 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« src/arm/virtual-frame-arm.h ('K') | « src/arm/virtual-frame-arm.h ('k') | src/ast-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698