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

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

Issue 7084032: Add asserts and state tracking to ensure that we do not call (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 6 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-codegen-arm.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 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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 596
597 if (id == IC::kCallIC_Miss) { 597 if (id == IC::kCallIC_Miss) {
598 __ IncrementCounter(isolate->counters()->call_miss(), 1, r3, r4); 598 __ IncrementCounter(isolate->counters()->call_miss(), 1, r3, r4);
599 } else { 599 } else {
600 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, r3, r4); 600 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, r3, r4);
601 } 601 }
602 602
603 // Get the receiver of the function from the stack. 603 // Get the receiver of the function from the stack.
604 __ ldr(r3, MemOperand(sp, argc * kPointerSize)); 604 __ ldr(r3, MemOperand(sp, argc * kPointerSize));
605 605
606 __ EnterInternalFrame(); 606 {
607 FrameScope scope(masm, StackFrame::INTERNAL);
607 608
608 // Push the receiver and the name of the function. 609 // Push the receiver and the name of the function.
609 __ Push(r3, r2); 610 __ Push(r3, r2);
610 611
611 // Call the entry. 612 // Call the entry.
612 __ mov(r0, Operand(2)); 613 __ mov(r0, Operand(2));
613 __ mov(r1, Operand(ExternalReference(IC_Utility(id), isolate))); 614 __ mov(r1, Operand(ExternalReference(IC_Utility(id), isolate)));
614 615
615 CEntryStub stub(1); 616 CEntryStub stub(1);
616 __ CallStub(&stub); 617 __ CallStub(&stub);
617 618
618 // Move result to r1 and leave the internal frame. 619 // Move result to r1 and leave the internal frame.
619 __ mov(r1, Operand(r0)); 620 __ mov(r1, Operand(r0));
620 __ LeaveInternalFrame(); 621 }
621 622
622 // Check if the receiver is a global object of some sort. 623 // Check if the receiver is a global object of some sort.
623 // This can happen only for regular CallIC but not KeyedCallIC. 624 // This can happen only for regular CallIC but not KeyedCallIC.
624 if (id == IC::kCallIC_Miss) { 625 if (id == IC::kCallIC_Miss) {
625 Label invoke, global; 626 Label invoke, global;
626 __ ldr(r2, MemOperand(sp, argc * kPointerSize)); // receiver 627 __ ldr(r2, MemOperand(sp, argc * kPointerSize)); // receiver
627 __ tst(r2, Operand(kSmiTagMask)); 628 __ tst(r2, Operand(kSmiTagMask));
628 __ b(eq, &invoke); 629 __ b(eq, &invoke);
629 __ CompareObjectType(r2, r3, r3, JS_GLOBAL_OBJECT_TYPE); 630 __ CompareObjectType(r2, r3, r3, JS_GLOBAL_OBJECT_TYPE);
630 __ b(eq, &global); 631 __ b(eq, &global);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 __ mov(r0, Operand(r2, ASR, kSmiTagSize)); 744 __ mov(r0, Operand(r2, ASR, kSmiTagSize));
744 // r0: untagged index 745 // r0: untagged index
745 GenerateNumberDictionaryLoad(masm, &slow_load, r4, r2, r1, r0, r3, r5); 746 GenerateNumberDictionaryLoad(masm, &slow_load, r4, r2, r1, r0, r3, r5);
746 __ IncrementCounter(counters->keyed_call_generic_smi_dict(), 1, r0, r3); 747 __ IncrementCounter(counters->keyed_call_generic_smi_dict(), 1, r0, r3);
747 __ jmp(&do_call); 748 __ jmp(&do_call);
748 749
749 __ bind(&slow_load); 750 __ bind(&slow_load);
750 // This branch is taken when calling KeyedCallIC_Miss is neither required 751 // This branch is taken when calling KeyedCallIC_Miss is neither required
751 // nor beneficial. 752 // nor beneficial.
752 __ IncrementCounter(counters->keyed_call_generic_slow_load(), 1, r0, r3); 753 __ IncrementCounter(counters->keyed_call_generic_slow_load(), 1, r0, r3);
753 __ EnterInternalFrame(); 754 {
754 __ push(r2); // save the key 755 FrameScope scope(masm, StackFrame::INTERNAL);
755 __ Push(r1, r2); // pass the receiver and the key 756 __ push(r2); // save the key
756 __ CallRuntime(Runtime::kKeyedGetProperty, 2); 757 __ Push(r1, r2); // pass the receiver and the key
757 __ pop(r2); // restore the key 758 __ CallRuntime(Runtime::kKeyedGetProperty, 2);
758 __ LeaveInternalFrame(); 759 __ pop(r2); // restore the key
760 }
759 __ mov(r1, r0); 761 __ mov(r1, r0);
760 __ jmp(&do_call); 762 __ jmp(&do_call);
761 763
762 __ bind(&check_string); 764 __ bind(&check_string);
763 GenerateKeyStringCheck(masm, r2, r0, r3, &index_string, &slow_call); 765 GenerateKeyStringCheck(masm, r2, r0, r3, &index_string, &slow_call);
764 766
765 // The key is known to be a symbol. 767 // The key is known to be a symbol.
766 // If the receiver is a regular JS object with slow properties then do 768 // If the receiver is a regular JS object with slow properties then do
767 // a quick inline probe of the receiver's dictionary. 769 // a quick inline probe of the receiver's dictionary.
768 // Otherwise do the monomorphic cache probe. 770 // Otherwise do the monomorphic cache probe.
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 Register reg = Assembler::GetRn(instr_at_patch); 1556 Register reg = Assembler::GetRn(instr_at_patch);
1555 patcher.masm()->tst(reg, Operand(kSmiTagMask)); 1557 patcher.masm()->tst(reg, Operand(kSmiTagMask));
1556 patcher.EmitCondition(eq); 1558 patcher.EmitCondition(eq);
1557 } 1559 }
1558 } 1560 }
1559 1561
1560 1562
1561 } } // namespace v8::internal 1563 } } // namespace v8::internal
1562 1564
1563 #endif // V8_TARGET_ARCH_ARM 1565 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698