OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 // Search the dictionary - put result in register a1. | 479 // Search the dictionary - put result in register a1. |
480 GenerateDictionaryLoad(masm, &miss, a0, a2, a1, a3, t0); | 480 GenerateDictionaryLoad(masm, &miss, a0, a2, a1, a3, t0); |
481 | 481 |
482 GenerateFunctionTailCall(masm, argc, &miss, t0); | 482 GenerateFunctionTailCall(masm, argc, &miss, t0); |
483 | 483 |
484 // Cache miss: Jump to runtime. | 484 // Cache miss: Jump to runtime. |
485 __ bind(&miss); | 485 __ bind(&miss); |
486 } | 486 } |
487 | 487 |
488 | 488 |
489 static void GenerateCallMiss(MacroAssembler* masm, | 489 void CallICBase::GenerateMiss(MacroAssembler* masm, |
490 int argc, | 490 int argc, |
491 IC::UtilityId id, | 491 IC::UtilityId id, |
492 Code::ExtraICState extra_ic_state) { | 492 Code::ExtraICState extra_state) { |
493 // ----------- S t a t e ------------- | 493 // ----------- S t a t e ------------- |
494 // -- a2 : name | 494 // -- a2 : name |
495 // -- ra : return address | 495 // -- ra : return address |
496 // ----------------------------------- | 496 // ----------------------------------- |
497 Isolate* isolate = masm->isolate(); | 497 Isolate* isolate = masm->isolate(); |
498 | 498 |
499 if (id == IC::kCallIC_Miss) { | 499 if (id == IC::kCallIC_Miss) { |
500 __ IncrementCounter(isolate->counters()->call_miss(), 1, a3, t0); | 500 __ IncrementCounter(isolate->counters()->call_miss(), 1, a3, t0); |
501 } else { | 501 } else { |
502 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, a3, t0); | 502 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, a3, t0); |
(...skipping 30 matching lines...) Expand all Loading... |
533 __ Branch(&global, eq, a3, Operand(JS_GLOBAL_OBJECT_TYPE)); | 533 __ Branch(&global, eq, a3, Operand(JS_GLOBAL_OBJECT_TYPE)); |
534 __ Branch(&invoke, ne, a3, Operand(JS_BUILTINS_OBJECT_TYPE)); | 534 __ Branch(&invoke, ne, a3, Operand(JS_BUILTINS_OBJECT_TYPE)); |
535 | 535 |
536 // Patch the receiver on the stack. | 536 // Patch the receiver on the stack. |
537 __ bind(&global); | 537 __ bind(&global); |
538 __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalReceiverOffset)); | 538 __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalReceiverOffset)); |
539 __ sw(a2, MemOperand(sp, argc * kPointerSize)); | 539 __ sw(a2, MemOperand(sp, argc * kPointerSize)); |
540 __ bind(&invoke); | 540 __ bind(&invoke); |
541 } | 541 } |
542 // Invoke the function. | 542 // Invoke the function. |
543 CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state) | 543 CallKind call_kind = CallICBase::Contextual::decode(extra_state) |
544 ? CALL_AS_FUNCTION | 544 ? CALL_AS_FUNCTION |
545 : CALL_AS_METHOD; | 545 : CALL_AS_METHOD; |
546 ParameterCount actual(argc); | 546 ParameterCount actual(argc); |
547 __ InvokeFunction(a1, | 547 __ InvokeFunction(a1, |
548 actual, | 548 actual, |
549 JUMP_FUNCTION, | 549 JUMP_FUNCTION, |
550 NullCallWrapper(), | 550 NullCallWrapper(), |
551 call_kind); | 551 call_kind); |
552 } | 552 } |
553 | 553 |
554 | 554 |
555 void CallIC::GenerateMiss(MacroAssembler* masm, | |
556 int argc, | |
557 Code::ExtraICState extra_ic_state) { | |
558 // ----------- S t a t e ------------- | |
559 // -- a2 : name | |
560 // -- ra : return address | |
561 // ----------------------------------- | |
562 | |
563 GenerateCallMiss(masm, argc, IC::kCallIC_Miss, extra_ic_state); | |
564 } | |
565 | |
566 | |
567 void CallIC::GenerateMegamorphic(MacroAssembler* masm, | 555 void CallIC::GenerateMegamorphic(MacroAssembler* masm, |
568 int argc, | 556 int argc, |
569 Code::ExtraICState extra_ic_state) { | 557 Code::ExtraICState extra_ic_state) { |
570 // ----------- S t a t e ------------- | 558 // ----------- S t a t e ------------- |
571 // -- a2 : name | 559 // -- a2 : name |
572 // -- ra : return address | 560 // -- ra : return address |
573 // ----------------------------------- | 561 // ----------------------------------- |
574 | 562 |
575 // Get the receiver of the function from the stack into a1. | 563 // Get the receiver of the function from the stack into a1. |
576 __ lw(a1, MemOperand(sp, argc * kPointerSize)); | 564 __ lw(a1, MemOperand(sp, argc * kPointerSize)); |
577 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); | 565 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); |
578 GenerateMiss(masm, argc, extra_ic_state); | 566 GenerateMiss(masm, argc, extra_ic_state); |
579 } | 567 } |
580 | 568 |
581 | 569 |
582 void CallIC::GenerateNormal(MacroAssembler* masm, int argc) { | 570 void CallIC::GenerateNormal(MacroAssembler* masm, int argc) { |
583 // ----------- S t a t e ------------- | 571 // ----------- S t a t e ------------- |
584 // -- a2 : name | 572 // -- a2 : name |
585 // -- ra : return address | 573 // -- ra : return address |
586 // ----------------------------------- | 574 // ----------------------------------- |
587 | 575 |
588 GenerateCallNormal(masm, argc); | 576 GenerateCallNormal(masm, argc); |
589 GenerateMiss(masm, argc, Code::kNoExtraICState); | 577 GenerateMiss(masm, argc, Code::kNoExtraICState); |
590 } | 578 } |
591 | 579 |
592 | 580 |
593 void KeyedCallIC::GenerateMiss(MacroAssembler* masm, int argc) { | |
594 // ----------- S t a t e ------------- | |
595 // -- a2 : name | |
596 // -- ra : return address | |
597 // ----------------------------------- | |
598 | |
599 GenerateCallMiss(masm, argc, IC::kKeyedCallIC_Miss, Code::kNoExtraICState); | |
600 } | |
601 | |
602 | |
603 void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { | 581 void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { |
604 // ----------- S t a t e ------------- | 582 // ----------- S t a t e ------------- |
605 // -- a2 : name | 583 // -- a2 : name |
606 // -- ra : return address | 584 // -- ra : return address |
607 // ----------------------------------- | 585 // ----------------------------------- |
608 | 586 |
609 // Get the receiver of the function from the stack into a1. | 587 // Get the receiver of the function from the stack into a1. |
610 __ lw(a1, MemOperand(sp, argc * kPointerSize)); | 588 __ lw(a1, MemOperand(sp, argc * kPointerSize)); |
611 | 589 |
612 Label do_call, slow_call, slow_load, slow_reload_receiver; | 590 Label do_call, slow_call, slow_load, slow_reload_receiver; |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1664 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); | 1642 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); |
1665 patcher.masm()->andi(at, reg, kSmiTagMask); | 1643 patcher.masm()->andi(at, reg, kSmiTagMask); |
1666 patcher.ChangeBranchCondition(eq); | 1644 patcher.ChangeBranchCondition(eq); |
1667 } | 1645 } |
1668 } | 1646 } |
1669 | 1647 |
1670 | 1648 |
1671 } } // namespace v8::internal | 1649 } } // namespace v8::internal |
1672 | 1650 |
1673 #endif // V8_TARGET_ARCH_MIPS | 1651 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |