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

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

Issue 7891042: Add asserts to ensure that we: (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 3 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/x64/full-codegen-x64.cc ('k') | src/x64/lithium-codegen-x64.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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 if (id == IC::kCallIC_Miss) { 839 if (id == IC::kCallIC_Miss) {
840 __ IncrementCounter(counters->call_miss(), 1); 840 __ IncrementCounter(counters->call_miss(), 1);
841 } else { 841 } else {
842 __ IncrementCounter(counters->keyed_call_miss(), 1); 842 __ IncrementCounter(counters->keyed_call_miss(), 1);
843 } 843 }
844 844
845 // Get the receiver of the function from the stack; 1 ~ return address. 845 // Get the receiver of the function from the stack; 1 ~ return address.
846 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); 846 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
847 847
848 // Enter an internal frame. 848 // Enter an internal frame.
849 __ EnterInternalFrame(); 849 {
850 FrameScope scope(masm, StackFrame::INTERNAL);
850 851
851 // Push the receiver and the name of the function. 852 // Push the receiver and the name of the function.
852 __ push(rdx); 853 __ push(rdx);
853 __ push(rcx); 854 __ push(rcx);
854 855
855 // Call the entry. 856 // Call the entry.
856 CEntryStub stub(1); 857 CEntryStub stub(1);
857 __ Set(rax, 2); 858 __ Set(rax, 2);
858 __ LoadAddress(rbx, ExternalReference(IC_Utility(id), masm->isolate())); 859 __ LoadAddress(rbx, ExternalReference(IC_Utility(id), masm->isolate()));
859 __ CallStub(&stub); 860 __ CallStub(&stub);
860 861
861 // Move result to rdi and exit the internal frame. 862 // Move result to rdi and exit the internal frame.
862 __ movq(rdi, rax); 863 __ movq(rdi, rax);
863 __ LeaveInternalFrame(); 864 }
864 865
865 // Check if the receiver is a global object of some sort. 866 // Check if the receiver is a global object of some sort.
866 // This can happen only for regular CallIC but not KeyedCallIC. 867 // This can happen only for regular CallIC but not KeyedCallIC.
867 if (id == IC::kCallIC_Miss) { 868 if (id == IC::kCallIC_Miss) {
868 Label invoke, global; 869 Label invoke, global;
869 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); // receiver 870 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); // receiver
870 __ JumpIfSmi(rdx, &invoke); 871 __ JumpIfSmi(rdx, &invoke);
871 __ CmpObjectType(rdx, JS_GLOBAL_OBJECT_TYPE, rcx); 872 __ CmpObjectType(rdx, JS_GLOBAL_OBJECT_TYPE, rcx);
872 __ j(equal, &global); 873 __ j(equal, &global);
873 __ CmpInstanceType(rcx, JS_BUILTINS_OBJECT_TYPE); 874 __ CmpInstanceType(rcx, JS_BUILTINS_OBJECT_TYPE);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 __ SmiToInteger32(rbx, rcx); 996 __ SmiToInteger32(rbx, rcx);
996 // ebx: untagged index 997 // ebx: untagged index
997 __ LoadFromNumberDictionary(&slow_load, rax, rcx, rbx, r9, rdi, rdi); 998 __ LoadFromNumberDictionary(&slow_load, rax, rcx, rbx, r9, rdi, rdi);
998 __ IncrementCounter(counters->keyed_call_generic_smi_dict(), 1); 999 __ IncrementCounter(counters->keyed_call_generic_smi_dict(), 1);
999 __ jmp(&do_call); 1000 __ jmp(&do_call);
1000 1001
1001 __ bind(&slow_load); 1002 __ bind(&slow_load);
1002 // This branch is taken when calling KeyedCallIC_Miss is neither required 1003 // This branch is taken when calling KeyedCallIC_Miss is neither required
1003 // nor beneficial. 1004 // nor beneficial.
1004 __ IncrementCounter(counters->keyed_call_generic_slow_load(), 1); 1005 __ IncrementCounter(counters->keyed_call_generic_slow_load(), 1);
1005 __ EnterInternalFrame(); 1006 {
1006 __ push(rcx); // save the key 1007 FrameScope scope(masm, StackFrame::INTERNAL);
1007 __ push(rdx); // pass the receiver 1008 __ push(rcx); // save the key
1008 __ push(rcx); // pass the key 1009 __ push(rdx); // pass the receiver
1009 __ CallRuntime(Runtime::kKeyedGetProperty, 2); 1010 __ push(rcx); // pass the key
1010 __ pop(rcx); // restore the key 1011 __ CallRuntime(Runtime::kKeyedGetProperty, 2);
1011 __ LeaveInternalFrame(); 1012 __ pop(rcx); // restore the key
1013 }
1012 __ movq(rdi, rax); 1014 __ movq(rdi, rax);
1013 __ jmp(&do_call); 1015 __ jmp(&do_call);
1014 1016
1015 __ bind(&check_string); 1017 __ bind(&check_string);
1016 GenerateKeyStringCheck(masm, rcx, rax, rbx, &index_string, &slow_call); 1018 GenerateKeyStringCheck(masm, rcx, rax, rbx, &index_string, &slow_call);
1017 1019
1018 // The key is known to be a symbol. 1020 // The key is known to be a symbol.
1019 // If the receiver is a regular JS object with slow properties then do 1021 // If the receiver is a regular JS object with slow properties then do
1020 // a quick inline probe of the receiver's dictionary. 1022 // a quick inline probe of the receiver's dictionary.
1021 // Otherwise do the monomorphic cache probe. 1023 // Otherwise do the monomorphic cache probe.
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1659 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1658 ? not_zero 1660 ? not_zero
1659 : zero; 1661 : zero;
1660 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1662 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1661 } 1663 }
1662 1664
1663 1665
1664 } } // namespace v8::internal 1666 } } // namespace v8::internal
1665 1667
1666 #endif // V8_TARGET_ARCH_X64 1668 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698