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

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

Issue 6894003: Better support for 'polymorphic' JS and external arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: merge with latest Created 9 years, 7 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
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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 &miss, // When not a number. 642 &miss, // When not a number.
643 &miss, // When index out of range. 643 &miss, // When index out of range.
644 STRING_INDEX_IS_ARRAY_INDEX); 644 STRING_INDEX_IS_ARRAY_INDEX);
645 char_at_generator.GenerateFast(masm); 645 char_at_generator.GenerateFast(masm);
646 __ ret(0); 646 __ ret(0);
647 647
648 StubRuntimeCallHelper call_helper; 648 StubRuntimeCallHelper call_helper;
649 char_at_generator.GenerateSlow(masm, call_helper); 649 char_at_generator.GenerateSlow(masm, call_helper);
650 650
651 __ bind(&miss); 651 __ bind(&miss);
652 GenerateMiss(masm); 652 GenerateMiss(masm, false);
653 } 653 }
654 654
655 655
656 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { 656 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
657 // ----------- S t a t e ------------- 657 // ----------- S t a t e -------------
658 // -- eax : key 658 // -- eax : key
659 // -- edx : receiver 659 // -- edx : receiver
660 // -- esp[0] : return address 660 // -- esp[0] : return address
661 // ----------------------------------- 661 // -----------------------------------
662 Label slow; 662 Label slow;
(...skipping 22 matching lines...) Expand all
685 __ push(eax); // key 685 __ push(eax); // key
686 __ push(ecx); // return address 686 __ push(ecx); // return address
687 687
688 // Perform tail call to the entry. 688 // Perform tail call to the entry.
689 ExternalReference ref = 689 ExternalReference ref =
690 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), 690 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor),
691 masm->isolate()); 691 masm->isolate());
692 __ TailCallExternalReference(ref, 2, 1); 692 __ TailCallExternalReference(ref, 2, 1);
693 693
694 __ bind(&slow); 694 __ bind(&slow);
695 GenerateMiss(masm); 695 GenerateMiss(masm, false);
696 } 696 }
697 697
698 698
699 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, 699 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
700 StrictModeFlag strict_mode) { 700 StrictModeFlag strict_mode) {
701 // ----------- S t a t e ------------- 701 // ----------- S t a t e -------------
702 // -- eax : value 702 // -- eax : value
703 // -- ecx : key 703 // -- ecx : key
704 // -- edx : receiver 704 // -- edx : receiver
705 // -- esp[0] : return address 705 // -- esp[0] : return address
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 __ push(ecx); // name 1206 __ push(ecx); // name
1207 __ push(ebx); // return address 1207 __ push(ebx); // return address
1208 1208
1209 // Perform tail call to the entry. 1209 // Perform tail call to the entry.
1210 ExternalReference ref = 1210 ExternalReference ref =
1211 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); 1211 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate());
1212 __ TailCallExternalReference(ref, 2, 1); 1212 __ TailCallExternalReference(ref, 2, 1);
1213 } 1213 }
1214 1214
1215 1215
1216 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 1216 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, bool force_generic) {
1217 // ----------- S t a t e ------------- 1217 // ----------- S t a t e -------------
1218 // -- eax : key 1218 // -- eax : key
1219 // -- edx : receiver 1219 // -- edx : receiver
1220 // -- esp[0] : return address 1220 // -- esp[0] : return address
1221 // ----------------------------------- 1221 // -----------------------------------
1222 1222
1223 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); 1223 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1);
1224 1224
1225 __ pop(ebx); 1225 __ pop(ebx);
1226 __ push(edx); // receiver 1226 __ push(edx); // receiver
1227 __ push(eax); // name 1227 __ push(eax); // name
1228 __ push(ebx); // return address 1228 __ push(ebx); // return address
1229 1229
1230 // Perform tail call to the entry. 1230 // Perform tail call to the entry.
1231 ExternalReference ref = 1231 ExternalReference ref = force_generic
1232 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); 1232 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric),
1233 masm->isolate())
1234 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
1233 __ TailCallExternalReference(ref, 2, 1); 1235 __ TailCallExternalReference(ref, 2, 1);
1234 } 1236 }
1235 1237
1236 1238
1237 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 1239 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
1238 // ----------- S t a t e ------------- 1240 // ----------- S t a t e -------------
1239 // -- eax : key 1241 // -- eax : key
1240 // -- edx : receiver 1242 // -- edx : receiver
1241 // -- esp[0] : return address 1243 // -- esp[0] : return address
1242 // ----------------------------------- 1244 // -----------------------------------
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 __ push(eax); 1416 __ push(eax);
1415 __ push(Immediate(Smi::FromInt(NONE))); // PropertyAttributes 1417 __ push(Immediate(Smi::FromInt(NONE))); // PropertyAttributes
1416 __ push(Immediate(Smi::FromInt(strict_mode))); // Strict mode. 1418 __ push(Immediate(Smi::FromInt(strict_mode))); // Strict mode.
1417 __ push(ebx); // return address 1419 __ push(ebx); // return address
1418 1420
1419 // Do tail-call to runtime routine. 1421 // Do tail-call to runtime routine.
1420 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); 1422 __ TailCallRuntime(Runtime::kSetProperty, 5, 1);
1421 } 1423 }
1422 1424
1423 1425
1424 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 1426 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, bool force_generic) {
1425 // ----------- S t a t e ------------- 1427 // ----------- S t a t e -------------
1426 // -- eax : value 1428 // -- eax : value
1427 // -- ecx : key 1429 // -- ecx : key
1428 // -- edx : receiver 1430 // -- edx : receiver
1429 // -- esp[0] : return address 1431 // -- esp[0] : return address
1430 // ----------------------------------- 1432 // -----------------------------------
1431 1433
1432 __ pop(ebx); 1434 __ pop(ebx);
1433 __ push(edx); 1435 __ push(edx);
1434 __ push(ecx); 1436 __ push(ecx);
1435 __ push(eax); 1437 __ push(eax);
1436 __ push(ebx); 1438 __ push(ebx);
1437 1439
1438 // Do tail-call to runtime routine. 1440 // Do tail-call to runtime routine.
1439 ExternalReference ref = 1441 ExternalReference ref = force_generic
1440 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); 1442 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric),
1443 masm->isolate())
1444 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
1441 __ TailCallExternalReference(ref, 3, 1); 1445 __ TailCallExternalReference(ref, 3, 1);
1442 } 1446 }
1443 1447
1444 1448
1449 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
1450 // ----------- S t a t e -------------
1451 // -- eax : value
1452 // -- ecx : key
1453 // -- edx : receiver
1454 // -- esp[0] : return address
1455 // -----------------------------------
1456
1457 __ pop(ebx);
1458 __ push(edx);
1459 __ push(ecx);
1460 __ push(eax);
1461 __ push(Immediate(Smi::FromInt(NONE))); // PropertyAttributes
1462 __ push(ebx); // return address
1463
1464 // Do tail-call to runtime routine.
1465 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
1466 __ TailCallExternalReference(ref, 4, 1);
1467 }
1468
1469
1445 #undef __ 1470 #undef __
1446 1471
1447 1472
1448 Condition CompareIC::ComputeCondition(Token::Value op) { 1473 Condition CompareIC::ComputeCondition(Token::Value op) {
1449 switch (op) { 1474 switch (op) {
1450 case Token::EQ_STRICT: 1475 case Token::EQ_STRICT:
1451 case Token::EQ: 1476 case Token::EQ:
1452 return equal; 1477 return equal;
1453 case Token::LT: 1478 case Token::LT:
1454 return less; 1479 return less;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1563 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1539 ? not_zero 1564 ? not_zero
1540 : zero; 1565 : zero;
1541 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1566 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1542 } 1567 }
1543 1568
1544 1569
1545 } } // namespace v8::internal 1570 } } // namespace v8::internal
1546 1571
1547 #endif // V8_TARGET_ARCH_IA32 1572 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698