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

Side by Side Diff: src/ia32/lithium-ia32.h

Issue 1257223002: Revert of Remove ExternalArray, derived types, and element kinds (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_IA32_LITHIUM_IA32_H_ 5 #ifndef V8_IA32_LITHIUM_IA32_H_
6 #define V8_IA32_LITHIUM_IA32_H_ 6 #define V8_IA32_LITHIUM_IA32_H_
7 7
8 #include "src/hydrogen.h" 8 #include "src/hydrogen.h"
9 #include "src/lithium.h" 9 #include "src/lithium.h"
10 #include "src/lithium-allocator.h" 10 #include "src/lithium-allocator.h"
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 public: 1634 public:
1635 LLoadKeyed(LOperand* elements, LOperand* key) { 1635 LLoadKeyed(LOperand* elements, LOperand* key) {
1636 inputs_[0] = elements; 1636 inputs_[0] = elements;
1637 inputs_[1] = key; 1637 inputs_[1] = key;
1638 } 1638 }
1639 LOperand* elements() { return inputs_[0]; } 1639 LOperand* elements() { return inputs_[0]; }
1640 LOperand* key() { return inputs_[1]; } 1640 LOperand* key() { return inputs_[1]; }
1641 ElementsKind elements_kind() const { 1641 ElementsKind elements_kind() const {
1642 return hydrogen()->elements_kind(); 1642 return hydrogen()->elements_kind();
1643 } 1643 }
1644 bool is_external() const {
1645 return hydrogen()->is_external();
1646 }
1644 bool is_fixed_typed_array() const { 1647 bool is_fixed_typed_array() const {
1645 return hydrogen()->is_fixed_typed_array(); 1648 return hydrogen()->is_fixed_typed_array();
1646 } 1649 }
1650 bool is_typed_elements() const {
1651 return is_external() || is_fixed_typed_array();
1652 }
1647 1653
1648 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") 1654 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
1649 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) 1655 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
1650 1656
1651 void PrintDataTo(StringStream* stream) override; 1657 void PrintDataTo(StringStream* stream) override;
1652 uint32_t base_offset() const { return hydrogen()->base_offset(); } 1658 uint32_t base_offset() const { return hydrogen()->base_offset(); }
1653 bool key_is_smi() { 1659 bool key_is_smi() {
1654 return hydrogen()->key()->representation().IsTagged(); 1660 return hydrogen()->key()->representation().IsTagged();
1655 } 1661 }
1656 }; 1662 };
1657 1663
1658 1664
1659 inline static bool ExternalArrayOpRequiresTemp( 1665 inline static bool ExternalArrayOpRequiresTemp(
1660 Representation key_representation, 1666 Representation key_representation,
1661 ElementsKind elements_kind) { 1667 ElementsKind elements_kind) {
1662 // Operations that require the key to be divided by two to be converted into 1668 // Operations that require the key to be divided by two to be converted into
1663 // an index cannot fold the scale operation into a load and need an extra 1669 // an index cannot fold the scale operation into a load and need an extra
1664 // temp register to do the work. 1670 // temp register to do the work.
1665 return key_representation.IsSmi() && 1671 return key_representation.IsSmi() &&
1666 (elements_kind == UINT8_ELEMENTS || elements_kind == INT8_ELEMENTS || 1672 (elements_kind == EXTERNAL_INT8_ELEMENTS ||
1667 elements_kind == UINT8_CLAMPED_ELEMENTS); 1673 elements_kind == EXTERNAL_UINT8_ELEMENTS ||
1674 elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS ||
1675 elements_kind == UINT8_ELEMENTS ||
1676 elements_kind == INT8_ELEMENTS ||
1677 elements_kind == UINT8_CLAMPED_ELEMENTS);
1668 } 1678 }
1669 1679
1670 1680
1671 class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> { 1681 class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> {
1672 public: 1682 public:
1673 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key, 1683 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key,
1674 LOperand* vector) { 1684 LOperand* vector) {
1675 inputs_[0] = context; 1685 inputs_[0] = context;
1676 inputs_[1] = obj; 1686 inputs_[1] = obj;
1677 inputs_[2] = key; 1687 inputs_[2] = key;
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
2242 2252
2243 2253
2244 class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> { 2254 class LStoreKeyed final : public LTemplateInstruction<0, 3, 0> {
2245 public: 2255 public:
2246 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { 2256 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) {
2247 inputs_[0] = obj; 2257 inputs_[0] = obj;
2248 inputs_[1] = key; 2258 inputs_[1] = key;
2249 inputs_[2] = val; 2259 inputs_[2] = val;
2250 } 2260 }
2251 2261
2262 bool is_external() const { return hydrogen()->is_external(); }
2252 bool is_fixed_typed_array() const { 2263 bool is_fixed_typed_array() const {
2253 return hydrogen()->is_fixed_typed_array(); 2264 return hydrogen()->is_fixed_typed_array();
2254 } 2265 }
2266 bool is_typed_elements() const {
2267 return is_external() || is_fixed_typed_array();
2268 }
2255 LOperand* elements() { return inputs_[0]; } 2269 LOperand* elements() { return inputs_[0]; }
2256 LOperand* key() { return inputs_[1]; } 2270 LOperand* key() { return inputs_[1]; }
2257 LOperand* value() { return inputs_[2]; } 2271 LOperand* value() { return inputs_[2]; }
2258 ElementsKind elements_kind() const { 2272 ElementsKind elements_kind() const {
2259 return hydrogen()->elements_kind(); 2273 return hydrogen()->elements_kind();
2260 } 2274 }
2261 2275
2262 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") 2276 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed")
2263 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) 2277 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
2264 2278
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
2918 2932
2919 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2933 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2920 }; 2934 };
2921 2935
2922 #undef DECLARE_HYDROGEN_ACCESSOR 2936 #undef DECLARE_HYDROGEN_ACCESSOR
2923 #undef DECLARE_CONCRETE_INSTRUCTION 2937 #undef DECLARE_CONCRETE_INSTRUCTION
2924 2938
2925 } } // namespace v8::internal 2939 } } // namespace v8::internal
2926 2940
2927 #endif // V8_IA32_LITHIUM_IA32_H_ 2941 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698