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

Side by Side Diff: src/compiler/machine-operator.h

Issue 2623633003: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: [Atomics] Make Atomics.exchange a builtin using TF Created 3 years, 11 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
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_COMPILER_MACHINE_OPERATOR_H_ 5 #ifndef V8_COMPILER_MACHINE_OPERATOR_H_
6 #define V8_COMPILER_MACHINE_OPERATOR_H_ 6 #define V8_COMPILER_MACHINE_OPERATOR_H_
7 7
8 #include "src/base/compiler-specific.h" 8 #include "src/base/compiler-specific.h"
9 #include "src/base/flags.h" 9 #include "src/base/flags.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 // A CheckedStore needs a MachineType. 91 // A CheckedStore needs a MachineType.
92 typedef MachineRepresentation CheckedStoreRepresentation; 92 typedef MachineRepresentation CheckedStoreRepresentation;
93 93
94 CheckedStoreRepresentation CheckedStoreRepresentationOf(Operator const*); 94 CheckedStoreRepresentation CheckedStoreRepresentationOf(Operator const*);
95 95
96 int StackSlotSizeOf(Operator const* op); 96 int StackSlotSizeOf(Operator const* op);
97 97
98 MachineRepresentation AtomicStoreRepresentationOf(Operator const* op); 98 MachineRepresentation AtomicStoreRepresentationOf(Operator const* op);
99 99
100 MachineType AtomicExchangeRepresentationOf(Operator const* op);
101
100 // Interface for building machine-level operators. These operators are 102 // Interface for building machine-level operators. These operators are
101 // machine-level but machine-independent and thus define a language suitable 103 // machine-level but machine-independent and thus define a language suitable
102 // for generating code to run on architectures such as ia32, x64, arm, etc. 104 // for generating code to run on architectures such as ia32, x64, arm, etc.
103 class V8_EXPORT_PRIVATE MachineOperatorBuilder final 105 class V8_EXPORT_PRIVATE MachineOperatorBuilder final
104 : public NON_EXPORTED_BASE(ZoneObject) { 106 : public NON_EXPORTED_BASE(ZoneObject) {
105 public: 107 public:
106 // Flags that specify which operations are available. This is useful 108 // Flags that specify which operations are available. This is useful
107 // for operations that are unsupported by some back-ends. 109 // for operations that are unsupported by some back-ends.
108 enum Flag : unsigned { 110 enum Flag : unsigned {
109 kNoFlags = 0u, 111 kNoFlags = 0u,
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 631
630 // checked-load heap, index, length 632 // checked-load heap, index, length
631 const Operator* CheckedLoad(CheckedLoadRepresentation); 633 const Operator* CheckedLoad(CheckedLoadRepresentation);
632 // checked-store heap, index, length, value 634 // checked-store heap, index, length, value
633 const Operator* CheckedStore(CheckedStoreRepresentation); 635 const Operator* CheckedStore(CheckedStoreRepresentation);
634 636
635 // atomic-load [base + index] 637 // atomic-load [base + index]
636 const Operator* AtomicLoad(LoadRepresentation rep); 638 const Operator* AtomicLoad(LoadRepresentation rep);
637 // atomic-store [base + index], value 639 // atomic-store [base + index], value
638 const Operator* AtomicStore(MachineRepresentation rep); 640 const Operator* AtomicStore(MachineRepresentation rep);
641 // atomic-exchange [base + index], value
642 const Operator* AtomicExchange(MachineType rep);
639 643
640 // Target machine word-size assumed by this builder. 644 // Target machine word-size assumed by this builder.
641 bool Is32() const { return word() == MachineRepresentation::kWord32; } 645 bool Is32() const { return word() == MachineRepresentation::kWord32; }
642 bool Is64() const { return word() == MachineRepresentation::kWord64; } 646 bool Is64() const { return word() == MachineRepresentation::kWord64; }
643 MachineRepresentation word() const { return word_; } 647 MachineRepresentation word() const { return word_; }
644 648
645 bool UnalignedLoadSupported(const MachineType& machineType, 649 bool UnalignedLoadSupported(const MachineType& machineType,
646 uint8_t alignment) { 650 uint8_t alignment) {
647 return alignment_requirements_.IsUnalignedLoadSupported(machineType, 651 return alignment_requirements_.IsUnalignedLoadSupported(machineType,
648 alignment); 652 alignment);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 }; 699 };
696 700
697 701
698 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) 702 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags)
699 703
700 } // namespace compiler 704 } // namespace compiler
701 } // namespace internal 705 } // namespace internal
702 } // namespace v8 706 } // namespace v8
703 707
704 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ 708 #endif // V8_COMPILER_MACHINE_OPERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698