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

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

Issue 112863002: Merge bleeding_edge 18021:18297 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years 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/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow, 945 KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow,
946 &slow, kDontCheckMap, kIncrementLength); 946 &slow, kDontCheckMap, kIncrementLength);
947 } 947 }
948 948
949 949
950 // The generated code does not accept smi keys. 950 // The generated code does not accept smi keys.
951 // The generated code falls through if both probes miss. 951 // The generated code falls through if both probes miss.
952 void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm, 952 void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm,
953 int argc, 953 int argc,
954 Code::Kind kind, 954 Code::Kind kind,
955 Code::ExtraICState extra_state) { 955 ExtraICState extra_state) {
956 // ----------- S t a t e ------------- 956 // ----------- S t a t e -------------
957 // -- ecx : name 957 // -- ecx : name
958 // -- edx : receiver 958 // -- edx : receiver
959 // ----------------------------------- 959 // -----------------------------------
960 Label number, non_number, non_string, boolean, probe, miss; 960 Label number, non_number, non_string, boolean, probe, miss;
961 961
962 // Probe the stub cache. 962 // Probe the stub cache.
963 Code::Flags flags = Code::ComputeFlags(kind, 963 Code::Flags flags = Code::ComputeFlags(kind,
964 MONOMORPHIC, 964 MONOMORPHIC,
965 extra_state, 965 extra_state,
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 GenerateDictionaryLoad(masm, &miss, eax, ecx, edi, ebx, edi); 1054 GenerateDictionaryLoad(masm, &miss, eax, ecx, edi, ebx, edi);
1055 GenerateFunctionTailCall(masm, argc, &miss); 1055 GenerateFunctionTailCall(masm, argc, &miss);
1056 1056
1057 __ bind(&miss); 1057 __ bind(&miss);
1058 } 1058 }
1059 1059
1060 1060
1061 void CallICBase::GenerateMiss(MacroAssembler* masm, 1061 void CallICBase::GenerateMiss(MacroAssembler* masm,
1062 int argc, 1062 int argc,
1063 IC::UtilityId id, 1063 IC::UtilityId id,
1064 Code::ExtraICState extra_state) { 1064 ExtraICState extra_state) {
1065 // ----------- S t a t e ------------- 1065 // ----------- S t a t e -------------
1066 // -- ecx : name 1066 // -- ecx : name
1067 // -- esp[0] : return address 1067 // -- esp[0] : return address
1068 // -- esp[(argc - n) * 4] : arg[n] (zero-based) 1068 // -- esp[(argc - n) * 4] : arg[n] (zero-based)
1069 // -- ... 1069 // -- ...
1070 // -- esp[(argc + 1) * 4] : receiver 1070 // -- esp[(argc + 1) * 4] : receiver
1071 // ----------------------------------- 1071 // -----------------------------------
1072 1072
1073 Counters* counters = masm->isolate()->counters(); 1073 Counters* counters = masm->isolate()->counters();
1074 if (id == IC::kCallIC_Miss) { 1074 if (id == IC::kCallIC_Miss) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 __ InvokeFunction(edi, 1125 __ InvokeFunction(edi,
1126 actual, 1126 actual,
1127 JUMP_FUNCTION, 1127 JUMP_FUNCTION,
1128 NullCallWrapper(), 1128 NullCallWrapper(),
1129 call_kind); 1129 call_kind);
1130 } 1130 }
1131 1131
1132 1132
1133 void CallIC::GenerateMegamorphic(MacroAssembler* masm, 1133 void CallIC::GenerateMegamorphic(MacroAssembler* masm,
1134 int argc, 1134 int argc,
1135 Code::ExtraICState extra_state) { 1135 ExtraICState extra_state) {
1136 // ----------- S t a t e ------------- 1136 // ----------- S t a t e -------------
1137 // -- ecx : name 1137 // -- ecx : name
1138 // -- esp[0] : return address 1138 // -- esp[0] : return address
1139 // -- esp[(argc - n) * 4] : arg[n] (zero-based) 1139 // -- esp[(argc - n) * 4] : arg[n] (zero-based)
1140 // -- ... 1140 // -- ...
1141 // -- esp[(argc + 1) * 4] : receiver 1141 // -- esp[(argc + 1) * 4] : receiver
1142 // ----------------------------------- 1142 // -----------------------------------
1143 1143
1144 // Get the receiver of the function from the stack; 1 ~ return address. 1144 // Get the receiver of the function from the stack; 1 ~ return address.
1145 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); 1145 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 &lookup_monomorphic_cache, 1242 &lookup_monomorphic_cache,
1243 DONT_DO_SMI_CHECK); 1243 DONT_DO_SMI_CHECK);
1244 1244
1245 GenerateDictionaryLoad(masm, &slow_load, ebx, ecx, eax, edi, edi); 1245 GenerateDictionaryLoad(masm, &slow_load, ebx, ecx, eax, edi, edi);
1246 __ IncrementCounter(counters->keyed_call_generic_lookup_dict(), 1); 1246 __ IncrementCounter(counters->keyed_call_generic_lookup_dict(), 1);
1247 __ jmp(&do_call); 1247 __ jmp(&do_call);
1248 1248
1249 __ bind(&lookup_monomorphic_cache); 1249 __ bind(&lookup_monomorphic_cache);
1250 __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1); 1250 __ IncrementCounter(counters->keyed_call_generic_lookup_cache(), 1);
1251 CallICBase::GenerateMonomorphicCacheProbe(masm, argc, Code::KEYED_CALL_IC, 1251 CallICBase::GenerateMonomorphicCacheProbe(masm, argc, Code::KEYED_CALL_IC,
1252 Code::kNoExtraICState); 1252 kNoExtraICState);
1253 // Fall through on miss. 1253 // Fall through on miss.
1254 1254
1255 __ bind(&slow_call); 1255 __ bind(&slow_call);
1256 // This branch is taken if: 1256 // This branch is taken if:
1257 // - the receiver requires boxing or access check, 1257 // - the receiver requires boxing or access check,
1258 // - the key is neither smi nor a unique name, 1258 // - the key is neither smi nor a unique name,
1259 // - the value loaded is not a function, 1259 // - the value loaded is not a function,
1260 // - there is hope that the runtime will create a monomorphic call stub 1260 // - there is hope that the runtime will create a monomorphic call stub
1261 // that will get fetched next time. 1261 // that will get fetched next time.
1262 __ IncrementCounter(counters->keyed_call_generic_slow(), 1); 1262 __ IncrementCounter(counters->keyed_call_generic_slow(), 1);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 1320
1321 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { 1321 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
1322 // ----------- S t a t e ------------- 1322 // ----------- S t a t e -------------
1323 // -- ecx : name 1323 // -- ecx : name
1324 // -- edx : receiver 1324 // -- edx : receiver
1325 // -- esp[0] : return address 1325 // -- esp[0] : return address
1326 // ----------------------------------- 1326 // -----------------------------------
1327 1327
1328 // Probe the stub cache. 1328 // Probe the stub cache.
1329 Code::Flags flags = Code::ComputeFlags( 1329 Code::Flags flags = Code::ComputeFlags(
1330 Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, 1330 Code::HANDLER, MONOMORPHIC, kNoExtraICState,
1331 Code::NORMAL, Code::LOAD_IC); 1331 Code::NORMAL, Code::LOAD_IC);
1332 masm->isolate()->stub_cache()->GenerateProbe( 1332 masm->isolate()->stub_cache()->GenerateProbe(
1333 masm, flags, edx, ecx, ebx, eax); 1333 masm, flags, edx, ecx, ebx, eax);
1334 1334
1335 // Cache miss: Jump to runtime. 1335 // Cache miss: Jump to runtime.
1336 GenerateMiss(masm); 1336 GenerateMiss(masm);
1337 } 1337 }
1338 1338
1339 1339
1340 void LoadIC::GenerateNormal(MacroAssembler* masm) { 1340 void LoadIC::GenerateNormal(MacroAssembler* masm) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 __ push(edx); // receiver 1428 __ push(edx); // receiver
1429 __ push(ecx); // name 1429 __ push(ecx); // name
1430 __ push(ebx); // return address 1430 __ push(ebx); // return address
1431 1431
1432 // Perform tail call to the entry. 1432 // Perform tail call to the entry.
1433 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); 1433 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
1434 } 1434 }
1435 1435
1436 1436
1437 void StoreIC::GenerateMegamorphic(MacroAssembler* masm, 1437 void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
1438 StrictModeFlag strict_mode) { 1438 ExtraICState extra_ic_state) {
1439 // ----------- S t a t e ------------- 1439 // ----------- S t a t e -------------
1440 // -- eax : value 1440 // -- eax : value
1441 // -- ecx : name 1441 // -- ecx : name
1442 // -- edx : receiver 1442 // -- edx : receiver
1443 // -- esp[0] : return address 1443 // -- esp[0] : return address
1444 // ----------------------------------- 1444 // -----------------------------------
1445
1446 Code::Flags flags = Code::ComputeFlags( 1445 Code::Flags flags = Code::ComputeFlags(
1447 Code::HANDLER, MONOMORPHIC, strict_mode, 1446 Code::HANDLER, MONOMORPHIC, extra_ic_state,
1448 Code::NORMAL, Code::STORE_IC); 1447 Code::NORMAL, Code::STORE_IC);
1449 masm->isolate()->stub_cache()->GenerateProbe( 1448 masm->isolate()->stub_cache()->GenerateProbe(
1450 masm, flags, edx, ecx, ebx, no_reg); 1449 masm, flags, edx, ecx, ebx, no_reg);
1451 1450
1452 // Cache miss: Jump to runtime. 1451 // Cache miss: Jump to runtime.
1453 GenerateMiss(masm); 1452 GenerateMiss(masm);
1454 } 1453 }
1455 1454
1456 1455
1457 void StoreIC::GenerateMiss(MacroAssembler* masm) { 1456 void StoreIC::GenerateMiss(MacroAssembler* masm) {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) 1676 Condition cc = (check == ENABLE_INLINED_SMI_CHECK)
1678 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 1677 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
1679 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 1678 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
1680 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1679 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1681 } 1680 }
1682 1681
1683 1682
1684 } } // namespace v8::internal 1683 } } // namespace v8::internal
1685 1684
1686 #endif // V8_TARGET_ARCH_IA32 1685 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698