| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 497 |
| 498 if (id == IC::kCallIC_Miss) { | 498 if (id == IC::kCallIC_Miss) { |
| 499 __ IncrementCounter(isolate->counters()->call_miss(), 1, a3, t0); | 499 __ IncrementCounter(isolate->counters()->call_miss(), 1, a3, t0); |
| 500 } else { | 500 } else { |
| 501 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, a3, t0); | 501 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, a3, t0); |
| 502 } | 502 } |
| 503 | 503 |
| 504 // Get the receiver of the function from the stack. | 504 // Get the receiver of the function from the stack. |
| 505 __ lw(a3, MemOperand(sp, argc*kPointerSize)); | 505 __ lw(a3, MemOperand(sp, argc*kPointerSize)); |
| 506 | 506 |
| 507 __ EnterInternalFrame(); | 507 { |
| 508 FrameScope scope(masm, StackFrame::INTERNAL); |
| 508 | 509 |
| 509 // Push the receiver and the name of the function. | 510 // Push the receiver and the name of the function. |
| 510 __ Push(a3, a2); | 511 __ Push(a3, a2); |
| 511 | 512 |
| 512 // Call the entry. | 513 // Call the entry. |
| 513 __ li(a0, Operand(2)); | 514 __ li(a0, Operand(2)); |
| 514 __ li(a1, Operand(ExternalReference(IC_Utility(id), isolate))); | 515 __ li(a1, Operand(ExternalReference(IC_Utility(id), isolate))); |
| 515 | 516 |
| 516 CEntryStub stub(1); | 517 CEntryStub stub(1); |
| 517 __ CallStub(&stub); | 518 __ CallStub(&stub); |
| 518 | 519 |
| 519 // Move result to a1 and leave the internal frame. | 520 // Move result to a1 and leave the internal frame. |
| 520 __ mov(a1, v0); | 521 __ mov(a1, v0); |
| 521 __ LeaveInternalFrame(); | 522 } |
| 522 | 523 |
| 523 // Check if the receiver is a global object of some sort. | 524 // Check if the receiver is a global object of some sort. |
| 524 // This can happen only for regular CallIC but not KeyedCallIC. | 525 // This can happen only for regular CallIC but not KeyedCallIC. |
| 525 if (id == IC::kCallIC_Miss) { | 526 if (id == IC::kCallIC_Miss) { |
| 526 Label invoke, global; | 527 Label invoke, global; |
| 527 __ lw(a2, MemOperand(sp, argc * kPointerSize)); | 528 __ lw(a2, MemOperand(sp, argc * kPointerSize)); |
| 528 __ andi(t0, a2, kSmiTagMask); | 529 __ andi(t0, a2, kSmiTagMask); |
| 529 __ Branch(&invoke, eq, t0, Operand(zero_reg)); | 530 __ Branch(&invoke, eq, t0, Operand(zero_reg)); |
| 530 __ GetObjectType(a2, a3, a3); | 531 __ GetObjectType(a2, a3, a3); |
| 531 __ Branch(&global, eq, a3, Operand(JS_GLOBAL_OBJECT_TYPE)); | 532 __ Branch(&global, eq, a3, Operand(JS_GLOBAL_OBJECT_TYPE)); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 __ sra(a0, a2, kSmiTagSize); | 643 __ sra(a0, a2, kSmiTagSize); |
| 643 // a0: untagged index | 644 // a0: untagged index |
| 644 __ LoadFromNumberDictionary(&slow_load, t0, a2, a1, a0, a3, t1); | 645 __ LoadFromNumberDictionary(&slow_load, t0, a2, a1, a0, a3, t1); |
| 645 __ IncrementCounter(counters->keyed_call_generic_smi_dict(), 1, a0, a3); | 646 __ IncrementCounter(counters->keyed_call_generic_smi_dict(), 1, a0, a3); |
| 646 __ jmp(&do_call); | 647 __ jmp(&do_call); |
| 647 | 648 |
| 648 __ bind(&slow_load); | 649 __ bind(&slow_load); |
| 649 // This branch is taken when calling KeyedCallIC_Miss is neither required | 650 // This branch is taken when calling KeyedCallIC_Miss is neither required |
| 650 // nor beneficial. | 651 // nor beneficial. |
| 651 __ IncrementCounter(counters->keyed_call_generic_slow_load(), 1, a0, a3); | 652 __ IncrementCounter(counters->keyed_call_generic_slow_load(), 1, a0, a3); |
| 652 __ EnterInternalFrame(); | 653 { |
| 653 __ push(a2); // Save the key. | 654 FrameScope scope(masm, StackFrame::INTERNAL); |
| 654 __ Push(a1, a2); // Pass the receiver and the key. | 655 __ push(a2); // Save the key. |
| 655 __ CallRuntime(Runtime::kKeyedGetProperty, 2); | 656 __ Push(a1, a2); // Pass the receiver and the key. |
| 656 __ pop(a2); // Restore the key. | 657 __ CallRuntime(Runtime::kKeyedGetProperty, 2); |
| 657 __ LeaveInternalFrame(); | 658 __ pop(a2); // Restore the key. |
| 659 } |
| 658 __ mov(a1, v0); | 660 __ mov(a1, v0); |
| 659 __ jmp(&do_call); | 661 __ jmp(&do_call); |
| 660 | 662 |
| 661 __ bind(&check_string); | 663 __ bind(&check_string); |
| 662 GenerateKeyStringCheck(masm, a2, a0, a3, &index_string, &slow_call); | 664 GenerateKeyStringCheck(masm, a2, a0, a3, &index_string, &slow_call); |
| 663 | 665 |
| 664 // The key is known to be a symbol. | 666 // The key is known to be a symbol. |
| 665 // If the receiver is a regular JS object with slow properties then do | 667 // If the receiver is a regular JS object with slow properties then do |
| 666 // a quick inline probe of the receiver's dictionary. | 668 // a quick inline probe of the receiver's dictionary. |
| 667 // Otherwise do the monomorphic cache probe. | 669 // Otherwise do the monomorphic cache probe. |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1626 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); | 1628 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); |
| 1627 patcher.masm()->andi(at, reg, kSmiTagMask); | 1629 patcher.masm()->andi(at, reg, kSmiTagMask); |
| 1628 patcher.ChangeBranchCondition(eq); | 1630 patcher.ChangeBranchCondition(eq); |
| 1629 } | 1631 } |
| 1630 } | 1632 } |
| 1631 | 1633 |
| 1632 | 1634 |
| 1633 } } // namespace v8::internal | 1635 } } // namespace v8::internal |
| 1634 | 1636 |
| 1635 #endif // V8_TARGET_ARCH_MIPS | 1637 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |