OLD | NEW |
---|---|
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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
661 __ Move(ToRegister(instr->result()), instr->value()); | 661 __ Move(ToRegister(instr->result()), instr->value()); |
662 } | 662 } |
663 | 663 |
664 | 664 |
665 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { | 665 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { |
666 Abort("Unimplemented: %s", "DoJSArrayLength"); | 666 Abort("Unimplemented: %s", "DoJSArrayLength"); |
667 } | 667 } |
668 | 668 |
669 | 669 |
670 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { | 670 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { |
671 Abort("Unimplemented: %s", "DoFixedArrayLength"); | 671 Register result = ToRegister(instr->result()); |
672 Register array = ToRegister(instr->InputAt(0)); | |
673 __ movq(result, FieldOperand(array, FixedArray::kLengthOffset)); | |
672 } | 674 } |
673 | 675 |
674 | 676 |
675 void LCodeGen::DoValueOf(LValueOf* instr) { | 677 void LCodeGen::DoValueOf(LValueOf* instr) { |
676 Abort("Unimplemented: %s", "DoValueOf"); | 678 Abort("Unimplemented: %s", "DoValueOf"); |
677 } | 679 } |
678 | 680 |
679 | 681 |
680 void LCodeGen::DoBitNotI(LBitNotI* instr) { | 682 void LCodeGen::DoBitNotI(LBitNotI* instr) { |
681 Abort("Unimplemented: %s", "DoBitNotI"); | 683 Abort("Unimplemented: %s", "DoBitNotI"); |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1439 Abort("Unimplemented: %s", "DoLoadNamedGeneric"); | 1441 Abort("Unimplemented: %s", "DoLoadNamedGeneric"); |
1440 } | 1442 } |
1441 | 1443 |
1442 | 1444 |
1443 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 1445 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
1444 Abort("Unimplemented: %s", "DoLoadFunctionPrototype"); | 1446 Abort("Unimplemented: %s", "DoLoadFunctionPrototype"); |
1445 } | 1447 } |
1446 | 1448 |
1447 | 1449 |
1448 void LCodeGen::DoLoadElements(LLoadElements* instr) { | 1450 void LCodeGen::DoLoadElements(LLoadElements* instr) { |
1449 Abort("Unimplemented: %s", "DoLoadElements"); | 1451 ASSERT(instr->result()->Equals(instr->InputAt(0))); |
1452 Register reg = ToRegister(instr->InputAt(0)); | |
1453 __ movq(reg, FieldOperand(reg, JSObject::kElementsOffset)); | |
1454 if (FLAG_debug_code) { | |
1455 NearLabel done; | |
1456 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), | |
1457 Factory::fixed_array_map()); | |
1458 __ j(equal, &done); | |
1459 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), | |
1460 Factory::fixed_cow_array_map()); | |
1461 __ Check(equal, "Check for fast elements failed."); | |
1462 __ bind(&done); | |
1463 } | |
1450 } | 1464 } |
1451 | 1465 |
1452 | 1466 |
1453 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 1467 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
1454 Abort("Unimplemented: %s", "DoAccessArgumentsAt"); | 1468 Abort("Unimplemented: %s", "DoAccessArgumentsAt"); |
1455 } | 1469 } |
1456 | 1470 |
1457 | 1471 |
1458 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { | 1472 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { |
1459 Abort("Unimplemented: %s", "DoLoadKeyedFastElement"); | 1473 Register elements = ToRegister(instr->elements()); |
1474 Register key = ToRegister(instr->key()); | |
1475 Register result = ToRegister(instr->result()); | |
1476 ASSERT(result.is(elements)); | |
1477 | |
1478 // Load the result. | |
1479 __ movq(result, FieldOperand(elements, | |
1480 key, | |
1481 times_pointer_size, | |
1482 FixedArray::kHeaderSize)); | |
1483 | |
1484 // Check for the hole value. | |
1485 __ Cmp(result, Factory::the_hole_value()); | |
1486 DeoptimizeIf(equal, instr->environment()); | |
1460 } | 1487 } |
1461 | 1488 |
1462 | 1489 |
1463 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 1490 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
1464 Abort("Unimplemented: %s", "DoLoadKeyedGeneric"); | 1491 Abort("Unimplemented: %s", "DoLoadKeyedGeneric"); |
1465 } | 1492 } |
1466 | 1493 |
1467 | 1494 |
1468 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 1495 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
1469 Abort("Unimplemented: %s", "DoArgumentsElements"); | 1496 Abort("Unimplemented: %s", "DoArgumentsElements"); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1684 } | 1711 } |
1685 } | 1712 } |
1686 | 1713 |
1687 | 1714 |
1688 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 1715 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
1689 Abort("Unimplemented: %s", "DoStoreNamedGeneric"); | 1716 Abort("Unimplemented: %s", "DoStoreNamedGeneric"); |
1690 } | 1717 } |
1691 | 1718 |
1692 | 1719 |
1693 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 1720 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
1694 Abort("Unimplemented: %s", "DoBoundsCheck"); | 1721 if (instr->length()->IsRegister()) { |
1722 __ cmpq(ToRegister(instr->index()), ToRegister(instr->length())); | |
1723 } else { | |
1724 __ cmpq(ToRegister(instr->index()), ToOperand(instr->length())); | |
Rico
2011/02/03 16:56:47
Maybe we should create a macro, TO_REGISTER_OR_OPE
| |
1725 } | |
1726 DeoptimizeIf(above_equal, instr->environment()); | |
1695 } | 1727 } |
1696 | 1728 |
1697 | 1729 |
1698 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { | 1730 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { |
1699 Abort("Unimplemented: %s", "DoStoreKeyedFastElement"); | 1731 Abort("Unimplemented: %s", "DoStoreKeyedFastElement"); |
1700 } | 1732 } |
1701 | 1733 |
1702 | 1734 |
1703 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 1735 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
1704 Abort("Unimplemented: %s", "DoStoreKeyedGeneric"); | 1736 Abort("Unimplemented: %s", "DoStoreKeyedGeneric"); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2037 | 2069 |
2038 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2070 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
2039 Abort("Unimplemented: %s", "DoOsrEntry"); | 2071 Abort("Unimplemented: %s", "DoOsrEntry"); |
2040 } | 2072 } |
2041 | 2073 |
2042 #undef __ | 2074 #undef __ |
2043 | 2075 |
2044 } } // namespace v8::internal | 2076 } } // namespace v8::internal |
2045 | 2077 |
2046 #endif // V8_TARGET_ARCH_X64 | 2078 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |