| 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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1565 } | 1567 } | 
| 1566 | 1568 | 
| 1567 | 1569 | 
| 1568 void PatchInlinedSmiCode(Address address) { | 1570 void PatchInlinedSmiCode(Address address) { | 
| 1569   Address andi_instruction_address = | 1571   Address andi_instruction_address = | 
| 1570       address + Assembler::kCallTargetAddressOffset; | 1572       address + Assembler::kCallTargetAddressOffset; | 
| 1571 | 1573 | 
| 1572   // If the instruction following the call is not a andi at, rx, #yyy, nothing | 1574   // If the instruction following the call is not a andi at, rx, #yyy, nothing | 
| 1573   // was inlined. | 1575   // was inlined. | 
| 1574   Instr instr = Assembler::instr_at(andi_instruction_address); | 1576   Instr instr = Assembler::instr_at(andi_instruction_address); | 
| 1575   if (!Assembler::IsAndImmediate(instr)) { | 1577   if (!(Assembler::IsAndImmediate(instr) && | 
|  | 1578         Assembler::GetRt(instr) == (uint32_t)zero_reg.code())) { | 
| 1576     return; | 1579     return; | 
| 1577   } | 1580   } | 
| 1578 | 1581 | 
| 1579   // The delta to the start of the map check instruction and the | 1582   // The delta to the start of the map check instruction and the | 
| 1580   // condition code uses at the patched jump. | 1583   // condition code uses at the patched jump. | 
| 1581   int delta = Assembler::GetImmediate16(instr); | 1584   int delta = Assembler::GetImmediate16(instr); | 
| 1582   delta += Assembler::GetRs(instr) * kImm16Mask; | 1585   delta += Assembler::GetRs(instr) * kImm16Mask; | 
| 1583   // If the delta is 0 the instruction is andi at, zero_reg, #0 which also | 1586   // If the delta is 0 the instruction is andi at, zero_reg, #0 which also | 
| 1584   // signals that nothing was inlined. | 1587   // signals that nothing was inlined. | 
| 1585   if (delta == 0) { | 1588   if (delta == 0) { | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1626     Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); | 1629     Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); | 
| 1627     patcher.masm()->andi(at, reg, kSmiTagMask); | 1630     patcher.masm()->andi(at, reg, kSmiTagMask); | 
| 1628     patcher.ChangeBranchCondition(eq); | 1631     patcher.ChangeBranchCondition(eq); | 
| 1629   } | 1632   } | 
| 1630 } | 1633 } | 
| 1631 | 1634 | 
| 1632 | 1635 | 
| 1633 } }  // namespace v8::internal | 1636 } }  // namespace v8::internal | 
| 1634 | 1637 | 
| 1635 #endif  // V8_TARGET_ARCH_MIPS | 1638 #endif  // V8_TARGET_ARCH_MIPS | 
| OLD | NEW | 
|---|