Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 723 } | 723 } |
| 724 } | 724 } |
| 725 | 725 |
| 726 | 726 |
| 727 void LCodeGen::DoParameter(LParameter* instr) { | 727 void LCodeGen::DoParameter(LParameter* instr) { |
| 728 // Nothing to do. | 728 // Nothing to do. |
| 729 } | 729 } |
| 730 | 730 |
| 731 | 731 |
| 732 void LCodeGen::DoCallStub(LCallStub* instr) { | 732 void LCodeGen::DoCallStub(LCallStub* instr) { |
| 733 Abort("DoCallStub unimplemented."); | 733 ASSERT(ToRegister(instr->result()).is(r0)); |
| 734 switch (instr->hydrogen()->major_key()) { | |
| 735 case CodeStub::RegExpConstructResult: { | |
| 736 RegExpConstructResultStub stub; | |
| 737 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
| 738 break; | |
| 739 } | |
| 740 case CodeStub::RegExpExec: { | |
| 741 RegExpExecStub stub; | |
| 742 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
| 743 break; | |
| 744 } | |
| 745 case CodeStub::SubString: { | |
| 746 SubStringStub stub; | |
| 747 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
| 748 break; | |
| 749 } | |
| 750 case CodeStub::StringCharAt: { | |
| 751 Abort("StringCharAtStub unimplemented."); | |
| 752 break; | |
| 753 } | |
| 754 case CodeStub::MathPow: { | |
| 755 Abort("MathPowStub unimplemented."); | |
| 756 break; | |
| 757 } | |
| 758 case CodeStub::NumberToString: { | |
| 759 NumberToStringStub stub; | |
| 760 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
| 761 break; | |
| 762 } | |
| 763 case CodeStub::StringAdd: { | |
| 764 StringAddStub stub(NO_STRING_ADD_FLAGS); | |
| 765 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
| 766 break; | |
| 767 } | |
| 768 case CodeStub::StringCompare: { | |
| 769 StringCompareStub stub; | |
| 770 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
| 771 break; | |
| 772 } | |
| 773 case CodeStub::TranscendentalCache: { | |
| 774 Abort("TranscendentalCache unimplemented."); | |
| 775 break; | |
| 776 } | |
| 777 default: | |
| 778 UNREACHABLE(); | |
| 779 } | |
| 734 } | 780 } |
| 735 | 781 |
| 736 | 782 |
| 737 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { | 783 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { |
| 738 // Nothing to do. | 784 // Nothing to do. |
| 739 } | 785 } |
| 740 | 786 |
| 741 | 787 |
| 742 void LCodeGen::DoModI(LModI* instr) { | 788 void LCodeGen::DoModI(LModI* instr) { |
| 743 Abort("DoModI unimplemented."); | 789 Abort("DoModI unimplemented."); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 895 void LCodeGen::DoConstantT(LConstantT* instr) { | 941 void LCodeGen::DoConstantT(LConstantT* instr) { |
| 896 ASSERT(instr->result()->IsRegister()); | 942 ASSERT(instr->result()->IsRegister()); |
| 897 __ mov(ToRegister(instr->result()), Operand(instr->value())); | 943 __ mov(ToRegister(instr->result()), Operand(instr->value())); |
| 898 } | 944 } |
| 899 | 945 |
| 900 | 946 |
| 901 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { | 947 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { |
| 902 Register result = ToRegister(instr->result()); | 948 Register result = ToRegister(instr->result()); |
| 903 Register array = ToRegister(instr->input()); | 949 Register array = ToRegister(instr->input()); |
| 904 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset)); | 950 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset)); |
| 905 Abort("DoJSArrayLength untested."); | |
| 906 } | 951 } |
| 907 | 952 |
| 908 | 953 |
| 909 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { | 954 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { |
| 910 Register result = ToRegister(instr->result()); | 955 Register result = ToRegister(instr->result()); |
| 911 Register array = ToRegister(instr->input()); | 956 Register array = ToRegister(instr->input()); |
| 912 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset)); | 957 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset)); |
| 913 Abort("DoFixedArrayLength untested."); | 958 Abort("DoFixedArrayLength untested."); |
| 914 } | 959 } |
| 915 | 960 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1164 Abort("DoCmpJSObjectEq untested."); | 1209 Abort("DoCmpJSObjectEq untested."); |
| 1165 } | 1210 } |
| 1166 | 1211 |
| 1167 | 1212 |
| 1168 void LCodeGen::DoCmpJSObjectEqAndBranch(LCmpJSObjectEqAndBranch* instr) { | 1213 void LCodeGen::DoCmpJSObjectEqAndBranch(LCmpJSObjectEqAndBranch* instr) { |
| 1169 Abort("DoCmpJSObjectEqAndBranch unimplemented."); | 1214 Abort("DoCmpJSObjectEqAndBranch unimplemented."); |
| 1170 } | 1215 } |
| 1171 | 1216 |
| 1172 | 1217 |
| 1173 void LCodeGen::DoIsNull(LIsNull* instr) { | 1218 void LCodeGen::DoIsNull(LIsNull* instr) { |
| 1174 Abort("DoIsNull unimplemented."); | 1219 Register reg = ToRegister(instr->input()); |
| 1220 Register result = ToRegister(instr->result()); | |
| 1221 | |
| 1222 __ cmp(reg, Operand(Factory::null_value())); | |
|
Søren Thygesen Gjesse
2011/01/04 11:23:34
ou should use the root array for reading these fix
Karl Klose
2011/01/04 12:32:18
Done.
| |
| 1223 if (instr->is_strict()) { | |
|
Søren Thygesen Gjesse
2011/01/04 11:23:34
Two conditional LoadRoot should work here.
Karl Klose
2011/01/04 12:32:18
Done.
| |
| 1224 __ mov(result, Operand(Handle<Object>(Heap::true_value()))); | |
|
Søren Thygesen Gjesse
2011/01/04 11:23:34
Use root array.
Karl Klose
2011/01/04 12:32:18
Done.
| |
| 1225 Label done; | |
| 1226 __ b(eq, &done); | |
| 1227 __ mov(result, Operand(Handle<Object>(Heap::false_value()))); | |
|
Søren Thygesen Gjesse
2011/01/04 11:23:34
Use root array.
Karl Klose
2011/01/04 12:32:18
Done.
| |
| 1228 __ bind(&done); | |
| 1229 } else { | |
| 1230 Label true_value, false_value, done; | |
| 1231 __ b(eq, &true_value); | |
| 1232 __ cmp(reg, Operand(Factory::undefined_value())); | |
|
Søren Thygesen Gjesse
2011/01/04 11:23:34
Use root array.
Karl Klose
2011/01/04 12:32:18
Done.
| |
| 1233 __ b(eq, &true_value); | |
| 1234 __ tst(reg, Operand(kSmiTagMask)); | |
| 1235 __ b(eq, &false_value); | |
| 1236 // Check for undetectable objects by looking in the bit field in | |
| 1237 // the map. The object has already been smi checked. | |
| 1238 Register scratch = result; | |
| 1239 __ ldr(scratch, FieldMemOperand(reg, HeapObject::kMapOffset)); | |
|
Søren Thygesen Gjesse
2011/01/04 11:23:34
Code in comment.
Karl Klose
2011/01/04 12:32:18
Done.
| |
| 1240 //__ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset)); | |
| 1241 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); | |
| 1242 __ tst(scratch, Operand(1 << Map::kIsUndetectable)); | |
| 1243 __ b(ne, &true_value); | |
| 1244 __ bind(&false_value); | |
| 1245 __ mov(result, Operand(Handle<Object>(Heap::false_value()))); | |
|
Søren Thygesen Gjesse
2011/01/04 11:23:34
Use root array.
Karl Klose
2011/01/04 12:32:18
Done.
| |
| 1246 __ jmp(&done); | |
| 1247 __ bind(&true_value); | |
| 1248 __ mov(result, Operand(Handle<Object>(Heap::true_value()))); | |
|
Søren Thygesen Gjesse
2011/01/04 11:23:34
Use root array.
Karl Klose
2011/01/04 12:32:18
Done.
| |
| 1249 __ bind(&done); | |
| 1250 } | |
| 1175 } | 1251 } |
| 1176 | 1252 |
| 1177 | 1253 |
| 1178 void LCodeGen::DoIsNullAndBranch(LIsNullAndBranch* instr) { | 1254 void LCodeGen::DoIsNullAndBranch(LIsNullAndBranch* instr) { |
| 1179 Register reg = ToRegister(instr->input()); | 1255 Register reg = ToRegister(instr->input()); |
| 1180 | 1256 |
| 1181 // TODO(fsc): If the expression is known to be a smi, then it's | 1257 // TODO(fsc): If the expression is known to be a smi, then it's |
| 1182 // definitely not null. Jump to the false block. | 1258 // definitely not null. Jump to the false block. |
| 1183 | 1259 |
| 1184 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1260 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1320 Abort("DoClassOfTest unimplemented."); | 1396 Abort("DoClassOfTest unimplemented."); |
| 1321 } | 1397 } |
| 1322 | 1398 |
| 1323 | 1399 |
| 1324 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { | 1400 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { |
| 1325 Abort("DoClassOfTestAndBranch unimplemented."); | 1401 Abort("DoClassOfTestAndBranch unimplemented."); |
| 1326 } | 1402 } |
| 1327 | 1403 |
| 1328 | 1404 |
| 1329 void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { | 1405 void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { |
| 1330 Abort("DoCmpMapAndBranch unimplemented."); | 1406 Register reg = ToRegister(instr->input()); |
| 1407 Register temp = ToRegister(instr->temp()); | |
| 1408 int true_block = instr->true_block_id(); | |
| 1409 int false_block = instr->false_block_id(); | |
| 1410 | |
| 1411 __ ldr(temp, FieldMemOperand(reg, HeapObject::kMapOffset)); | |
| 1412 __ cmp(temp, Operand(instr->map())); | |
| 1413 EmitBranch(true_block, false_block, eq); | |
| 1331 } | 1414 } |
| 1332 | 1415 |
| 1333 | 1416 |
| 1334 void LCodeGen::DoInstanceOf(LInstanceOf* instr) { | 1417 void LCodeGen::DoInstanceOf(LInstanceOf* instr) { |
| 1335 ASSERT(ToRegister(instr->left()).is(r0)); // Object is in r0. | 1418 ASSERT(ToRegister(instr->left()).is(r0)); // Object is in r0. |
| 1336 ASSERT(ToRegister(instr->right()).is(r1)); // Function is in r1. | 1419 ASSERT(ToRegister(instr->right()).is(r1)); // Function is in r1. |
| 1337 | 1420 |
| 1338 InstanceofStub stub(InstanceofStub::kArgsInRegisters); | 1421 InstanceofStub stub(InstanceofStub::kArgsInRegisters); |
| 1339 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 1422 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 1340 | 1423 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1422 | 1505 |
| 1423 | 1506 |
| 1424 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { | 1507 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { |
| 1425 Register value = ToRegister(instr->input()); | 1508 Register value = ToRegister(instr->input()); |
| 1426 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell()))); | 1509 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell()))); |
| 1427 __ str(value, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); | 1510 __ str(value, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); |
| 1428 } | 1511 } |
| 1429 | 1512 |
| 1430 | 1513 |
| 1431 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 1514 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| 1432 Abort("DoLoadNamedField unimplemented."); | 1515 Register object = ToRegister(instr->input()); |
| 1516 Register result = ToRegister(instr->result()); | |
| 1517 if (instr->hydrogen()->is_in_object()) { | |
| 1518 __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset())); | |
| 1519 } else { | |
| 1520 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | |
| 1521 __ ldr(result, FieldMemOperand(result, instr->hydrogen()->offset())); | |
| 1522 } | |
| 1433 } | 1523 } |
| 1434 | 1524 |
| 1435 | 1525 |
| 1436 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 1526 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 1437 ASSERT(ToRegister(instr->object()).is(r0)); | 1527 ASSERT(ToRegister(instr->object()).is(r0)); |
| 1438 ASSERT(ToRegister(instr->result()).is(r0)); | 1528 ASSERT(ToRegister(instr->result()).is(r0)); |
| 1439 | 1529 |
| 1440 // Name is always in r2. | 1530 // Name is always in r2. |
| 1441 __ mov(r2, Operand(instr->name())); | 1531 __ mov(r2, Operand(instr->name())); |
| 1442 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); | 1532 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1578 | 1668 |
| 1579 // Setup deoptimization. | 1669 // Setup deoptimization. |
| 1580 RegisterLazyDeoptimization(instr); | 1670 RegisterLazyDeoptimization(instr); |
| 1581 | 1671 |
| 1582 // Restore context. | 1672 // Restore context. |
| 1583 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 1673 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 1584 } | 1674 } |
| 1585 | 1675 |
| 1586 | 1676 |
| 1587 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { | 1677 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { |
| 1588 Abort("DoCallConstantFunction unimplemented."); | 1678 ASSERT(ToRegister(instr->result()).is(r0)); |
| 1679 __ mov(r1, Operand(instr->function())); | |
| 1680 CallKnownFunction(instr->function(), instr->arity(), instr); | |
| 1589 } | 1681 } |
| 1590 | 1682 |
| 1591 | 1683 |
| 1592 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { | 1684 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { |
| 1593 Abort("DoDeferredMathAbsTaggedHeapNumber unimplemented."); | 1685 Abort("DoDeferredMathAbsTaggedHeapNumber unimplemented."); |
| 1594 } | 1686 } |
| 1595 | 1687 |
| 1596 | 1688 |
| 1597 void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { | 1689 void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { |
| 1598 Abort("DoMathAbs unimplemented."); | 1690 Abort("DoMathAbs unimplemented."); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1638 int arity = instr->arity(); | 1730 int arity = instr->arity(); |
| 1639 Handle<Code> ic = StubCache::ComputeCallInitialize(arity, NOT_IN_LOOP); | 1731 Handle<Code> ic = StubCache::ComputeCallInitialize(arity, NOT_IN_LOOP); |
| 1640 __ mov(r2, Operand(instr->name())); | 1732 __ mov(r2, Operand(instr->name())); |
| 1641 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 1733 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 1642 // Restore context register. | 1734 // Restore context register. |
| 1643 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 1735 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 1644 } | 1736 } |
| 1645 | 1737 |
| 1646 | 1738 |
| 1647 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 1739 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
| 1648 Abort("DoCallFunction unimplemented."); | 1740 ASSERT(ToRegister(instr->result()).is(r0)); |
| 1741 | |
| 1742 int arity = instr->arity(); | |
| 1743 CallFunctionStub stub(arity, NOT_IN_LOOP, RECEIVER_MIGHT_BE_VALUE); | |
| 1744 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
| 1745 __ Drop(1); | |
| 1746 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
| 1649 } | 1747 } |
| 1650 | 1748 |
| 1651 | 1749 |
| 1652 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { | 1750 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { |
| 1653 Abort("DoCallGlobal unimplemented."); | 1751 Abort("DoCallGlobal unimplemented."); |
| 1654 } | 1752 } |
| 1655 | 1753 |
| 1656 | 1754 |
| 1657 void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) { | 1755 void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) { |
| 1658 ASSERT(ToRegister(instr->result()).is(r0)); | 1756 ASSERT(ToRegister(instr->result()).is(r0)); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 1686 ASSERT(ToRegister(instr->value()).is(r0)); | 1784 ASSERT(ToRegister(instr->value()).is(r0)); |
| 1687 | 1785 |
| 1688 // Name is always in r2. | 1786 // Name is always in r2. |
| 1689 __ mov(r2, Operand(instr->name())); | 1787 __ mov(r2, Operand(instr->name())); |
| 1690 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); | 1788 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); |
| 1691 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 1789 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 1692 } | 1790 } |
| 1693 | 1791 |
| 1694 | 1792 |
| 1695 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 1793 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| 1696 Abort("DoBoundsCheck unimplemented."); | 1794 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); |
|
Søren Thygesen Gjesse
2011/01/04 11:23:34
To much indention.
Karl Klose
2011/01/04 12:32:18
Done.
| |
| 1795 DeoptimizeIf(hs, instr->environment()); | |
| 1697 } | 1796 } |
| 1698 | 1797 |
| 1699 | 1798 |
| 1700 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { | 1799 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { |
| 1701 Abort("DoStoreKeyedFastElement unimplemented."); | 1800 Abort("DoStoreKeyedFastElement unimplemented."); |
| 1702 } | 1801 } |
| 1703 | 1802 |
| 1704 | 1803 |
| 1705 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 1804 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
| 1706 ASSERT(ToRegister(instr->object()).is(r2)); | 1805 ASSERT(ToRegister(instr->object()).is(r2)); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2030 ASSERT(input->IsRegister()); | 2129 ASSERT(input->IsRegister()); |
| 2031 Register reg = ToRegister(input); | 2130 Register reg = ToRegister(input); |
| 2032 __ ldr(r9, FieldMemOperand(reg, HeapObject::kMapOffset)); | 2131 __ ldr(r9, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 2033 __ cmp(r9, Operand(instr->hydrogen()->map())); | 2132 __ cmp(r9, Operand(instr->hydrogen()->map())); |
| 2034 DeoptimizeIf(ne, instr->environment()); | 2133 DeoptimizeIf(ne, instr->environment()); |
| 2035 } | 2134 } |
| 2036 | 2135 |
| 2037 | 2136 |
| 2038 void LCodeGen::LoadPrototype(Register result, | 2137 void LCodeGen::LoadPrototype(Register result, |
| 2039 Handle<JSObject> prototype) { | 2138 Handle<JSObject> prototype) { |
| 2040 Abort("LoadPrototype unimplemented."); | 2139 if (Heap::InNewSpace(*prototype)) { |
| 2140 Handle<JSGlobalPropertyCell> cell = | |
| 2141 Factory::NewJSGlobalPropertyCell(prototype); | |
| 2142 __ mov(result, Operand(cell)); | |
| 2143 } else { | |
| 2144 __ mov(result, Operand(prototype)); | |
| 2145 } | |
| 2041 } | 2146 } |
| 2042 | 2147 |
| 2043 | 2148 |
| 2044 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 2149 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
|
Søren Thygesen Gjesse
2011/01/04 11:23:34
reg -> temp1, temp -> temp2?
Karl Klose
2011/01/04 12:32:18
Done.
| |
| 2045 Abort("DoCheckPrototypeMaps unimplemented."); | 2150 Register reg = ToRegister(instr->temp1()); |
| 2151 Register temp = ToRegister(instr->temp2()); | |
| 2152 | |
| 2153 Handle<JSObject> holder = instr->holder(); | |
| 2154 Handle<Map> receiver_map = instr->receiver_map(); | |
| 2155 Handle<JSObject> current_prototype(JSObject::cast(receiver_map->prototype())); | |
| 2156 | |
| 2157 // Load prototype object. | |
| 2158 LoadPrototype(reg, current_prototype); | |
| 2159 | |
| 2160 // Check prototype maps up to the holder. | |
| 2161 while (!current_prototype.is_identical_to(holder)) { | |
| 2162 __ ldr(temp, FieldMemOperand(reg, HeapObject::kMapOffset)); | |
| 2163 __ cmp(temp, Operand(Handle<Map>(current_prototype->map()))); | |
| 2164 DeoptimizeIf(ne, instr->environment()); | |
| 2165 current_prototype = | |
| 2166 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); | |
| 2167 // Load next prototype object. | |
| 2168 LoadPrototype(reg, current_prototype); | |
| 2169 } | |
| 2170 | |
| 2171 // Check the holder map. | |
| 2172 __ ldr(temp, FieldMemOperand(reg, HeapObject::kMapOffset)); | |
| 2173 __ cmp(temp, Operand(Handle<Map>(current_prototype->map()))); | |
| 2174 DeoptimizeIf(ne, instr->environment()); | |
| 2046 } | 2175 } |
| 2047 | 2176 |
| 2048 | 2177 |
| 2049 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { | 2178 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { |
| 2050 Abort("DoArrayLiteral unimplemented."); | 2179 Abort("DoArrayLiteral unimplemented."); |
| 2051 } | 2180 } |
| 2052 | 2181 |
| 2053 | 2182 |
| 2054 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { | 2183 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { |
| 2055 Abort("DoObjectLiteral unimplemented."); | 2184 Abort("DoObjectLiteral unimplemented."); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2204 | 2333 |
| 2205 | 2334 |
| 2206 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2335 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
| 2207 Abort("DoOsrEntry unimplemented."); | 2336 Abort("DoOsrEntry unimplemented."); |
| 2208 } | 2337 } |
| 2209 | 2338 |
| 2210 | 2339 |
| 2211 #undef __ | 2340 #undef __ |
| 2212 | 2341 |
| 2213 } } // namespace v8::internal | 2342 } } // namespace v8::internal |
| OLD | NEW |