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

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: final review feedback 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
« no previous file with comments | « src/heap.h ('k') | src/ia32/macro-assembler-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 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 &miss, // When not a number. 648 &miss, // When not a number.
649 &miss, // When index out of range. 649 &miss, // When index out of range.
650 STRING_INDEX_IS_ARRAY_INDEX); 650 STRING_INDEX_IS_ARRAY_INDEX);
651 char_at_generator.GenerateFast(masm); 651 char_at_generator.GenerateFast(masm);
652 __ ret(0); 652 __ ret(0);
653 653
654 StubRuntimeCallHelper call_helper; 654 StubRuntimeCallHelper call_helper;
655 char_at_generator.GenerateSlow(masm, call_helper); 655 char_at_generator.GenerateSlow(masm, call_helper);
656 656
657 __ bind(&miss); 657 __ bind(&miss);
658 GenerateMiss(masm); 658 GenerateMiss(masm, false);
659 } 659 }
660 660
661 661
662 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { 662 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
663 // ----------- S t a t e ------------- 663 // ----------- S t a t e -------------
664 // -- eax : key 664 // -- eax : key
665 // -- edx : receiver 665 // -- edx : receiver
666 // -- esp[0] : return address 666 // -- esp[0] : return address
667 // ----------------------------------- 667 // -----------------------------------
668 Label slow; 668 Label slow;
(...skipping 22 matching lines...) Expand all
691 __ push(eax); // key 691 __ push(eax); // key
692 __ push(ecx); // return address 692 __ push(ecx); // return address
693 693
694 // Perform tail call to the entry. 694 // Perform tail call to the entry.
695 ExternalReference ref = 695 ExternalReference ref =
696 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), 696 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor),
697 masm->isolate()); 697 masm->isolate());
698 __ TailCallExternalReference(ref, 2, 1); 698 __ TailCallExternalReference(ref, 2, 1);
699 699
700 __ bind(&slow); 700 __ bind(&slow);
701 GenerateMiss(masm); 701 GenerateMiss(masm, false);
702 } 702 }
703 703
704 704
705 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, 705 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
706 StrictModeFlag strict_mode) { 706 StrictModeFlag strict_mode) {
707 // ----------- S t a t e ------------- 707 // ----------- S t a t e -------------
708 // -- eax : value 708 // -- eax : value
709 // -- ecx : key 709 // -- ecx : key
710 // -- edx : receiver 710 // -- edx : receiver
711 // -- esp[0] : return address 711 // -- esp[0] : return address
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 __ push(ecx); // name 1215 __ push(ecx); // name
1216 __ push(ebx); // return address 1216 __ push(ebx); // return address
1217 1217
1218 // Perform tail call to the entry. 1218 // Perform tail call to the entry.
1219 ExternalReference ref = 1219 ExternalReference ref =
1220 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); 1220 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate());
1221 __ TailCallExternalReference(ref, 2, 1); 1221 __ TailCallExternalReference(ref, 2, 1);
1222 } 1222 }
1223 1223
1224 1224
1225 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 1225 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, bool force_generic) {
1226 // ----------- S t a t e ------------- 1226 // ----------- S t a t e -------------
1227 // -- eax : key 1227 // -- eax : key
1228 // -- edx : receiver 1228 // -- edx : receiver
1229 // -- esp[0] : return address 1229 // -- esp[0] : return address
1230 // ----------------------------------- 1230 // -----------------------------------
1231 1231
1232 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); 1232 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1);
1233 1233
1234 __ pop(ebx); 1234 __ pop(ebx);
1235 __ push(edx); // receiver 1235 __ push(edx); // receiver
1236 __ push(eax); // name 1236 __ push(eax); // name
1237 __ push(ebx); // return address 1237 __ push(ebx); // return address
1238 1238
1239 // Perform tail call to the entry. 1239 // Perform tail call to the entry.
1240 ExternalReference ref = 1240 ExternalReference ref = force_generic
1241 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); 1241 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric),
1242 masm->isolate())
1243 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
1242 __ TailCallExternalReference(ref, 2, 1); 1244 __ TailCallExternalReference(ref, 2, 1);
1243 } 1245 }
1244 1246
1245 1247
1246 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 1248 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
1247 // ----------- S t a t e ------------- 1249 // ----------- S t a t e -------------
1248 // -- eax : key 1250 // -- eax : key
1249 // -- edx : receiver 1251 // -- edx : receiver
1250 // -- esp[0] : return address 1252 // -- esp[0] : return address
1251 // ----------------------------------- 1253 // -----------------------------------
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 __ push(eax); 1425 __ push(eax);
1424 __ push(Immediate(Smi::FromInt(NONE))); // PropertyAttributes 1426 __ push(Immediate(Smi::FromInt(NONE))); // PropertyAttributes
1425 __ push(Immediate(Smi::FromInt(strict_mode))); // Strict mode. 1427 __ push(Immediate(Smi::FromInt(strict_mode))); // Strict mode.
1426 __ push(ebx); // return address 1428 __ push(ebx); // return address
1427 1429
1428 // Do tail-call to runtime routine. 1430 // Do tail-call to runtime routine.
1429 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); 1431 __ TailCallRuntime(Runtime::kSetProperty, 5, 1);
1430 } 1432 }
1431 1433
1432 1434
1433 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 1435 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, bool force_generic) {
1434 // ----------- S t a t e ------------- 1436 // ----------- S t a t e -------------
1435 // -- eax : value 1437 // -- eax : value
1436 // -- ecx : key 1438 // -- ecx : key
1437 // -- edx : receiver 1439 // -- edx : receiver
1438 // -- esp[0] : return address 1440 // -- esp[0] : return address
1439 // ----------------------------------- 1441 // -----------------------------------
1440 1442
1441 __ pop(ebx); 1443 __ pop(ebx);
1442 __ push(edx); 1444 __ push(edx);
1443 __ push(ecx); 1445 __ push(ecx);
1444 __ push(eax); 1446 __ push(eax);
1445 __ push(ebx); 1447 __ push(ebx);
1446 1448
1447 // Do tail-call to runtime routine. 1449 // Do tail-call to runtime routine.
1448 ExternalReference ref = 1450 ExternalReference ref = force_generic
1449 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); 1451 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric),
1452 masm->isolate())
1453 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
1450 __ TailCallExternalReference(ref, 3, 1); 1454 __ TailCallExternalReference(ref, 3, 1);
1451 } 1455 }
1452 1456
1453 1457
1458 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
1459 // ----------- S t a t e -------------
1460 // -- eax : value
1461 // -- ecx : key
1462 // -- edx : receiver
1463 // -- esp[0] : return address
1464 // -----------------------------------
1465
1466 __ pop(ebx);
1467 __ push(edx);
1468 __ push(ecx);
1469 __ push(eax);
1470 __ push(Immediate(Smi::FromInt(NONE))); // PropertyAttributes
1471 __ push(ebx); // return address
1472
1473 // Do tail-call to runtime routine.
1474 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
1475 __ TailCallExternalReference(ref, 4, 1);
1476 }
1477
1478
1454 #undef __ 1479 #undef __
1455 1480
1456 1481
1457 Condition CompareIC::ComputeCondition(Token::Value op) { 1482 Condition CompareIC::ComputeCondition(Token::Value op) {
1458 switch (op) { 1483 switch (op) {
1459 case Token::EQ_STRICT: 1484 case Token::EQ_STRICT:
1460 case Token::EQ: 1485 case Token::EQ:
1461 return equal; 1486 return equal;
1462 case Token::LT: 1487 case Token::LT:
1463 return less; 1488 return less;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1572 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1548 ? not_zero 1573 ? not_zero
1549 : zero; 1574 : zero;
1550 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1575 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1551 } 1576 }
1552 1577
1553 1578
1554 } } // namespace v8::internal 1579 } } // namespace v8::internal
1555 1580
1556 #endif // V8_TARGET_ARCH_IA32 1581 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698