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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, | 302 void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, |
303 InvokeJSFlags flags, | 303 InvokeJSFlags flags, |
304 int arg_count) { | 304 int arg_count) { |
305 Forget(arg_count); | 305 Forget(arg_count); |
306 __ InvokeBuiltin(id, flags); | 306 __ InvokeBuiltin(id, flags); |
307 } | 307 } |
308 | 308 |
309 | 309 |
310 void VirtualFrame::CallLoadIC(Handle<String> name, RelocInfo::Mode mode) { | 310 void VirtualFrame::CallLoadIC(Handle<String> name, RelocInfo::Mode mode) { |
311 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); | 311 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); |
312 SpillAllButCopyTOSToR0(); | 312 PopToR0(); |
| 313 SpillAll(); |
313 __ mov(r2, Operand(name)); | 314 __ mov(r2, Operand(name)); |
314 CallCodeObject(ic, mode, 0); | 315 CallCodeObject(ic, mode, 0); |
315 } | 316 } |
316 | 317 |
317 | 318 |
318 void VirtualFrame::CallStoreIC(Handle<String> name, bool is_contextual) { | 319 void VirtualFrame::CallStoreIC(Handle<String> name, bool is_contextual) { |
319 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); | 320 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); |
320 PopToR0(); | 321 PopToR0(); |
321 if (is_contextual) { | 322 if (is_contextual) { |
322 SpillAll(); | 323 SpillAll(); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 Register answer = kTopRegister[top_of_stack_state_]; | 503 Register answer = kTopRegister[top_of_stack_state_]; |
503 __ pop(answer); | 504 __ pop(answer); |
504 return answer; | 505 return answer; |
505 } else { | 506 } else { |
506 return kTopRegister[top_of_stack_state_]; | 507 return kTopRegister[top_of_stack_state_]; |
507 } | 508 } |
508 } | 509 } |
509 | 510 |
510 | 511 |
511 void VirtualFrame::Dup() { | 512 void VirtualFrame::Dup() { |
512 AssertIsNotSpilled(); | 513 if (SpilledScope::is_spilled()) { |
513 switch (top_of_stack_state_) { | 514 __ ldr(ip, MemOperand(sp, 0)); |
514 case NO_TOS_REGISTERS: | 515 __ push(ip); |
515 __ ldr(r0, MemOperand(sp, 0)); | 516 } else { |
516 top_of_stack_state_ = R0_TOS; | 517 switch (top_of_stack_state_) { |
517 break; | 518 case NO_TOS_REGISTERS: |
518 case R0_TOS: | 519 __ ldr(r0, MemOperand(sp, 0)); |
519 __ mov(r1, r0); | 520 top_of_stack_state_ = R0_TOS; |
520 // r0 and r1 contains the same value. Prefer a state with r0 holding TOS. | 521 break; |
521 top_of_stack_state_ = R0_R1_TOS; | 522 case R0_TOS: |
522 break; | 523 __ mov(r1, r0); |
523 case R1_TOS: | 524 // r0 and r1 contains the same value. Prefer state with r0 holding TOS. |
524 __ mov(r0, r1); | 525 top_of_stack_state_ = R0_R1_TOS; |
525 // r0 and r1 contains the same value. Prefer a state with r0 holding TOS. | 526 break; |
526 top_of_stack_state_ = R0_R1_TOS; | 527 case R1_TOS: |
527 break; | 528 __ mov(r0, r1); |
528 case R0_R1_TOS: | 529 // r0 and r1 contains the same value. Prefer state with r0 holding TOS. |
529 __ push(r1); | 530 top_of_stack_state_ = R0_R1_TOS; |
530 __ mov(r1, r0); | 531 break; |
531 // r0 and r1 contains the same value. Prefer a state with r0 holding TOS. | 532 case R0_R1_TOS: |
532 top_of_stack_state_ = R0_R1_TOS; | 533 __ push(r1); |
533 break; | 534 __ mov(r1, r0); |
534 case R1_R0_TOS: | 535 // r0 and r1 contains the same value. Prefer state with r0 holding TOS. |
535 __ push(r0); | 536 top_of_stack_state_ = R0_R1_TOS; |
536 __ mov(r0, r1); | 537 break; |
537 // r0 and r1 contains the same value. Prefer a state with r0 holding TOS. | 538 case R1_R0_TOS: |
538 top_of_stack_state_ = R0_R1_TOS; | 539 __ push(r0); |
539 break; | 540 __ mov(r0, r1); |
540 default: | 541 // r0 and r1 contains the same value. Prefer state with r0 holding TOS. |
541 UNREACHABLE(); | 542 top_of_stack_state_ = R0_R1_TOS; |
| 543 break; |
| 544 default: |
| 545 UNREACHABLE(); |
| 546 } |
542 } | 547 } |
543 element_count_++; | 548 element_count_++; |
544 } | 549 } |
545 | 550 |
546 | 551 |
547 void VirtualFrame::Dup2() { | 552 void VirtualFrame::Dup2() { |
548 if (SpilledScope::is_spilled()) { | 553 if (SpilledScope::is_spilled()) { |
549 __ ldr(ip, MemOperand(sp, kPointerSize)); | 554 __ ldr(ip, MemOperand(sp, kPointerSize)); |
550 __ push(ip); | 555 __ push(ip); |
551 __ ldr(ip, MemOperand(sp, kPointerSize)); | 556 __ ldr(ip, MemOperand(sp, kPointerSize)); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 break; | 753 break; |
749 } | 754 } |
750 ASSERT(register_allocation_map_ == 0); // Not yet implemented. | 755 ASSERT(register_allocation_map_ == 0); // Not yet implemented. |
751 } | 756 } |
752 | 757 |
753 #undef __ | 758 #undef __ |
754 | 759 |
755 } } // namespace v8::internal | 760 } } // namespace v8::internal |
756 | 761 |
757 #endif // V8_TARGET_ARCH_ARM | 762 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |