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

Side by Side Diff: src/mips/ic-mips.cc

Issue 148343005: A64: Synchronize with r18147. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 339
340 340
341 // Defined in ic.cc. 341 // Defined in ic.cc.
342 Object* CallIC_Miss(Arguments args); 342 Object* CallIC_Miss(Arguments args);
343 343
344 // The generated code does not accept smi keys. 344 // The generated code does not accept smi keys.
345 // The generated code falls through if both probes miss. 345 // The generated code falls through if both probes miss.
346 void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm, 346 void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm,
347 int argc, 347 int argc,
348 Code::Kind kind, 348 Code::Kind kind,
349 Code::ExtraICState extra_state) { 349 ExtraICState extra_state) {
350 // ----------- S t a t e ------------- 350 // ----------- S t a t e -------------
351 // -- a1 : receiver 351 // -- a1 : receiver
352 // -- a2 : name 352 // -- a2 : name
353 // ----------------------------------- 353 // -----------------------------------
354 Label number, non_number, non_string, boolean, probe, miss; 354 Label number, non_number, non_string, boolean, probe, miss;
355 355
356 // Probe the stub cache. 356 // Probe the stub cache.
357 Code::Flags flags = Code::ComputeFlags(kind, 357 Code::Flags flags = Code::ComputeFlags(kind,
358 MONOMORPHIC, 358 MONOMORPHIC,
359 extra_state, 359 extra_state,
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 GenerateFunctionTailCall(masm, argc, &miss, t0); 441 GenerateFunctionTailCall(masm, argc, &miss, t0);
442 442
443 // Cache miss: Jump to runtime. 443 // Cache miss: Jump to runtime.
444 __ bind(&miss); 444 __ bind(&miss);
445 } 445 }
446 446
447 447
448 void CallICBase::GenerateMiss(MacroAssembler* masm, 448 void CallICBase::GenerateMiss(MacroAssembler* masm,
449 int argc, 449 int argc,
450 IC::UtilityId id, 450 IC::UtilityId id,
451 Code::ExtraICState extra_state) { 451 ExtraICState extra_state) {
452 // ----------- S t a t e ------------- 452 // ----------- S t a t e -------------
453 // -- a2 : name 453 // -- a2 : name
454 // -- ra : return address 454 // -- ra : return address
455 // ----------------------------------- 455 // -----------------------------------
456 Isolate* isolate = masm->isolate(); 456 Isolate* isolate = masm->isolate();
457 457
458 if (id == IC::kCallIC_Miss) { 458 if (id == IC::kCallIC_Miss) {
459 __ IncrementCounter(isolate->counters()->call_miss(), 1, a3, t0); 459 __ IncrementCounter(isolate->counters()->call_miss(), 1, a3, t0);
460 } else { 460 } else {
461 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, a3, t0); 461 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, a3, t0);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 __ InvokeFunction(a1, 505 __ InvokeFunction(a1,
506 actual, 506 actual,
507 JUMP_FUNCTION, 507 JUMP_FUNCTION,
508 NullCallWrapper(), 508 NullCallWrapper(),
509 call_kind); 509 call_kind);
510 } 510 }
511 511
512 512
513 void CallIC::GenerateMegamorphic(MacroAssembler* masm, 513 void CallIC::GenerateMegamorphic(MacroAssembler* masm,
514 int argc, 514 int argc,
515 Code::ExtraICState extra_ic_state) { 515 ExtraICState extra_ic_state) {
516 // ----------- S t a t e ------------- 516 // ----------- S t a t e -------------
517 // -- a2 : name 517 // -- a2 : name
518 // -- ra : return address 518 // -- ra : return address
519 // ----------------------------------- 519 // -----------------------------------
520 520
521 // Get the receiver of the function from the stack into a1. 521 // Get the receiver of the function from the stack into a1.
522 __ lw(a1, MemOperand(sp, argc * kPointerSize)); 522 __ lw(a1, MemOperand(sp, argc * kPointerSize));
523 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); 523 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state);
524 GenerateMiss(masm, argc, extra_ic_state); 524 GenerateMiss(masm, argc, extra_ic_state);
525 } 525 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 602
603 GenerateDictionaryLoad(masm, &slow_load, a0, a2, a1, a3, t0); 603 GenerateDictionaryLoad(masm, &slow_load, a0, a2, a1, a3, t0);
604 __ IncrementCounter(counters->keyed_call_generic_lookup_dict(), 1, a0, a3); 604 __ IncrementCounter(counters->keyed_call_generic_lookup_dict(), 1, a0, a3);
605 __ jmp(&do_call); 605 __ jmp(&do_call);
606 606
607 __ bind(&lookup_monomorphic_cache); 607 __ bind(&lookup_monomorphic_cache);
608 __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1, a0, a3); 608 __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1, a0, a3);
609 GenerateMonomorphicCacheProbe(masm, 609 GenerateMonomorphicCacheProbe(masm,
610 argc, 610 argc,
611 Code::KEYED_CALL_IC, 611 Code::KEYED_CALL_IC,
612 Code::kNoExtraICState); 612 kNoExtraICState);
613 // Fall through on miss. 613 // Fall through on miss.
614 614
615 __ bind(&slow_call); 615 __ bind(&slow_call);
616 // This branch is taken if: 616 // This branch is taken if:
617 // - the receiver requires boxing or access check, 617 // - the receiver requires boxing or access check,
618 // - the key is neither smi nor a unique name, 618 // - the key is neither smi nor a unique name,
619 // - the value loaded is not a function, 619 // - the value loaded is not a function,
620 // - there is hope that the runtime will create a monomorphic call stub, 620 // - there is hope that the runtime will create a monomorphic call stub,
621 // that will get fetched next time. 621 // that will get fetched next time.
622 __ IncrementCounter(counters->keyed_call_generic_slow(), 1, a0, a3); 622 __ IncrementCounter(counters->keyed_call_generic_slow(), 1, a0, a3);
(...skipping 25 matching lines...) Expand all
648 648
649 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { 649 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
650 // ----------- S t a t e ------------- 650 // ----------- S t a t e -------------
651 // -- a2 : name 651 // -- a2 : name
652 // -- ra : return address 652 // -- ra : return address
653 // -- a0 : receiver 653 // -- a0 : receiver
654 // ----------------------------------- 654 // -----------------------------------
655 655
656 // Probe the stub cache. 656 // Probe the stub cache.
657 Code::Flags flags = Code::ComputeFlags( 657 Code::Flags flags = Code::ComputeFlags(
658 Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, 658 Code::HANDLER, MONOMORPHIC, kNoExtraICState,
659 Code::NORMAL, Code::LOAD_IC); 659 Code::NORMAL, Code::LOAD_IC);
660 masm->isolate()->stub_cache()->GenerateProbe( 660 masm->isolate()->stub_cache()->GenerateProbe(
661 masm, flags, a0, a2, a3, t0, t1, t2); 661 masm, flags, a0, a2, a3, t0, t1, t2);
662 662
663 // Cache miss: Jump to runtime. 663 // Cache miss: Jump to runtime.
664 GenerateMiss(masm); 664 GenerateMiss(masm);
665 } 665 }
666 666
667 667
668 void LoadIC::GenerateNormal(MacroAssembler* masm) { 668 void LoadIC::GenerateNormal(MacroAssembler* masm) {
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 // The delta to the start of the map check instruction and the 1643 // The delta to the start of the map check instruction and the
1644 // condition code uses at the patched jump. 1644 // condition code uses at the patched jump.
1645 int delta = Assembler::GetImmediate16(instr); 1645 int delta = Assembler::GetImmediate16(instr);
1646 delta += Assembler::GetRs(instr) * kImm16Mask; 1646 delta += Assembler::GetRs(instr) * kImm16Mask;
1647 // If the delta is 0 the instruction is andi at, zero_reg, #0 which also 1647 // If the delta is 0 the instruction is andi at, zero_reg, #0 which also
1648 // signals that nothing was inlined. 1648 // signals that nothing was inlined.
1649 if (delta == 0) { 1649 if (delta == 0) {
1650 return; 1650 return;
1651 } 1651 }
1652 1652
1653 #ifdef DEBUG
1654 if (FLAG_trace_ic) { 1653 if (FLAG_trace_ic) {
1655 PrintF("[ patching ic at %p, andi=%p, delta=%d\n", 1654 PrintF("[ patching ic at %p, andi=%p, delta=%d\n",
1656 address, andi_instruction_address, delta); 1655 address, andi_instruction_address, delta);
1657 } 1656 }
1658 #endif
1659 1657
1660 Address patch_address = 1658 Address patch_address =
1661 andi_instruction_address - delta * Instruction::kInstrSize; 1659 andi_instruction_address - delta * Instruction::kInstrSize;
1662 Instr instr_at_patch = Assembler::instr_at(patch_address); 1660 Instr instr_at_patch = Assembler::instr_at(patch_address);
1663 Instr branch_instr = 1661 Instr branch_instr =
1664 Assembler::instr_at(patch_address + Instruction::kInstrSize); 1662 Assembler::instr_at(patch_address + Instruction::kInstrSize);
1665 // This is patching a conditional "jump if not smi/jump if smi" site. 1663 // This is patching a conditional "jump if not smi/jump if smi" site.
1666 // Enabling by changing from 1664 // Enabling by changing from
1667 // andi at, rx, 0 1665 // andi at, rx, 0
1668 // Branch <target>, eq, at, Operand(zero_reg) 1666 // Branch <target>, eq, at, Operand(zero_reg)
(...skipping 18 matching lines...) Expand all
1687 } else { 1685 } else {
1688 ASSERT(Assembler::IsBne(branch_instr)); 1686 ASSERT(Assembler::IsBne(branch_instr));
1689 patcher.ChangeBranchCondition(eq); 1687 patcher.ChangeBranchCondition(eq);
1690 } 1688 }
1691 } 1689 }
1692 1690
1693 1691
1694 } } // namespace v8::internal 1692 } } // namespace v8::internal
1695 1693
1696 #endif // V8_TARGET_ARCH_MIPS 1694 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698