| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 } | 232 } |
| 233 | 233 |
| 234 | 234 |
| 235 void LIsSmiAndBranch::PrintDataTo(StringStream* stream) { | 235 void LIsSmiAndBranch::PrintDataTo(StringStream* stream) { |
| 236 stream->Add("if is_smi("); | 236 stream->Add("if is_smi("); |
| 237 InputAt(0)->PrintTo(stream); | 237 InputAt(0)->PrintTo(stream); |
| 238 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 238 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
| 239 } | 239 } |
| 240 | 240 |
| 241 | 241 |
| 242 void LIsUndetectableAndBranch::PrintDataTo(StringStream* stream) { |
| 243 stream->Add("if is_undetectable("); |
| 244 InputAt(0)->PrintTo(stream); |
| 245 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
| 246 } |
| 247 |
| 248 |
| 242 void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) { | 249 void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) { |
| 243 stream->Add("if has_instance_type("); | 250 stream->Add("if has_instance_type("); |
| 244 InputAt(0)->PrintTo(stream); | 251 InputAt(0)->PrintTo(stream); |
| 245 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 252 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
| 246 } | 253 } |
| 247 | 254 |
| 248 | 255 |
| 249 void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) { | 256 void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) { |
| 250 stream->Add("if has_cached_array_index("); | 257 stream->Add("if has_cached_array_index("); |
| 251 InputAt(0)->PrintTo(stream); | 258 InputAt(0)->PrintTo(stream); |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 ASSERT(ast_id != AstNode::kNoNumber); | 1010 ASSERT(ast_id != AstNode::kNoNumber); |
| 1004 int value_count = hydrogen_env->length(); | 1011 int value_count = hydrogen_env->length(); |
| 1005 LEnvironment* result = new LEnvironment(hydrogen_env->closure(), | 1012 LEnvironment* result = new LEnvironment(hydrogen_env->closure(), |
| 1006 ast_id, | 1013 ast_id, |
| 1007 hydrogen_env->parameter_count(), | 1014 hydrogen_env->parameter_count(), |
| 1008 argument_count_, | 1015 argument_count_, |
| 1009 value_count, | 1016 value_count, |
| 1010 outer); | 1017 outer); |
| 1011 int argument_index = 0; | 1018 int argument_index = 0; |
| 1012 for (int i = 0; i < value_count; ++i) { | 1019 for (int i = 0; i < value_count; ++i) { |
| 1020 if (hydrogen_env->is_special_index(i)) continue; |
| 1021 |
| 1013 HValue* value = hydrogen_env->values()->at(i); | 1022 HValue* value = hydrogen_env->values()->at(i); |
| 1014 LOperand* op = NULL; | 1023 LOperand* op = NULL; |
| 1015 if (value->IsArgumentsObject()) { | 1024 if (value->IsArgumentsObject()) { |
| 1016 op = NULL; | 1025 op = NULL; |
| 1017 } else if (value->IsPushArgument()) { | 1026 } else if (value->IsPushArgument()) { |
| 1018 op = new LArgument(argument_index++); | 1027 op = new LArgument(argument_index++); |
| 1019 } else { | 1028 } else { |
| 1020 op = UseAny(value); | 1029 op = UseAny(value); |
| 1021 } | 1030 } |
| 1022 result->AddValue(op, value->representation()); | 1031 result->AddValue(op, value->representation()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 LOperand* right_operand = UseFixed(right, reversed ? rdx : rax); | 1079 LOperand* right_operand = UseFixed(right, reversed ? rdx : rax); |
| 1071 LCmpTAndBranch* result = new LCmpTAndBranch(left_operand, | 1080 LCmpTAndBranch* result = new LCmpTAndBranch(left_operand, |
| 1072 right_operand); | 1081 right_operand); |
| 1073 return MarkAsCall(result, instr); | 1082 return MarkAsCall(result, instr); |
| 1074 } | 1083 } |
| 1075 } else if (v->IsIsSmi()) { | 1084 } else if (v->IsIsSmi()) { |
| 1076 HIsSmi* compare = HIsSmi::cast(v); | 1085 HIsSmi* compare = HIsSmi::cast(v); |
| 1077 ASSERT(compare->value()->representation().IsTagged()); | 1086 ASSERT(compare->value()->representation().IsTagged()); |
| 1078 | 1087 |
| 1079 return new LIsSmiAndBranch(Use(compare->value())); | 1088 return new LIsSmiAndBranch(Use(compare->value())); |
| 1089 } else if (v->IsIsUndetectable()) { |
| 1090 HIsUndetectable* compare = HIsUndetectable::cast(v); |
| 1091 ASSERT(compare->value()->representation().IsTagged()); |
| 1092 |
| 1093 return new LIsUndetectableAndBranch(UseRegisterAtStart(compare->value()), |
| 1094 TempRegister()); |
| 1080 } else if (v->IsHasInstanceType()) { | 1095 } else if (v->IsHasInstanceType()) { |
| 1081 HHasInstanceType* compare = HHasInstanceType::cast(v); | 1096 HHasInstanceType* compare = HHasInstanceType::cast(v); |
| 1082 ASSERT(compare->value()->representation().IsTagged()); | 1097 ASSERT(compare->value()->representation().IsTagged()); |
| 1083 | 1098 |
| 1084 return new LHasInstanceTypeAndBranch( | 1099 return new LHasInstanceTypeAndBranch( |
| 1085 UseRegisterAtStart(compare->value())); | 1100 UseRegisterAtStart(compare->value())); |
| 1086 } else if (v->IsHasCachedArrayIndex()) { | 1101 } else if (v->IsHasCachedArrayIndex()) { |
| 1087 HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v); | 1102 HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v); |
| 1088 ASSERT(compare->value()->representation().IsTagged()); | 1103 ASSERT(compare->value()->representation().IsTagged()); |
| 1089 | 1104 |
| 1090 return new LHasCachedArrayIndexAndBranch( | 1105 return new LHasCachedArrayIndexAndBranch( |
| 1091 UseRegisterAtStart(compare->value())); | 1106 UseRegisterAtStart(compare->value())); |
| 1092 } else if (v->IsIsNull()) { | 1107 } else if (v->IsIsNull()) { |
| 1093 HIsNull* compare = HIsNull::cast(v); | 1108 HIsNull* compare = HIsNull::cast(v); |
| 1094 ASSERT(compare->value()->representation().IsTagged()); | 1109 ASSERT(compare->value()->representation().IsTagged()); |
| 1095 | 1110 |
| 1096 // We only need a temp register for non-strict compare. | 1111 // We only need a temp register for non-strict compare. |
| 1097 LOperand* temp = compare->is_strict() ? NULL : TempRegister(); | 1112 LOperand* temp = compare->is_strict() ? NULL : TempRegister(); |
| 1098 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()), | 1113 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()), |
| 1099 temp); | 1114 temp); |
| 1100 } else if (v->IsIsObject()) { | 1115 } else if (v->IsIsObject()) { |
| 1101 HIsObject* compare = HIsObject::cast(v); | 1116 HIsObject* compare = HIsObject::cast(v); |
| 1102 ASSERT(compare->value()->representation().IsTagged()); | 1117 ASSERT(compare->value()->representation().IsTagged()); |
| 1103 return new LIsObjectAndBranch(UseRegisterAtStart(compare->value())); | 1118 return new LIsObjectAndBranch(UseRegisterAtStart(compare->value())); |
| 1104 } else if (v->IsCompareJSObjectEq()) { | 1119 } else if (v->IsCompareJSObjectEq()) { |
| 1105 HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v); | 1120 HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v); |
| 1106 return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()), | 1121 return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()), |
| 1107 UseRegisterAtStart(compare->right())); | 1122 UseRegisterAtStart(compare->right())); |
| 1123 } else if (v->IsCompareSymbolEq()) { |
| 1124 HCompareSymbolEq* compare = HCompareSymbolEq::cast(v); |
| 1125 return new LCmpSymbolEqAndBranch(UseRegisterAtStart(compare->left()), |
| 1126 UseRegisterAtStart(compare->right())); |
| 1108 } else if (v->IsInstanceOf()) { | 1127 } else if (v->IsInstanceOf()) { |
| 1109 HInstanceOf* instance_of = HInstanceOf::cast(v); | 1128 HInstanceOf* instance_of = HInstanceOf::cast(v); |
| 1110 LInstanceOfAndBranch* result = | 1129 LInstanceOfAndBranch* result = |
| 1111 new LInstanceOfAndBranch(UseFixed(instance_of->left(), rax), | 1130 new LInstanceOfAndBranch(UseFixed(instance_of->left(), rax), |
| 1112 UseFixed(instance_of->right(), rdx)); | 1131 UseFixed(instance_of->right(), rdx)); |
| 1113 return MarkAsCall(result, instr); | 1132 return MarkAsCall(result, instr); |
| 1114 } else if (v->IsTypeofIs()) { | 1133 } else if (v->IsTypeofIs()) { |
| 1115 HTypeofIs* typeof_is = HTypeofIs::cast(v); | 1134 HTypeofIs* typeof_is = HTypeofIs::cast(v); |
| 1116 return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value())); | 1135 return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value())); |
| 1117 } else if (v->IsIsConstructCall()) { | 1136 } else if (v->IsIsConstructCall()) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 | 1199 |
| 1181 | 1200 |
| 1182 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) { | 1201 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) { |
| 1183 ++argument_count_; | 1202 ++argument_count_; |
| 1184 LOperand* argument = UseOrConstant(instr->argument()); | 1203 LOperand* argument = UseOrConstant(instr->argument()); |
| 1185 return new LPushArgument(argument); | 1204 return new LPushArgument(argument); |
| 1186 } | 1205 } |
| 1187 | 1206 |
| 1188 | 1207 |
| 1189 LInstruction* LChunkBuilder::DoContext(HContext* instr) { | 1208 LInstruction* LChunkBuilder::DoContext(HContext* instr) { |
| 1190 return DefineAsRegister(new LContext); | 1209 return instr->HasNoUses() ? NULL : DefineAsRegister(new LContext); |
| 1191 } | 1210 } |
| 1192 | 1211 |
| 1193 | 1212 |
| 1194 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { | 1213 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { |
| 1195 LOperand* context = UseRegisterAtStart(instr->value()); | 1214 LOperand* context = UseRegisterAtStart(instr->value()); |
| 1196 return DefineAsRegister(new LOuterContext(context)); | 1215 return DefineAsRegister(new LOuterContext(context)); |
| 1197 } | 1216 } |
| 1198 | 1217 |
| 1199 | 1218 |
| 1200 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) { | 1219 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) { |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1505 | 1524 |
| 1506 LInstruction* LChunkBuilder::DoCompareJSObjectEq( | 1525 LInstruction* LChunkBuilder::DoCompareJSObjectEq( |
| 1507 HCompareJSObjectEq* instr) { | 1526 HCompareJSObjectEq* instr) { |
| 1508 LOperand* left = UseRegisterAtStart(instr->left()); | 1527 LOperand* left = UseRegisterAtStart(instr->left()); |
| 1509 LOperand* right = UseRegisterAtStart(instr->right()); | 1528 LOperand* right = UseRegisterAtStart(instr->right()); |
| 1510 LCmpJSObjectEq* result = new LCmpJSObjectEq(left, right); | 1529 LCmpJSObjectEq* result = new LCmpJSObjectEq(left, right); |
| 1511 return DefineAsRegister(result); | 1530 return DefineAsRegister(result); |
| 1512 } | 1531 } |
| 1513 | 1532 |
| 1514 | 1533 |
| 1534 LInstruction* LChunkBuilder::DoCompareSymbolEq( |
| 1535 HCompareSymbolEq* instr) { |
| 1536 LOperand* left = UseRegisterAtStart(instr->left()); |
| 1537 LOperand* right = UseRegisterAtStart(instr->right()); |
| 1538 LCmpSymbolEq* result = new LCmpSymbolEq(left, right); |
| 1539 return DefineAsRegister(result); |
| 1540 } |
| 1541 |
| 1542 |
| 1515 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) { | 1543 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) { |
| 1516 ASSERT(instr->value()->representation().IsTagged()); | 1544 ASSERT(instr->value()->representation().IsTagged()); |
| 1517 LOperand* value = UseRegisterAtStart(instr->value()); | 1545 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1518 | 1546 |
| 1519 return DefineAsRegister(new LIsNull(value)); | 1547 return DefineAsRegister(new LIsNull(value)); |
| 1520 } | 1548 } |
| 1521 | 1549 |
| 1522 | 1550 |
| 1523 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) { | 1551 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) { |
| 1524 ASSERT(instr->value()->representation().IsTagged()); | 1552 ASSERT(instr->value()->representation().IsTagged()); |
| 1525 LOperand* value = UseRegister(instr->value()); | 1553 LOperand* value = UseRegister(instr->value()); |
| 1526 | 1554 |
| 1527 return DefineAsRegister(new LIsObject(value)); | 1555 return DefineAsRegister(new LIsObject(value)); |
| 1528 } | 1556 } |
| 1529 | 1557 |
| 1530 | 1558 |
| 1531 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) { | 1559 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) { |
| 1532 ASSERT(instr->value()->representation().IsTagged()); | 1560 ASSERT(instr->value()->representation().IsTagged()); |
| 1533 LOperand* value = UseAtStart(instr->value()); | 1561 LOperand* value = UseAtStart(instr->value()); |
| 1534 | 1562 |
| 1535 return DefineAsRegister(new LIsSmi(value)); | 1563 return DefineAsRegister(new LIsSmi(value)); |
| 1536 } | 1564 } |
| 1537 | 1565 |
| 1538 | 1566 |
| 1567 LInstruction* LChunkBuilder::DoIsUndetectable(HIsUndetectable* instr) { |
| 1568 ASSERT(instr->value()->representation().IsTagged()); |
| 1569 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1570 |
| 1571 return DefineAsRegister(new LIsUndetectable(value)); |
| 1572 } |
| 1573 |
| 1574 |
| 1539 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) { | 1575 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) { |
| 1540 ASSERT(instr->value()->representation().IsTagged()); | 1576 ASSERT(instr->value()->representation().IsTagged()); |
| 1541 LOperand* value = UseRegisterAtStart(instr->value()); | 1577 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1542 | 1578 |
| 1543 return DefineAsRegister(new LHasInstanceType(value)); | 1579 return DefineAsRegister(new LHasInstanceType(value)); |
| 1544 } | 1580 } |
| 1545 | 1581 |
| 1546 | 1582 |
| 1547 LInstruction* LChunkBuilder::DoGetCachedArrayIndex( | 1583 LInstruction* LChunkBuilder::DoGetCachedArrayIndex( |
| 1548 HGetCachedArrayIndex* instr) { | 1584 HGetCachedArrayIndex* instr) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1605 return NULL; | 1641 return NULL; |
| 1606 } | 1642 } |
| 1607 | 1643 |
| 1608 | 1644 |
| 1609 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { | 1645 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { |
| 1610 LOperand* value = UseFixed(instr->value(), rax); | 1646 LOperand* value = UseFixed(instr->value(), rax); |
| 1611 return MarkAsCall(new LThrow(value), instr); | 1647 return MarkAsCall(new LThrow(value), instr); |
| 1612 } | 1648 } |
| 1613 | 1649 |
| 1614 | 1650 |
| 1651 LInstruction* LChunkBuilder::DoForceRepresentation(HForceRepresentation* bad) { |
| 1652 // All HForceRepresentation instructions should be eliminated in the |
| 1653 // representation change phase of Hydrogen. |
| 1654 UNREACHABLE(); |
| 1655 return NULL; |
| 1656 } |
| 1657 |
| 1658 |
| 1615 LInstruction* LChunkBuilder::DoChange(HChange* instr) { | 1659 LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
| 1616 Representation from = instr->from(); | 1660 Representation from = instr->from(); |
| 1617 Representation to = instr->to(); | 1661 Representation to = instr->to(); |
| 1618 if (from.IsTagged()) { | 1662 if (from.IsTagged()) { |
| 1619 if (to.IsDouble()) { | 1663 if (to.IsDouble()) { |
| 1620 LOperand* value = UseRegister(instr->value()); | 1664 LOperand* value = UseRegister(instr->value()); |
| 1621 LNumberUntagD* res = new LNumberUntagD(value); | 1665 LNumberUntagD* res = new LNumberUntagD(value); |
| 1622 return AssignEnvironment(DefineAsRegister(res)); | 1666 return AssignEnvironment(DefineAsRegister(res)); |
| 1623 } else { | 1667 } else { |
| 1624 ASSERT(to.IsInteger32()); | 1668 ASSERT(to.IsInteger32()); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1699 } | 1743 } |
| 1700 | 1744 |
| 1701 | 1745 |
| 1702 LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) { | 1746 LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) { |
| 1703 LOperand* value = UseRegisterAtStart(instr->value()); | 1747 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1704 LCheckMap* result = new LCheckMap(value); | 1748 LCheckMap* result = new LCheckMap(value); |
| 1705 return AssignEnvironment(result); | 1749 return AssignEnvironment(result); |
| 1706 } | 1750 } |
| 1707 | 1751 |
| 1708 | 1752 |
| 1753 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { |
| 1754 HValue* value = instr->value(); |
| 1755 Representation input_rep = value->representation(); |
| 1756 LOperand* reg = UseRegister(value); |
| 1757 if (input_rep.IsDouble()) { |
| 1758 return DefineAsRegister(new LClampDToUint8(reg, |
| 1759 TempRegister())); |
| 1760 } else if (input_rep.IsInteger32()) { |
| 1761 return DefineSameAsFirst(new LClampIToUint8(reg)); |
| 1762 } else { |
| 1763 ASSERT(input_rep.IsTagged()); |
| 1764 // Register allocator doesn't (yet) support allocation of double |
| 1765 // temps. Reserve xmm1 explicitly. |
| 1766 LClampTToUint8* result = new LClampTToUint8(reg, |
| 1767 TempRegister(), |
| 1768 FixedTemp(xmm1)); |
| 1769 return AssignEnvironment(DefineSameAsFirst(result)); |
| 1770 } |
| 1771 } |
| 1772 |
| 1773 |
| 1709 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { | 1774 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { |
| 1710 return new LReturn(UseFixed(instr->value(), rax)); | 1775 return new LReturn(UseFixed(instr->value(), rax)); |
| 1711 } | 1776 } |
| 1712 | 1777 |
| 1713 | 1778 |
| 1714 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 1779 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
| 1715 Representation r = instr->representation(); | 1780 Representation r = instr->representation(); |
| 1716 if (r.IsInteger32()) { | 1781 if (r.IsInteger32()) { |
| 1717 return DefineAsRegister(new LConstantI); | 1782 return DefineAsRegister(new LConstantI); |
| 1718 } else if (r.IsDouble()) { | 1783 } else if (r.IsDouble()) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1844 HLoadKeyedSpecializedArrayElement* instr) { | 1909 HLoadKeyedSpecializedArrayElement* instr) { |
| 1845 ExternalArrayType array_type = instr->array_type(); | 1910 ExternalArrayType array_type = instr->array_type(); |
| 1846 Representation representation(instr->representation()); | 1911 Representation representation(instr->representation()); |
| 1847 ASSERT( | 1912 ASSERT( |
| 1848 (representation.IsInteger32() && (array_type != kExternalFloatArray && | 1913 (representation.IsInteger32() && (array_type != kExternalFloatArray && |
| 1849 array_type != kExternalDoubleArray)) || | 1914 array_type != kExternalDoubleArray)) || |
| 1850 (representation.IsDouble() && (array_type == kExternalFloatArray || | 1915 (representation.IsDouble() && (array_type == kExternalFloatArray || |
| 1851 array_type == kExternalDoubleArray))); | 1916 array_type == kExternalDoubleArray))); |
| 1852 ASSERT(instr->key()->representation().IsInteger32()); | 1917 ASSERT(instr->key()->representation().IsInteger32()); |
| 1853 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1918 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
| 1854 LOperand* key = UseRegister(instr->key()); | 1919 LOperand* key = UseRegisterOrConstant(instr->key()); |
| 1855 LLoadKeyedSpecializedArrayElement* result = | 1920 LLoadKeyedSpecializedArrayElement* result = |
| 1856 new LLoadKeyedSpecializedArrayElement(external_pointer, key); | 1921 new LLoadKeyedSpecializedArrayElement(external_pointer, key); |
| 1857 LInstruction* load_instr = DefineAsRegister(result); | 1922 LInstruction* load_instr = DefineAsRegister(result); |
| 1858 // An unsigned int array load might overflow and cause a deopt, make sure it | 1923 // An unsigned int array load might overflow and cause a deopt, make sure it |
| 1859 // has an environment. | 1924 // has an environment. |
| 1860 return (array_type == kExternalUnsignedIntArray) ? | 1925 return (array_type == kExternalUnsignedIntArray) ? |
| 1861 AssignEnvironment(load_instr) : load_instr; | 1926 AssignEnvironment(load_instr) : load_instr; |
| 1862 } | 1927 } |
| 1863 | 1928 |
| 1864 | 1929 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 array_type == kExternalDoubleArray))); | 1966 array_type == kExternalDoubleArray))); |
| 1902 ASSERT(instr->external_pointer()->representation().IsExternal()); | 1967 ASSERT(instr->external_pointer()->representation().IsExternal()); |
| 1903 ASSERT(instr->key()->representation().IsInteger32()); | 1968 ASSERT(instr->key()->representation().IsInteger32()); |
| 1904 | 1969 |
| 1905 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 1970 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
| 1906 bool val_is_temp_register = array_type == kExternalPixelArray || | 1971 bool val_is_temp_register = array_type == kExternalPixelArray || |
| 1907 array_type == kExternalFloatArray; | 1972 array_type == kExternalFloatArray; |
| 1908 LOperand* val = val_is_temp_register | 1973 LOperand* val = val_is_temp_register |
| 1909 ? UseTempRegister(instr->value()) | 1974 ? UseTempRegister(instr->value()) |
| 1910 : UseRegister(instr->value()); | 1975 : UseRegister(instr->value()); |
| 1911 LOperand* key = UseRegister(instr->key()); | 1976 LOperand* key = UseRegisterOrConstant(instr->key()); |
| 1912 | 1977 |
| 1913 return new LStoreKeyedSpecializedArrayElement(external_pointer, | 1978 return new LStoreKeyedSpecializedArrayElement(external_pointer, |
| 1914 key, | 1979 key, |
| 1915 val); | 1980 val); |
| 1916 } | 1981 } |
| 1917 | 1982 |
| 1918 | 1983 |
| 1919 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 1984 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
| 1920 LOperand* object = UseFixed(instr->object(), rdx); | 1985 LOperand* object = UseFixed(instr->object(), rdx); |
| 1921 LOperand* key = UseFixed(instr->key(), rcx); | 1986 LOperand* key = UseFixed(instr->key(), rcx); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2141 LOperand* key = UseOrConstantAtStart(instr->key()); | 2206 LOperand* key = UseOrConstantAtStart(instr->key()); |
| 2142 LOperand* object = UseOrConstantAtStart(instr->object()); | 2207 LOperand* object = UseOrConstantAtStart(instr->object()); |
| 2143 LIn* result = new LIn(key, object); | 2208 LIn* result = new LIn(key, object); |
| 2144 return MarkAsCall(DefineFixed(result, rax), instr); | 2209 return MarkAsCall(DefineFixed(result, rax), instr); |
| 2145 } | 2210 } |
| 2146 | 2211 |
| 2147 | 2212 |
| 2148 } } // namespace v8::internal | 2213 } } // namespace v8::internal |
| 2149 | 2214 |
| 2150 #endif // V8_TARGET_ARCH_X64 | 2215 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |