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

Side by Side Diff: src/x64/ic-x64.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/v8-counters.h ('k') | src/x64/macro-assembler-x64.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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 &miss, // When not a number. 651 &miss, // When not a number.
652 &miss, // When index out of range. 652 &miss, // When index out of range.
653 STRING_INDEX_IS_ARRAY_INDEX); 653 STRING_INDEX_IS_ARRAY_INDEX);
654 char_at_generator.GenerateFast(masm); 654 char_at_generator.GenerateFast(masm);
655 __ ret(0); 655 __ ret(0);
656 656
657 StubRuntimeCallHelper call_helper; 657 StubRuntimeCallHelper call_helper;
658 char_at_generator.GenerateSlow(masm, call_helper); 658 char_at_generator.GenerateSlow(masm, call_helper);
659 659
660 __ bind(&miss); 660 __ bind(&miss);
661 GenerateMiss(masm); 661 GenerateMiss(masm, false);
662 } 662 }
663 663
664 664
665 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { 665 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
666 // ----------- S t a t e ------------- 666 // ----------- S t a t e -------------
667 // -- rax : key 667 // -- rax : key
668 // -- rdx : receiver 668 // -- rdx : receiver
669 // -- rsp[0] : return address 669 // -- rsp[0] : return address
670 // ----------------------------------- 670 // -----------------------------------
671 Label slow; 671 Label slow;
(...skipping 22 matching lines...) Expand all
694 __ push(rcx); // return address 694 __ push(rcx); // return address
695 695
696 // Perform tail call to the entry. 696 // Perform tail call to the entry.
697 __ TailCallExternalReference( 697 __ TailCallExternalReference(
698 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), 698 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor),
699 masm->isolate()), 699 masm->isolate()),
700 2, 700 2,
701 1); 701 1);
702 702
703 __ bind(&slow); 703 __ bind(&slow);
704 GenerateMiss(masm); 704 GenerateMiss(masm, false);
705 } 705 }
706 706
707 707
708 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, 708 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
709 StrictModeFlag strict_mode) { 709 StrictModeFlag strict_mode) {
710 // ----------- S t a t e ------------- 710 // ----------- S t a t e -------------
711 // -- rax : value 711 // -- rax : value
712 // -- rcx : key 712 // -- rcx : key
713 // -- rdx : receiver 713 // -- rdx : receiver
714 // -- rsp[0] : return address 714 // -- rsp[0] : return address
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 __ push(rcx); // name 1233 __ push(rcx); // name
1234 __ push(rbx); // return address 1234 __ push(rbx); // return address
1235 1235
1236 // Perform tail call to the entry. 1236 // Perform tail call to the entry.
1237 ExternalReference ref = 1237 ExternalReference ref =
1238 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); 1238 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate());
1239 __ TailCallExternalReference(ref, 2, 1); 1239 __ TailCallExternalReference(ref, 2, 1);
1240 } 1240 }
1241 1241
1242 1242
1243 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 1243 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, bool force_generic) {
1244 // ----------- S t a t e ------------- 1244 // ----------- S t a t e -------------
1245 // -- rax : key 1245 // -- rax : key
1246 // -- rdx : receiver 1246 // -- rdx : receiver
1247 // -- rsp[0] : return address 1247 // -- rsp[0] : return address
1248 // ----------------------------------- 1248 // -----------------------------------
1249 1249
1250 Counters* counters = masm->isolate()->counters(); 1250 Counters* counters = masm->isolate()->counters();
1251 __ IncrementCounter(counters->keyed_load_miss(), 1); 1251 __ IncrementCounter(counters->keyed_load_miss(), 1);
1252 1252
1253 __ pop(rbx); 1253 __ pop(rbx);
1254 __ push(rdx); // receiver 1254 __ push(rdx); // receiver
1255 __ push(rax); // name 1255 __ push(rax); // name
1256 __ push(rbx); // return address 1256 __ push(rbx); // return address
1257 1257
1258 // Perform tail call to the entry. 1258 // Perform tail call to the entry.
1259 ExternalReference ref 1259 ExternalReference ref = force_generic
1260 = ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); 1260 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric),
1261 masm->isolate())
1262 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate());
1261 __ TailCallExternalReference(ref, 2, 1); 1263 __ TailCallExternalReference(ref, 2, 1);
1262 } 1264 }
1263 1265
1264 1266
1265 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 1267 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
1266 // ----------- S t a t e ------------- 1268 // ----------- S t a t e -------------
1267 // -- rax : key 1269 // -- rax : key
1268 // -- rdx : receiver 1270 // -- rdx : receiver
1269 // -- rsp[0] : return address 1271 // -- rsp[0] : return address
1270 // ----------------------------------- 1272 // -----------------------------------
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 __ push(rax); // value 1436 __ push(rax); // value
1435 __ Push(Smi::FromInt(NONE)); // PropertyAttributes 1437 __ Push(Smi::FromInt(NONE)); // PropertyAttributes
1436 __ Push(Smi::FromInt(strict_mode)); // Strict mode. 1438 __ Push(Smi::FromInt(strict_mode)); // Strict mode.
1437 __ push(rbx); // return address 1439 __ push(rbx); // return address
1438 1440
1439 // Do tail-call to runtime routine. 1441 // Do tail-call to runtime routine.
1440 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); 1442 __ TailCallRuntime(Runtime::kSetProperty, 5, 1);
1441 } 1443 }
1442 1444
1443 1445
1444 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 1446 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
1445 // ----------- S t a t e ------------- 1447 // ----------- S t a t e -------------
1446 // -- rax : value 1448 // -- rax : value
1447 // -- rcx : key 1449 // -- rcx : key
1448 // -- rdx : receiver 1450 // -- rdx : receiver
1449 // -- rsp[0] : return address 1451 // -- rsp[0] : return address
1450 // ----------------------------------- 1452 // -----------------------------------
1451 1453
1452 __ pop(rbx); 1454 __ pop(rbx);
1453 __ push(rdx); // receiver 1455 __ push(rdx); // receiver
1454 __ push(rcx); // key 1456 __ push(rcx); // key
1455 __ push(rax); // value 1457 __ push(rax); // value
1458 __ Push(Smi::FromInt(NONE)); // PropertyAttributes
1459 __ push(rbx); // return address
1460
1461 // Do tail-call to runtime routine.
1462 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
1463 __ TailCallExternalReference(ref, 4, 1);
1464 }
1465
1466
1467 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, bool force_generic) {
1468 // ----------- S t a t e -------------
1469 // -- rax : value
1470 // -- rcx : key
1471 // -- rdx : receiver
1472 // -- rsp[0] : return address
1473 // -----------------------------------
1474
1475 __ pop(rbx);
1476 __ push(rdx); // receiver
1477 __ push(rcx); // key
1478 __ push(rax); // value
1456 __ push(rbx); // return address 1479 __ push(rbx); // return address
1457 1480
1458 // Do tail-call to runtime routine. 1481 // Do tail-call to runtime routine.
1459 ExternalReference ref = 1482 ExternalReference ref = force_generic
1460 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); 1483 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric),
1484 masm->isolate())
1485 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
1461 __ TailCallExternalReference(ref, 3, 1); 1486 __ TailCallExternalReference(ref, 3, 1);
1462 } 1487 }
1463 1488
1464 1489
1465 #undef __ 1490 #undef __
1466 1491
1467 1492
1468 Condition CompareIC::ComputeCondition(Token::Value op) { 1493 Condition CompareIC::ComputeCondition(Token::Value op) {
1469 switch (op) { 1494 switch (op) {
1470 case Token::EQ_STRICT: 1495 case Token::EQ_STRICT:
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1582 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1558 ? not_zero 1583 ? not_zero
1559 : zero; 1584 : zero;
1560 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1585 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1561 } 1586 }
1562 1587
1563 1588
1564 } } // namespace v8::internal 1589 } } // namespace v8::internal
1565 1590
1566 #endif // V8_TARGET_ARCH_X64 1591 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/v8-counters.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698