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

Side by Side Diff: src/x64/ic-x64.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/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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 if (id == IC::kCallIC_Miss) { 943 if (id == IC::kCallIC_Miss) {
944 __ IncrementCounter(counters->call_miss(), 1); 944 __ IncrementCounter(counters->call_miss(), 1);
945 } else { 945 } else {
946 __ IncrementCounter(counters->keyed_call_miss(), 1); 946 __ IncrementCounter(counters->keyed_call_miss(), 1);
947 } 947 }
948 948
949 // Get the receiver of the function from the stack; 1 ~ return address. 949 // Get the receiver of the function from the stack; 1 ~ return address.
950 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); 950 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
951 951
952 // Enter an internal frame. 952 // Enter an internal frame.
953 __ EnterInternalFrame(); 953 {
954 FrameScope scope(masm, StackFrame::INTERNAL);
954 955
955 // Push the receiver and the name of the function. 956 // Push the receiver and the name of the function.
956 __ push(rdx); 957 __ push(rdx);
957 __ push(rcx); 958 __ push(rcx);
958 959
959 // Call the entry. 960 // Call the entry.
960 CEntryStub stub(1); 961 CEntryStub stub(1);
961 __ Set(rax, 2); 962 __ Set(rax, 2);
962 __ LoadAddress(rbx, ExternalReference(IC_Utility(id), masm->isolate())); 963 __ LoadAddress(rbx, ExternalReference(IC_Utility(id), masm->isolate()));
963 __ CallStub(&stub); 964 __ CallStub(&stub);
964 965
965 // Move result to rdi and exit the internal frame. 966 // Move result to rdi and exit the internal frame.
966 __ movq(rdi, rax); 967 __ movq(rdi, rax);
967 __ LeaveInternalFrame(); 968 }
968 969
969 // Check if the receiver is a global object of some sort. 970 // Check if the receiver is a global object of some sort.
970 // This can happen only for regular CallIC but not KeyedCallIC. 971 // This can happen only for regular CallIC but not KeyedCallIC.
971 if (id == IC::kCallIC_Miss) { 972 if (id == IC::kCallIC_Miss) {
972 Label invoke, global; 973 Label invoke, global;
973 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); // receiver 974 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); // receiver
974 __ JumpIfSmi(rdx, &invoke); 975 __ JumpIfSmi(rdx, &invoke);
975 __ CmpObjectType(rdx, JS_GLOBAL_OBJECT_TYPE, rcx); 976 __ CmpObjectType(rdx, JS_GLOBAL_OBJECT_TYPE, rcx);
976 __ j(equal, &global); 977 __ j(equal, &global);
977 __ CmpInstanceType(rcx, JS_BUILTINS_OBJECT_TYPE); 978 __ CmpInstanceType(rcx, JS_BUILTINS_OBJECT_TYPE);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 __ SmiToInteger32(rbx, rcx); 1100 __ SmiToInteger32(rbx, rcx);
1100 // ebx: untagged index 1101 // ebx: untagged index
1101 GenerateNumberDictionaryLoad(masm, &slow_load, rax, rcx, rbx, r9, rdi, rdi); 1102 GenerateNumberDictionaryLoad(masm, &slow_load, rax, rcx, rbx, r9, rdi, rdi);
1102 __ IncrementCounter(counters->keyed_call_generic_smi_dict(), 1); 1103 __ IncrementCounter(counters->keyed_call_generic_smi_dict(), 1);
1103 __ jmp(&do_call); 1104 __ jmp(&do_call);
1104 1105
1105 __ bind(&slow_load); 1106 __ bind(&slow_load);
1106 // This branch is taken when calling KeyedCallIC_Miss is neither required 1107 // This branch is taken when calling KeyedCallIC_Miss is neither required
1107 // nor beneficial. 1108 // nor beneficial.
1108 __ IncrementCounter(counters->keyed_call_generic_slow_load(), 1); 1109 __ IncrementCounter(counters->keyed_call_generic_slow_load(), 1);
1109 __ EnterInternalFrame(); 1110 {
1110 __ push(rcx); // save the key 1111 FrameScope scope(masm, StackFrame::INTERNAL);
1111 __ push(rdx); // pass the receiver 1112 __ push(rcx); // save the key
1112 __ push(rcx); // pass the key 1113 __ push(rdx); // pass the receiver
1113 __ CallRuntime(Runtime::kKeyedGetProperty, 2); 1114 __ push(rcx); // pass the key
1114 __ pop(rcx); // restore the key 1115 __ CallRuntime(Runtime::kKeyedGetProperty, 2);
1115 __ LeaveInternalFrame(); 1116 __ pop(rcx); // restore the key
1117 }
1116 __ movq(rdi, rax); 1118 __ movq(rdi, rax);
1117 __ jmp(&do_call); 1119 __ jmp(&do_call);
1118 1120
1119 __ bind(&check_string); 1121 __ bind(&check_string);
1120 GenerateKeyStringCheck(masm, rcx, rax, rbx, &index_string, &slow_call); 1122 GenerateKeyStringCheck(masm, rcx, rax, rbx, &index_string, &slow_call);
1121 1123
1122 // The key is known to be a symbol. 1124 // The key is known to be a symbol.
1123 // If the receiver is a regular JS object with slow properties then do 1125 // If the receiver is a regular JS object with slow properties then do
1124 // a quick inline probe of the receiver's dictionary. 1126 // a quick inline probe of the receiver's dictionary.
1125 // Otherwise do the monomorphic cache probe. 1127 // Otherwise do the monomorphic cache probe.
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1602 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1601 ? not_zero 1603 ? not_zero
1602 : zero; 1604 : zero;
1603 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1605 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1604 } 1606 }
1605 1607
1606 1608
1607 } } // namespace v8::internal 1609 } } // namespace v8::internal
1608 1610
1609 #endif // V8_TARGET_ARCH_X64 1611 #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