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

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

Issue 2649703002: [Atomics] Make Atomics.compareExchange a builtin using TF (Closed)
Patch Set: dmb 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 const Operator* CheckedLoad(CheckedLoadRepresentation); 618 const Operator* CheckedLoad(CheckedLoadRepresentation);
617 // checked-store heap, index, length, value 619 // checked-store heap, index, length, value
618 const Operator* CheckedStore(CheckedStoreRepresentation); 620 const Operator* CheckedStore(CheckedStoreRepresentation);
619 621
620 // atomic-load [base + index] 622 // atomic-load [base + index]
621 const Operator* AtomicLoad(LoadRepresentation rep); 623 const Operator* AtomicLoad(LoadRepresentation rep);
622 // atomic-store [base + index], value 624 // atomic-store [base + index], value
623 const Operator* AtomicStore(MachineRepresentation rep); 625 const Operator* AtomicStore(MachineRepresentation rep);
624 // atomic-exchange [base + index], value 626 // atomic-exchange [base + index], value
625 const Operator* AtomicExchange(MachineType rep); 627 const Operator* AtomicExchange(MachineType rep);
628 // atomic-compare-exchange [base + index], old_value, new_value
629 const Operator* AtomicCompareExchange(MachineType rep);
626 630
627 // Target machine word-size assumed by this builder. 631 // Target machine word-size assumed by this builder.
628 bool Is32() const { return word() == MachineRepresentation::kWord32; } 632 bool Is32() const { return word() == MachineRepresentation::kWord32; }
629 bool Is64() const { return word() == MachineRepresentation::kWord64; } 633 bool Is64() const { return word() == MachineRepresentation::kWord64; }
630 MachineRepresentation word() const { return word_; } 634 MachineRepresentation word() const { return word_; }
631 635
632 bool UnalignedLoadSupported(const MachineType& machineType, 636 bool UnalignedLoadSupported(const MachineType& machineType,
633 uint8_t alignment) { 637 uint8_t alignment) {
634 return alignment_requirements_.IsUnalignedLoadSupported(machineType, 638 return alignment_requirements_.IsUnalignedLoadSupported(machineType,
635 alignment); 639 alignment);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 }; 686 };
683 687
684 688
685 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) 689 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags)
686 690
687 } // namespace compiler 691 } // namespace compiler
688 } // namespace internal 692 } // namespace internal
689 } // namespace v8 693 } // namespace v8
690 694
691 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ 695 #endif // V8_COMPILER_MACHINE_OPERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698