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

Side by Side Diff: src/arm/ic-arm.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/arm/full-codegen-arm.cc ('k') | src/arm/lithium-arm.h » ('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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 335
336 // Defined in ic.cc. 336 // Defined in ic.cc.
337 Object* CallIC_Miss(Arguments args); 337 Object* CallIC_Miss(Arguments args);
338 338
339 // The generated code does not accept smi keys. 339 // The generated code does not accept smi keys.
340 // The generated code falls through if both probes miss. 340 // The generated code falls through if both probes miss.
341 void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm, 341 void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm,
342 int argc, 342 int argc,
343 Code::Kind kind, 343 Code::Kind kind,
344 Code::ExtraICState extra_state) { 344 ExtraICState extra_state) {
345 // ----------- S t a t e ------------- 345 // ----------- S t a t e -------------
346 // -- r1 : receiver 346 // -- r1 : receiver
347 // -- r2 : name 347 // -- r2 : name
348 // ----------------------------------- 348 // -----------------------------------
349 Label number, non_number, non_string, boolean, probe, miss; 349 Label number, non_number, non_string, boolean, probe, miss;
350 350
351 // Probe the stub cache. 351 // Probe the stub cache.
352 Code::Flags flags = Code::ComputeFlags(kind, 352 Code::Flags flags = Code::ComputeFlags(kind,
353 MONOMORPHIC, 353 MONOMORPHIC,
354 extra_state, 354 extra_state,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 GenerateFunctionTailCall(masm, argc, &miss, r4); 439 GenerateFunctionTailCall(masm, argc, &miss, r4);
440 440
441 __ bind(&miss); 441 __ bind(&miss);
442 } 442 }
443 443
444 444
445 void CallICBase::GenerateMiss(MacroAssembler* masm, 445 void CallICBase::GenerateMiss(MacroAssembler* masm,
446 int argc, 446 int argc,
447 IC::UtilityId id, 447 IC::UtilityId id,
448 Code::ExtraICState extra_state) { 448 ExtraICState extra_state) {
449 // ----------- S t a t e ------------- 449 // ----------- S t a t e -------------
450 // -- r2 : name 450 // -- r2 : name
451 // -- lr : return address 451 // -- lr : return address
452 // ----------------------------------- 452 // -----------------------------------
453 Isolate* isolate = masm->isolate(); 453 Isolate* isolate = masm->isolate();
454 454
455 if (id == IC::kCallIC_Miss) { 455 if (id == IC::kCallIC_Miss) {
456 __ IncrementCounter(isolate->counters()->call_miss(), 1, r3, r4); 456 __ IncrementCounter(isolate->counters()->call_miss(), 1, r3, r4);
457 } else { 457 } else {
458 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, r3, r4); 458 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, r3, r4);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 __ InvokeFunction(r1, 504 __ InvokeFunction(r1,
505 actual, 505 actual,
506 JUMP_FUNCTION, 506 JUMP_FUNCTION,
507 NullCallWrapper(), 507 NullCallWrapper(),
508 call_kind); 508 call_kind);
509 } 509 }
510 510
511 511
512 void CallIC::GenerateMegamorphic(MacroAssembler* masm, 512 void CallIC::GenerateMegamorphic(MacroAssembler* masm,
513 int argc, 513 int argc,
514 Code::ExtraICState extra_ic_state) { 514 ExtraICState extra_ic_state) {
515 // ----------- S t a t e ------------- 515 // ----------- S t a t e -------------
516 // -- r2 : name 516 // -- r2 : name
517 // -- lr : return address 517 // -- lr : return address
518 // ----------------------------------- 518 // -----------------------------------
519 519
520 // Get the receiver of the function from the stack into r1. 520 // Get the receiver of the function from the stack into r1.
521 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); 521 __ ldr(r1, MemOperand(sp, argc * kPointerSize));
522 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); 522 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state);
523 GenerateMiss(masm, argc, extra_ic_state); 523 GenerateMiss(masm, argc, extra_ic_state);
524 } 524 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 603
604 GenerateDictionaryLoad(masm, &slow_load, r0, r2, r1, r3, r4); 604 GenerateDictionaryLoad(masm, &slow_load, r0, r2, r1, r3, r4);
605 __ IncrementCounter(counters->keyed_call_generic_lookup_dict(), 1, r0, r3); 605 __ IncrementCounter(counters->keyed_call_generic_lookup_dict(), 1, r0, r3);
606 __ jmp(&do_call); 606 __ jmp(&do_call);
607 607
608 __ bind(&lookup_monomorphic_cache); 608 __ bind(&lookup_monomorphic_cache);
609 __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1, r0, r3); 609 __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1, r0, r3);
610 GenerateMonomorphicCacheProbe(masm, 610 GenerateMonomorphicCacheProbe(masm,
611 argc, 611 argc,
612 Code::KEYED_CALL_IC, 612 Code::KEYED_CALL_IC,
613 Code::kNoExtraICState); 613 kNoExtraICState);
614 // Fall through on miss. 614 // Fall through on miss.
615 615
616 __ bind(&slow_call); 616 __ bind(&slow_call);
617 // This branch is taken if: 617 // This branch is taken if:
618 // - the receiver requires boxing or access check, 618 // - the receiver requires boxing or access check,
619 // - the key is neither smi nor a unique name, 619 // - the key is neither smi nor a unique name,
620 // - the value loaded is not a function, 620 // - the value loaded is not a function,
621 // - there is hope that the runtime will create a monomorphic call stub 621 // - there is hope that the runtime will create a monomorphic call stub
622 // that will get fetched next time. 622 // that will get fetched next time.
623 __ IncrementCounter(counters->keyed_call_generic_slow(), 1, r0, r3); 623 __ IncrementCounter(counters->keyed_call_generic_slow(), 1, r0, r3);
(...skipping 25 matching lines...) Expand all
649 649
650 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { 650 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
651 // ----------- S t a t e ------------- 651 // ----------- S t a t e -------------
652 // -- r2 : name 652 // -- r2 : name
653 // -- lr : return address 653 // -- lr : return address
654 // -- r0 : receiver 654 // -- r0 : receiver
655 // ----------------------------------- 655 // -----------------------------------
656 656
657 // Probe the stub cache. 657 // Probe the stub cache.
658 Code::Flags flags = Code::ComputeFlags( 658 Code::Flags flags = Code::ComputeFlags(
659 Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, 659 Code::HANDLER, MONOMORPHIC, kNoExtraICState,
660 Code::NORMAL, Code::LOAD_IC); 660 Code::NORMAL, Code::LOAD_IC);
661 masm->isolate()->stub_cache()->GenerateProbe( 661 masm->isolate()->stub_cache()->GenerateProbe(
662 masm, flags, r0, r2, r3, r4, r5, r6); 662 masm, flags, r0, r2, r3, r4, r5, r6);
663 663
664 // Cache miss: Jump to runtime. 664 // Cache miss: Jump to runtime.
665 GenerateMiss(masm); 665 GenerateMiss(masm);
666 } 666 }
667 667
668 668
669 void LoadIC::GenerateNormal(MacroAssembler* masm) { 669 void LoadIC::GenerateNormal(MacroAssembler* masm) {
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 // condition code uses at the patched jump. 1634 // condition code uses at the patched jump.
1635 int delta = Assembler::GetCmpImmediateRawImmediate(instr); 1635 int delta = Assembler::GetCmpImmediateRawImmediate(instr);
1636 delta += 1636 delta +=
1637 Assembler::GetCmpImmediateRegister(instr).code() * kOff12Mask; 1637 Assembler::GetCmpImmediateRegister(instr).code() * kOff12Mask;
1638 // If the delta is 0 the instruction is cmp r0, #0 which also signals that 1638 // If the delta is 0 the instruction is cmp r0, #0 which also signals that
1639 // nothing was inlined. 1639 // nothing was inlined.
1640 if (delta == 0) { 1640 if (delta == 0) {
1641 return; 1641 return;
1642 } 1642 }
1643 1643
1644 #ifdef DEBUG
1645 if (FLAG_trace_ic) { 1644 if (FLAG_trace_ic) {
1646 PrintF("[ patching ic at %p, cmp=%p, delta=%d\n", 1645 PrintF("[ patching ic at %p, cmp=%p, delta=%d\n",
1647 address, cmp_instruction_address, delta); 1646 address, cmp_instruction_address, delta);
1648 } 1647 }
1649 #endif
1650 1648
1651 Address patch_address = 1649 Address patch_address =
1652 cmp_instruction_address - delta * Instruction::kInstrSize; 1650 cmp_instruction_address - delta * Instruction::kInstrSize;
1653 Instr instr_at_patch = Assembler::instr_at(patch_address); 1651 Instr instr_at_patch = Assembler::instr_at(patch_address);
1654 Instr branch_instr = 1652 Instr branch_instr =
1655 Assembler::instr_at(patch_address + Instruction::kInstrSize); 1653 Assembler::instr_at(patch_address + Instruction::kInstrSize);
1656 // This is patching a conditional "jump if not smi/jump if smi" site. 1654 // This is patching a conditional "jump if not smi/jump if smi" site.
1657 // Enabling by changing from 1655 // Enabling by changing from
1658 // cmp rx, rx 1656 // cmp rx, rx
1659 // b eq/ne, <target> 1657 // b eq/ne, <target>
(...skipping 19 matching lines...) Expand all
1679 } else { 1677 } else {
1680 ASSERT(Assembler::GetCondition(branch_instr) == ne); 1678 ASSERT(Assembler::GetCondition(branch_instr) == ne);
1681 patcher.EmitCondition(eq); 1679 patcher.EmitCondition(eq);
1682 } 1680 }
1683 } 1681 }
1684 1682
1685 1683
1686 } } // namespace v8::internal 1684 } } // namespace v8::internal
1687 1685
1688 #endif // V8_TARGET_ARCH_ARM 1686 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/arm/lithium-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698