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

Side by Side Diff: src/crankshaft/arm64/lithium-arm64.h

Issue 1493983004: [crankshaft] Loads and stores to typed arrays have to reference the backing store holder (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years 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/crankshaft/arm/lithium-arm.cc ('k') | src/crankshaft/arm64/lithium-arm64.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 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 #ifndef V8_CRANKSHAFT_ARM64_LITHIUM_ARM64_H_ 5 #ifndef V8_CRANKSHAFT_ARM64_LITHIUM_ARM64_H_
6 #define V8_CRANKSHAFT_ARM64_LITHIUM_ARM64_H_ 6 #define V8_CRANKSHAFT_ARM64_LITHIUM_ARM64_H_
7 7
8 #include "src/crankshaft/hydrogen.h" 8 #include "src/crankshaft/hydrogen.h"
9 #include "src/crankshaft/lithium.h" 9 #include "src/crankshaft/lithium.h"
10 #include "src/crankshaft/lithium-allocator.h" 10 #include "src/crankshaft/lithium-allocator.h"
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 LOperand* temp_vector() { return temps_[0]; } 1672 LOperand* temp_vector() { return temps_[0]; }
1673 1673
1674 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic") 1674 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1675 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric) 1675 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
1676 1676
1677 Handle<Object> name() const { return hydrogen()->name(); } 1677 Handle<Object> name() const { return hydrogen()->name(); }
1678 TypeofMode typeof_mode() const { return hydrogen()->typeof_mode(); } 1678 TypeofMode typeof_mode() const { return hydrogen()->typeof_mode(); }
1679 }; 1679 };
1680 1680
1681 1681
1682 template<int T> 1682 template <int T>
1683 class LLoadKeyed : public LTemplateInstruction<1, 2, T> { 1683 class LLoadKeyed : public LTemplateInstruction<1, 3, T> {
1684 public: 1684 public:
1685 LLoadKeyed(LOperand* elements, LOperand* key) { 1685 LLoadKeyed(LOperand* elements, LOperand* key, LOperand* backing_store_owner) {
1686 this->inputs_[0] = elements; 1686 this->inputs_[0] = elements;
1687 this->inputs_[1] = key; 1687 this->inputs_[1] = key;
1688 this->inputs_[2] = backing_store_owner;
1688 } 1689 }
1689 1690
1690 LOperand* elements() { return this->inputs_[0]; } 1691 LOperand* elements() { return this->inputs_[0]; }
1691 LOperand* key() { return this->inputs_[1]; } 1692 LOperand* key() { return this->inputs_[1]; }
1693 LOperand* backing_store_owner() { return this->inputs_[2]; }
1692 ElementsKind elements_kind() const { 1694 ElementsKind elements_kind() const {
1693 return this->hydrogen()->elements_kind(); 1695 return this->hydrogen()->elements_kind();
1694 } 1696 }
1695 bool is_external() const { 1697 bool is_external() const {
1696 return this->hydrogen()->is_external(); 1698 return this->hydrogen()->is_external();
1697 } 1699 }
1698 bool is_fixed_typed_array() const { 1700 bool is_fixed_typed_array() const {
1699 return hydrogen()->is_fixed_typed_array(); 1701 return hydrogen()->is_fixed_typed_array();
1700 } 1702 }
1701 bool is_typed_elements() const { 1703 bool is_typed_elements() const {
(...skipping 12 matching lines...) Expand all
1714 stream->Add("]"); 1716 stream->Add("]");
1715 } 1717 }
1716 } 1718 }
1717 1719
1718 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) 1720 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
1719 }; 1721 };
1720 1722
1721 1723
1722 class LLoadKeyedExternal: public LLoadKeyed<1> { 1724 class LLoadKeyedExternal: public LLoadKeyed<1> {
1723 public: 1725 public:
1724 LLoadKeyedExternal(LOperand* elements, LOperand* key, LOperand* temp) : 1726 LLoadKeyedExternal(LOperand* elements, LOperand* key,
1725 LLoadKeyed<1>(elements, key) { 1727 LOperand* backing_store_owner, LOperand* temp)
1728 : LLoadKeyed<1>(elements, key, backing_store_owner) {
1726 temps_[0] = temp; 1729 temps_[0] = temp;
1727 } 1730 }
1728 1731
1729 LOperand* temp() { return temps_[0]; } 1732 LOperand* temp() { return temps_[0]; }
1730 1733
1731 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedExternal, "load-keyed-external"); 1734 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedExternal, "load-keyed-external");
1732 }; 1735 };
1733 1736
1734 1737
1735 class LLoadKeyedFixed: public LLoadKeyed<1> { 1738 class LLoadKeyedFixed: public LLoadKeyed<1> {
1736 public: 1739 public:
1737 LLoadKeyedFixed(LOperand* elements, LOperand* key, LOperand* temp) : 1740 LLoadKeyedFixed(LOperand* elements, LOperand* key, LOperand* temp)
1738 LLoadKeyed<1>(elements, key) { 1741 : LLoadKeyed<1>(elements, key, nullptr) {
1739 temps_[0] = temp; 1742 temps_[0] = temp;
1740 } 1743 }
1741 1744
1742 LOperand* temp() { return temps_[0]; } 1745 LOperand* temp() { return temps_[0]; }
1743 1746
1744 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixed, "load-keyed-fixed"); 1747 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixed, "load-keyed-fixed");
1745 }; 1748 };
1746 1749
1747 1750
1748 class LLoadKeyedFixedDouble: public LLoadKeyed<1> { 1751 class LLoadKeyedFixedDouble: public LLoadKeyed<1> {
1749 public: 1752 public:
1750 LLoadKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* temp) : 1753 LLoadKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* temp)
1751 LLoadKeyed<1>(elements, key) { 1754 : LLoadKeyed<1>(elements, key, nullptr) {
1752 temps_[0] = temp; 1755 temps_[0] = temp;
1753 } 1756 }
1754 1757
1755 LOperand* temp() { return temps_[0]; } 1758 LOperand* temp() { return temps_[0]; }
1756 1759
1757 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixedDouble, "load-keyed-fixed-double"); 1760 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixedDouble, "load-keyed-fixed-double");
1758 }; 1761 };
1759 1762
1760 1763
1761 class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> { 1764 class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> {
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
2362 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") 2365 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2363 DECLARE_HYDROGEN_ACCESSOR(StackCheck) 2366 DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2364 2367
2365 Label* done_label() { return &done_label_; } 2368 Label* done_label() { return &done_label_; }
2366 2369
2367 private: 2370 private:
2368 Label done_label_; 2371 Label done_label_;
2369 }; 2372 };
2370 2373
2371 2374
2372 template<int T> 2375 template <int T>
2373 class LStoreKeyed : public LTemplateInstruction<0, 3, T> { 2376 class LStoreKeyed : public LTemplateInstruction<0, 4, T> {
2374 public: 2377 public:
2375 LStoreKeyed(LOperand* elements, LOperand* key, LOperand* value) { 2378 LStoreKeyed(LOperand* elements, LOperand* key, LOperand* value,
2379 LOperand* backing_store_owner) {
2376 this->inputs_[0] = elements; 2380 this->inputs_[0] = elements;
2377 this->inputs_[1] = key; 2381 this->inputs_[1] = key;
2378 this->inputs_[2] = value; 2382 this->inputs_[2] = value;
2383 this->inputs_[3] = backing_store_owner;
2379 } 2384 }
2380 2385
2381 bool is_external() const { return this->hydrogen()->is_external(); } 2386 bool is_external() const { return this->hydrogen()->is_external(); }
2382 bool is_fixed_typed_array() const { 2387 bool is_fixed_typed_array() const {
2383 return hydrogen()->is_fixed_typed_array(); 2388 return hydrogen()->is_fixed_typed_array();
2384 } 2389 }
2385 bool is_typed_elements() const { 2390 bool is_typed_elements() const {
2386 return is_external() || is_fixed_typed_array(); 2391 return is_external() || is_fixed_typed_array();
2387 } 2392 }
2388 LOperand* elements() { return this->inputs_[0]; } 2393 LOperand* elements() { return this->inputs_[0]; }
2389 LOperand* key() { return this->inputs_[1]; } 2394 LOperand* key() { return this->inputs_[1]; }
2390 LOperand* value() { return this->inputs_[2]; } 2395 LOperand* value() { return this->inputs_[2]; }
2396 LOperand* backing_store_owner() { return this->inputs_[3]; }
2391 ElementsKind elements_kind() const { 2397 ElementsKind elements_kind() const {
2392 return this->hydrogen()->elements_kind(); 2398 return this->hydrogen()->elements_kind();
2393 } 2399 }
2394 2400
2395 bool NeedsCanonicalization() { 2401 bool NeedsCanonicalization() {
2396 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() || 2402 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() ||
2397 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) { 2403 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) {
2398 return false; 2404 return false;
2399 } 2405 }
2400 return this->hydrogen()->NeedsCanonicalization(); 2406 return this->hydrogen()->NeedsCanonicalization();
(...skipping 19 matching lines...) Expand all
2420 } 2426 }
2421 } 2427 }
2422 2428
2423 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) 2429 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
2424 }; 2430 };
2425 2431
2426 2432
2427 class LStoreKeyedExternal final : public LStoreKeyed<1> { 2433 class LStoreKeyedExternal final : public LStoreKeyed<1> {
2428 public: 2434 public:
2429 LStoreKeyedExternal(LOperand* elements, LOperand* key, LOperand* value, 2435 LStoreKeyedExternal(LOperand* elements, LOperand* key, LOperand* value,
2430 LOperand* temp) : 2436 LOperand* backing_store_owner, LOperand* temp)
2431 LStoreKeyed<1>(elements, key, value) { 2437 : LStoreKeyed<1>(elements, key, value, backing_store_owner) {
2432 temps_[0] = temp; 2438 temps_[0] = temp;
2433 } 2439 }
2434 2440
2435 LOperand* temp() { return temps_[0]; } 2441 LOperand* temp() { return temps_[0]; }
2436 2442
2437 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedExternal, "store-keyed-external") 2443 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedExternal, "store-keyed-external")
2438 }; 2444 };
2439 2445
2440 2446
2441 class LStoreKeyedFixed final : public LStoreKeyed<1> { 2447 class LStoreKeyedFixed final : public LStoreKeyed<1> {
2442 public: 2448 public:
2443 LStoreKeyedFixed(LOperand* elements, LOperand* key, LOperand* value, 2449 LStoreKeyedFixed(LOperand* elements, LOperand* key, LOperand* value,
2444 LOperand* temp) : 2450 LOperand* temp)
2445 LStoreKeyed<1>(elements, key, value) { 2451 : LStoreKeyed<1>(elements, key, value, nullptr) {
2446 temps_[0] = temp; 2452 temps_[0] = temp;
2447 } 2453 }
2448 2454
2449 LOperand* temp() { return temps_[0]; } 2455 LOperand* temp() { return temps_[0]; }
2450 2456
2451 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixed, "store-keyed-fixed") 2457 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixed, "store-keyed-fixed")
2452 }; 2458 };
2453 2459
2454 2460
2455 class LStoreKeyedFixedDouble final : public LStoreKeyed<1> { 2461 class LStoreKeyedFixedDouble final : public LStoreKeyed<1> {
2456 public: 2462 public:
2457 LStoreKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* value, 2463 LStoreKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* value,
2458 LOperand* temp) : 2464 LOperand* temp)
2459 LStoreKeyed<1>(elements, key, value) { 2465 : LStoreKeyed<1>(elements, key, value, nullptr) {
2460 temps_[0] = temp; 2466 temps_[0] = temp;
2461 } 2467 }
2462 2468
2463 LOperand* temp() { return temps_[0]; } 2469 LOperand* temp() { return temps_[0]; }
2464 2470
2465 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixedDouble, 2471 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixedDouble,
2466 "store-keyed-fixed-double") 2472 "store-keyed-fixed-double")
2467 }; 2473 };
2468 2474
2469 2475
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
3163 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 3169 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
3164 }; 3170 };
3165 3171
3166 #undef DECLARE_HYDROGEN_ACCESSOR 3172 #undef DECLARE_HYDROGEN_ACCESSOR
3167 #undef DECLARE_CONCRETE_INSTRUCTION 3173 #undef DECLARE_CONCRETE_INSTRUCTION
3168 3174
3169 } // namespace internal 3175 } // namespace internal
3170 } // namespace v8 3176 } // namespace v8
3171 3177
3172 #endif // V8_CRANKSHAFT_ARM64_LITHIUM_ARM64_H_ 3178 #endif // V8_CRANKSHAFT_ARM64_LITHIUM_ARM64_H_
OLDNEW
« no previous file with comments | « src/crankshaft/arm/lithium-arm.cc ('k') | src/crankshaft/arm64/lithium-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698