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

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

Issue 652118: Refactored TailCallRuntime (splitted to TailCallRuntime and TailCallExternalReference) (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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/ia32/codegen-ia32.cc ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 __ cmp(Operand(ecx), Immediate(1 << Map::kHasIndexedInterceptor)); 603 __ cmp(Operand(ecx), Immediate(1 << Map::kHasIndexedInterceptor));
604 __ j(not_zero, &slow, not_taken); 604 __ j(not_zero, &slow, not_taken);
605 605
606 // Everything is fine, call runtime. 606 // Everything is fine, call runtime.
607 __ pop(ecx); 607 __ pop(ecx);
608 __ push(edx); // receiver 608 __ push(edx); // receiver
609 __ push(eax); // key 609 __ push(eax); // key
610 __ push(ecx); // return address 610 __ push(ecx); // return address
611 611
612 // Perform tail call to the entry. 612 // Perform tail call to the entry.
613 __ TailCallRuntime(ExternalReference( 613 ExternalReference ref = ExternalReference(
614 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); 614 IC_Utility(kKeyedLoadPropertyWithInterceptor));
615 __ TailCallExternalReference(ref, 2, 1);
615 616
616 __ bind(&slow); 617 __ bind(&slow);
617 GenerateMiss(masm); 618 GenerateMiss(masm);
618 } 619 }
619 620
620 621
621 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { 622 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
622 // ----------- S t a t e ------------- 623 // ----------- S t a t e -------------
623 // -- eax : value 624 // -- eax : value
624 // -- esp[0] : return address 625 // -- esp[0] : return address
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 // -- ecx : name 1256 // -- ecx : name
1256 // -- esp[0] : return address 1257 // -- esp[0] : return address
1257 // ----------------------------------- 1258 // -----------------------------------
1258 1259
1259 __ pop(ebx); 1260 __ pop(ebx);
1260 __ push(eax); // receiver 1261 __ push(eax); // receiver
1261 __ push(ecx); // name 1262 __ push(ecx); // name
1262 __ push(ebx); // return address 1263 __ push(ebx); // return address
1263 1264
1264 // Perform tail call to the entry. 1265 // Perform tail call to the entry.
1265 __ TailCallRuntime(ExternalReference(IC_Utility(kLoadIC_Miss)), 2, 1); 1266 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss));
1267 __ TailCallExternalReference(ref, 2, 1);
1266 } 1268 }
1267 1269
1268 1270
1269 // One byte opcode for test eax,0xXXXXXXXX. 1271 // One byte opcode for test eax,0xXXXXXXXX.
1270 static const byte kTestEaxByte = 0xA9; 1272 static const byte kTestEaxByte = 0xA9;
1271 1273
1272 1274
1273 void LoadIC::ClearInlinedVersion(Address address) { 1275 void LoadIC::ClearInlinedVersion(Address address) {
1274 // Reset the map check of the inlined inobject property load (if 1276 // Reset the map check of the inlined inobject property load (if
1275 // present) to guarantee failure by holding an invalid map (the null 1277 // present) to guarantee failure by holding an invalid map (the null
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 // -- edx : receiver 1372 // -- edx : receiver
1371 // -- esp[0] : return address 1373 // -- esp[0] : return address
1372 // ----------------------------------- 1374 // -----------------------------------
1373 1375
1374 __ pop(ebx); 1376 __ pop(ebx);
1375 __ push(edx); // receiver 1377 __ push(edx); // receiver
1376 __ push(eax); // name 1378 __ push(eax); // name
1377 __ push(ebx); // return address 1379 __ push(ebx); // return address
1378 1380
1379 // Perform tail call to the entry. 1381 // Perform tail call to the entry.
1380 __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedLoadIC_Miss)), 2, 1); 1382 ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss));
1383 __ TailCallExternalReference(ref, 2, 1);
1381 } 1384 }
1382 1385
1383 1386
1384 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 1387 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
1385 // ----------- S t a t e ------------- 1388 // ----------- S t a t e -------------
1386 // -- eax : key 1389 // -- eax : key
1387 // -- edx : receiver 1390 // -- edx : receiver
1388 // -- esp[0] : return address 1391 // -- esp[0] : return address
1389 // ----------------------------------- 1392 // -----------------------------------
1390 1393
1391 __ pop(ebx); 1394 __ pop(ebx);
1392 __ push(edx); // receiver 1395 __ push(edx); // receiver
1393 __ push(eax); // name 1396 __ push(eax); // name
1394 __ push(ebx); // return address 1397 __ push(ebx); // return address
1395 1398
1396 // Perform tail call to the entry. 1399 // Perform tail call to the entry.
1397 __ TailCallRuntime(ExternalReference(Runtime::kKeyedGetProperty), 2, 1); 1400 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
1398 } 1401 }
1399 1402
1400 1403
1401 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 1404 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
1402 // ----------- S t a t e ------------- 1405 // ----------- S t a t e -------------
1403 // -- eax : value 1406 // -- eax : value
1404 // -- ecx : name 1407 // -- ecx : name
1405 // -- edx : receiver 1408 // -- edx : receiver
1406 // -- esp[0] : return address 1409 // -- esp[0] : return address
1407 // ----------------------------------- 1410 // -----------------------------------
(...skipping 16 matching lines...) Expand all
1424 // -- esp[0] : return address 1427 // -- esp[0] : return address
1425 // ----------------------------------- 1428 // -----------------------------------
1426 1429
1427 __ pop(ebx); 1430 __ pop(ebx);
1428 __ push(edx); 1431 __ push(edx);
1429 __ push(ecx); 1432 __ push(ecx);
1430 __ push(eax); 1433 __ push(eax);
1431 __ push(ebx); 1434 __ push(ebx);
1432 1435
1433 // Perform tail call to the entry. 1436 // Perform tail call to the entry.
1434 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1); 1437 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss));
1438 __ TailCallExternalReference(ref, 3, 1);
1435 } 1439 }
1436 1440
1437 1441
1438 void StoreIC::GenerateArrayLength(MacroAssembler* masm) { 1442 void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
1439 // ----------- S t a t e ------------- 1443 // ----------- S t a t e -------------
1440 // -- eax : value 1444 // -- eax : value
1441 // -- ecx : name 1445 // -- ecx : name
1442 // -- edx : receiver 1446 // -- edx : receiver
1443 // -- esp[0] : return address 1447 // -- esp[0] : return address
1444 // ----------------------------------- 1448 // -----------------------------------
(...skipping 26 matching lines...) Expand all
1471 // Check that value is a smi. 1475 // Check that value is a smi.
1472 __ test(value, Immediate(kSmiTagMask)); 1476 __ test(value, Immediate(kSmiTagMask));
1473 __ j(not_zero, &miss, not_taken); 1477 __ j(not_zero, &miss, not_taken);
1474 1478
1475 // Prepare tail call to StoreIC_ArrayLength. 1479 // Prepare tail call to StoreIC_ArrayLength.
1476 __ pop(scratch); 1480 __ pop(scratch);
1477 __ push(receiver); 1481 __ push(receiver);
1478 __ push(value); 1482 __ push(value);
1479 __ push(scratch); // return address 1483 __ push(scratch); // return address
1480 1484
1481 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_ArrayLength)), 2, 1); 1485 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength));
1486 __ TailCallExternalReference(ref, 2, 1);
1482 1487
1483 __ bind(&miss); 1488 __ bind(&miss);
1484 1489
1485 GenerateMiss(masm); 1490 GenerateMiss(masm);
1486 } 1491 }
1487 1492
1488 1493
1489 // Defined in ic.cc. 1494 // Defined in ic.cc.
1490 Object* KeyedStoreIC_Miss(Arguments args); 1495 Object* KeyedStoreIC_Miss(Arguments args);
1491 1496
1492 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) { 1497 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) {
1493 // ----------- S t a t e ------------- 1498 // ----------- S t a t e -------------
1494 // -- eax : value 1499 // -- eax : value
1495 // -- esp[0] : return address 1500 // -- esp[0] : return address
1496 // -- esp[4] : key 1501 // -- esp[4] : key
1497 // -- esp[8] : receiver 1502 // -- esp[8] : receiver
1498 // ----------------------------------- 1503 // -----------------------------------
1499 1504
1500 __ pop(ecx); 1505 __ pop(ecx);
1501 __ push(Operand(esp, 1 * kPointerSize)); 1506 __ push(Operand(esp, 1 * kPointerSize));
1502 __ push(Operand(esp, 1 * kPointerSize)); 1507 __ push(Operand(esp, 1 * kPointerSize));
1503 __ push(eax); 1508 __ push(eax);
1504 __ push(ecx); 1509 __ push(ecx);
1505 1510
1506 // Do tail-call to runtime routine. 1511 // Do tail-call to runtime routine.
1507 __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1); 1512 __ TailCallRuntime(Runtime::kSetProperty, 3, 1);
1508 } 1513 }
1509 1514
1510 1515
1511 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 1516 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
1512 // ----------- S t a t e ------------- 1517 // ----------- S t a t e -------------
1513 // -- eax : value 1518 // -- eax : value
1514 // -- esp[0] : return address 1519 // -- esp[0] : return address
1515 // -- esp[4] : key 1520 // -- esp[4] : key
1516 // -- esp[8] : receiver 1521 // -- esp[8] : receiver
1517 // ----------------------------------- 1522 // -----------------------------------
1518 1523
1519 __ pop(ecx); 1524 __ pop(ecx);
1520 __ push(Operand(esp, 1 * kPointerSize)); 1525 __ push(Operand(esp, 1 * kPointerSize));
1521 __ push(Operand(esp, 1 * kPointerSize)); 1526 __ push(Operand(esp, 1 * kPointerSize));
1522 __ push(eax); 1527 __ push(eax);
1523 __ push(ecx); 1528 __ push(ecx);
1524 1529
1525 // Do tail-call to runtime routine. 1530 // Do tail-call to runtime routine.
1526 __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3, 1); 1531 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss));
1532 __ TailCallExternalReference(ref, 3, 1);
1527 } 1533 }
1528 1534
1529 #undef __ 1535 #undef __
1530 1536
1531 1537
1532 } } // namespace v8::internal 1538 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698