OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "lithium-allocator-inl.h" | 7 #include "lithium-allocator-inl.h" |
8 #include "arm64/lithium-arm64.h" | 8 #include "arm64/lithium-arm64.h" |
9 #include "arm64/lithium-codegen-arm64.h" | 9 #include "arm64/lithium-codegen-arm64.h" |
10 #include "hydrogen-osr.h" | 10 #include "hydrogen-osr.h" |
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 LLoadGlobalGeneric* result = | 1638 LLoadGlobalGeneric* result = |
1639 new(zone()) LLoadGlobalGeneric(context, global_object); | 1639 new(zone()) LLoadGlobalGeneric(context, global_object); |
1640 return MarkAsCall(DefineFixed(result, x0), instr); | 1640 return MarkAsCall(DefineFixed(result, x0), instr); |
1641 } | 1641 } |
1642 | 1642 |
1643 | 1643 |
1644 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { | 1644 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |
1645 ASSERT(instr->key()->representation().IsSmiOrInteger32()); | 1645 ASSERT(instr->key()->representation().IsSmiOrInteger32()); |
1646 ElementsKind elements_kind = instr->elements_kind(); | 1646 ElementsKind elements_kind = instr->elements_kind(); |
1647 LOperand* elements = UseRegister(instr->elements()); | 1647 LOperand* elements = UseRegister(instr->elements()); |
| 1648 LOperand* key = UseRegisterOrConstant(instr->key()); |
1648 | 1649 |
1649 if (!instr->is_typed_elements()) { | 1650 if (!instr->is_typed_elements()) { |
1650 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | |
1651 | |
1652 if (instr->representation().IsDouble()) { | 1651 if (instr->representation().IsDouble()) { |
1653 LOperand* temp = (!instr->key()->IsConstant() || | 1652 LOperand* temp = (!instr->key()->IsConstant() || |
1654 instr->RequiresHoleCheck()) | 1653 instr->RequiresHoleCheck()) |
1655 ? TempRegister() | 1654 ? TempRegister() |
1656 : NULL; | 1655 : NULL; |
1657 | 1656 |
1658 LLoadKeyedFixedDouble* result = | 1657 LLoadKeyedFixedDouble* result = |
1659 new(zone()) LLoadKeyedFixedDouble(elements, key, temp); | 1658 new(zone()) LLoadKeyedFixedDouble(elements, key, temp); |
1660 return instr->RequiresHoleCheck() | 1659 return instr->RequiresHoleCheck() |
1661 ? AssignEnvironment(DefineAsRegister(result)) | 1660 ? AssignEnvironment(DefineAsRegister(result)) |
1662 : DefineAsRegister(result); | 1661 : DefineAsRegister(result); |
1663 } else { | 1662 } else { |
1664 ASSERT(instr->representation().IsSmiOrTagged() || | 1663 ASSERT(instr->representation().IsSmiOrTagged() || |
1665 instr->representation().IsInteger32()); | 1664 instr->representation().IsInteger32()); |
1666 LOperand* temp = instr->key()->IsConstant() ? NULL : TempRegister(); | 1665 LOperand* temp = instr->key()->IsConstant() ? NULL : TempRegister(); |
1667 LLoadKeyedFixed* result = | 1666 LLoadKeyedFixed* result = |
1668 new(zone()) LLoadKeyedFixed(elements, key, temp); | 1667 new(zone()) LLoadKeyedFixed(elements, key, temp); |
1669 return instr->RequiresHoleCheck() | 1668 return instr->RequiresHoleCheck() |
1670 ? AssignEnvironment(DefineAsRegister(result)) | 1669 ? AssignEnvironment(DefineAsRegister(result)) |
1671 : DefineAsRegister(result); | 1670 : DefineAsRegister(result); |
1672 } | 1671 } |
1673 } else { | 1672 } else { |
1674 ASSERT((instr->representation().IsInteger32() && | 1673 ASSERT((instr->representation().IsInteger32() && |
1675 !IsDoubleOrFloatElementsKind(instr->elements_kind())) || | 1674 !IsDoubleOrFloatElementsKind(instr->elements_kind())) || |
1676 (instr->representation().IsDouble() && | 1675 (instr->representation().IsDouble() && |
1677 IsDoubleOrFloatElementsKind(instr->elements_kind()))); | 1676 IsDoubleOrFloatElementsKind(instr->elements_kind()))); |
1678 | 1677 |
1679 LOperand* key = UseRegisterOrConstant(instr->key()); | |
1680 LOperand* temp = instr->key()->IsConstant() ? NULL : TempRegister(); | 1678 LOperand* temp = instr->key()->IsConstant() ? NULL : TempRegister(); |
1681 LInstruction* result = DefineAsRegister( | 1679 LInstruction* result = DefineAsRegister( |
1682 new(zone()) LLoadKeyedExternal(elements, key, temp)); | 1680 new(zone()) LLoadKeyedExternal(elements, key, temp)); |
1683 if ((elements_kind == EXTERNAL_UINT32_ELEMENTS || | 1681 if ((elements_kind == EXTERNAL_UINT32_ELEMENTS || |
1684 elements_kind == UINT32_ELEMENTS) && | 1682 elements_kind == UINT32_ELEMENTS) && |
1685 !instr->CheckFlag(HInstruction::kUint32)) { | 1683 !instr->CheckFlag(HInstruction::kUint32)) { |
1686 result = AssignEnvironment(result); | 1684 result = AssignEnvironment(result); |
1687 } | 1685 } |
1688 return result; | 1686 return result; |
1689 } | 1687 } |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2159 return AssignEnvironment(new(zone()) LStoreGlobalCell(value, | 2157 return AssignEnvironment(new(zone()) LStoreGlobalCell(value, |
2160 TempRegister(), | 2158 TempRegister(), |
2161 TempRegister())); | 2159 TempRegister())); |
2162 } else { | 2160 } else { |
2163 return new(zone()) LStoreGlobalCell(value, TempRegister(), NULL); | 2161 return new(zone()) LStoreGlobalCell(value, TempRegister(), NULL); |
2164 } | 2162 } |
2165 } | 2163 } |
2166 | 2164 |
2167 | 2165 |
2168 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 2166 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
| 2167 LOperand* key = UseRegisterOrConstant(instr->key()); |
2169 LOperand* temp = NULL; | 2168 LOperand* temp = NULL; |
2170 LOperand* elements = NULL; | 2169 LOperand* elements = NULL; |
2171 LOperand* val = NULL; | 2170 LOperand* val = NULL; |
2172 | 2171 |
2173 if (!instr->is_typed_elements() && | 2172 if (!instr->is_typed_elements() && |
2174 instr->value()->representation().IsTagged() && | 2173 instr->value()->representation().IsTagged() && |
2175 instr->NeedsWriteBarrier()) { | 2174 instr->NeedsWriteBarrier()) { |
2176 // RecordWrite() will clobber all registers. | 2175 // RecordWrite() will clobber all registers. |
2177 elements = UseRegisterAndClobber(instr->elements()); | 2176 elements = UseRegisterAndClobber(instr->elements()); |
2178 val = UseRegisterAndClobber(instr->value()); | 2177 val = UseRegisterAndClobber(instr->value()); |
2179 temp = TempRegister(); | 2178 temp = TempRegister(); |
2180 } else { | 2179 } else { |
2181 elements = UseRegister(instr->elements()); | 2180 elements = UseRegister(instr->elements()); |
2182 val = UseRegister(instr->value()); | 2181 val = UseRegister(instr->value()); |
2183 temp = instr->key()->IsConstant() ? NULL : TempRegister(); | 2182 temp = instr->key()->IsConstant() ? NULL : TempRegister(); |
2184 } | 2183 } |
2185 | 2184 |
2186 if (instr->is_typed_elements()) { | 2185 if (instr->is_typed_elements()) { |
2187 ASSERT((instr->value()->representation().IsInteger32() && | 2186 ASSERT((instr->value()->representation().IsInteger32() && |
2188 !IsDoubleOrFloatElementsKind(instr->elements_kind())) || | 2187 !IsDoubleOrFloatElementsKind(instr->elements_kind())) || |
2189 (instr->value()->representation().IsDouble() && | 2188 (instr->value()->representation().IsDouble() && |
2190 IsDoubleOrFloatElementsKind(instr->elements_kind()))); | 2189 IsDoubleOrFloatElementsKind(instr->elements_kind()))); |
2191 ASSERT((instr->is_fixed_typed_array() && | 2190 ASSERT((instr->is_fixed_typed_array() && |
2192 instr->elements()->representation().IsTagged()) || | 2191 instr->elements()->representation().IsTagged()) || |
2193 (instr->is_external() && | 2192 (instr->is_external() && |
2194 instr->elements()->representation().IsExternal())); | 2193 instr->elements()->representation().IsExternal())); |
2195 LOperand* key = UseRegisterOrConstant(instr->key()); | |
2196 return new(zone()) LStoreKeyedExternal(elements, key, val, temp); | 2194 return new(zone()) LStoreKeyedExternal(elements, key, val, temp); |
2197 | 2195 |
2198 } else if (instr->value()->representation().IsDouble()) { | 2196 } else if (instr->value()->representation().IsDouble()) { |
2199 ASSERT(instr->elements()->representation().IsTagged()); | 2197 ASSERT(instr->elements()->representation().IsTagged()); |
2200 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | |
2201 return new(zone()) LStoreKeyedFixedDouble(elements, key, val, temp); | 2198 return new(zone()) LStoreKeyedFixedDouble(elements, key, val, temp); |
2202 | 2199 |
2203 } else { | 2200 } else { |
2204 ASSERT(instr->elements()->representation().IsTagged()); | 2201 ASSERT(instr->elements()->representation().IsTagged()); |
2205 ASSERT(instr->value()->representation().IsSmiOrTagged() || | 2202 ASSERT(instr->value()->representation().IsSmiOrTagged() || |
2206 instr->value()->representation().IsInteger32()); | 2203 instr->value()->representation().IsInteger32()); |
2207 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | |
2208 return new(zone()) LStoreKeyedFixed(elements, key, val, temp); | 2204 return new(zone()) LStoreKeyedFixed(elements, key, val, temp); |
2209 } | 2205 } |
2210 } | 2206 } |
2211 | 2207 |
2212 | 2208 |
2213 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 2209 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
2214 LOperand* context = UseFixed(instr->context(), cp); | 2210 LOperand* context = UseFixed(instr->context(), cp); |
2215 LOperand* object = UseFixed(instr->object(), x2); | 2211 LOperand* object = UseFixed(instr->object(), x2); |
2216 LOperand* key = UseFixed(instr->key(), x1); | 2212 LOperand* key = UseFixed(instr->key(), x1); |
2217 LOperand* value = UseFixed(instr->value(), x0); | 2213 LOperand* value = UseFixed(instr->value(), x0); |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 | 2554 |
2559 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 2555 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
2560 LOperand* receiver = UseRegister(instr->receiver()); | 2556 LOperand* receiver = UseRegister(instr->receiver()); |
2561 LOperand* function = UseRegister(instr->function()); | 2557 LOperand* function = UseRegister(instr->function()); |
2562 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); | 2558 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); |
2563 return AssignEnvironment(DefineAsRegister(result)); | 2559 return AssignEnvironment(DefineAsRegister(result)); |
2564 } | 2560 } |
2565 | 2561 |
2566 | 2562 |
2567 } } // namespace v8::internal | 2563 } } // namespace v8::internal |
OLD | NEW |