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

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

Issue 2649703002: [Atomics] Make Atomics.compareExchange a builtin using TF (Closed)
Patch Set: rebase and move cmpxchg to builtins-sharedarraybuffer-gen.cc Created 3 years, 9 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 100 MachineType AtomicExchangeRepresentationOf(Operator const* op);
101 101
102 MachineType AtomicCompareExchangeRepresentationOf(Operator const* op);
103
102 // Interface for building machine-level operators. These operators are 104 // Interface for building machine-level operators. These operators are
103 // machine-level but machine-independent and thus define a language suitable 105 // machine-level but machine-independent and thus define a language suitable
104 // for generating code to run on architectures such as ia32, x64, arm, etc. 106 // for generating code to run on architectures such as ia32, x64, arm, etc.
105 class V8_EXPORT_PRIVATE MachineOperatorBuilder final 107 class V8_EXPORT_PRIVATE MachineOperatorBuilder final
106 : public NON_EXPORTED_BASE(ZoneObject) { 108 : public NON_EXPORTED_BASE(ZoneObject) {
107 public: 109 public:
108 // Flags that specify which operations are available. This is useful 110 // Flags that specify which operations are available. This is useful
109 // for operations that are unsupported by some back-ends. 111 // for operations that are unsupported by some back-ends.
110 enum Flag : unsigned { 112 enum Flag : unsigned {
111 kNoFlags = 0u, 113 kNoFlags = 0u,
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 const Operator* CheckedLoad(CheckedLoadRepresentation); 606 const Operator* CheckedLoad(CheckedLoadRepresentation);
605 // checked-store heap, index, length, value 607 // checked-store heap, index, length, value
606 const Operator* CheckedStore(CheckedStoreRepresentation); 608 const Operator* CheckedStore(CheckedStoreRepresentation);
607 609
608 // atomic-load [base + index] 610 // atomic-load [base + index]
609 const Operator* AtomicLoad(LoadRepresentation rep); 611 const Operator* AtomicLoad(LoadRepresentation rep);
610 // atomic-store [base + index], value 612 // atomic-store [base + index], value
611 const Operator* AtomicStore(MachineRepresentation rep); 613 const Operator* AtomicStore(MachineRepresentation rep);
612 // atomic-exchange [base + index], value 614 // atomic-exchange [base + index], value
613 const Operator* AtomicExchange(MachineType rep); 615 const Operator* AtomicExchange(MachineType rep);
616 // atomic-compare-exchange [base + index], old_value, new_value
617 const Operator* AtomicCompareExchange(MachineType rep);
614 618
615 // Target machine word-size assumed by this builder. 619 // Target machine word-size assumed by this builder.
616 bool Is32() const { return word() == MachineRepresentation::kWord32; } 620 bool Is32() const { return word() == MachineRepresentation::kWord32; }
617 bool Is64() const { return word() == MachineRepresentation::kWord64; } 621 bool Is64() const { return word() == MachineRepresentation::kWord64; }
618 MachineRepresentation word() const { return word_; } 622 MachineRepresentation word() const { return word_; }
619 623
620 bool UnalignedLoadSupported(const MachineType& machineType, 624 bool UnalignedLoadSupported(const MachineType& machineType,
621 uint8_t alignment) { 625 uint8_t alignment) {
622 return alignment_requirements_.IsUnalignedLoadSupported(machineType, 626 return alignment_requirements_.IsUnalignedLoadSupported(machineType,
623 alignment); 627 alignment);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 }; 674 };
671 675
672 676
673 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) 677 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags)
674 678
675 } // namespace compiler 679 } // namespace compiler
676 } // namespace internal 680 } // namespace internal
677 } // namespace v8 681 } // namespace v8
678 682
679 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ 683 #endif // V8_COMPILER_MACHINE_OPERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698