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

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

Issue 2649703002: [Atomics] Make Atomics.compareExchange a builtin using TF (Closed)
Patch Set: use TF_BUILTIN macro 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 const Operator* CheckedLoad(CheckedLoadRepresentation); 605 const Operator* CheckedLoad(CheckedLoadRepresentation);
604 // checked-store heap, index, length, value 606 // checked-store heap, index, length, value
605 const Operator* CheckedStore(CheckedStoreRepresentation); 607 const Operator* CheckedStore(CheckedStoreRepresentation);
606 608
607 // atomic-load [base + index] 609 // atomic-load [base + index]
608 const Operator* AtomicLoad(LoadRepresentation rep); 610 const Operator* AtomicLoad(LoadRepresentation rep);
609 // atomic-store [base + index], value 611 // atomic-store [base + index], value
610 const Operator* AtomicStore(MachineRepresentation rep); 612 const Operator* AtomicStore(MachineRepresentation rep);
611 // atomic-exchange [base + index], value 613 // atomic-exchange [base + index], value
612 const Operator* AtomicExchange(MachineType rep); 614 const Operator* AtomicExchange(MachineType rep);
615 // atomic-compare-exchange [base + index], old_value, new_value
616 const Operator* AtomicCompareExchange(MachineType rep);
613 617
614 // Target machine word-size assumed by this builder. 618 // Target machine word-size assumed by this builder.
615 bool Is32() const { return word() == MachineRepresentation::kWord32; } 619 bool Is32() const { return word() == MachineRepresentation::kWord32; }
616 bool Is64() const { return word() == MachineRepresentation::kWord64; } 620 bool Is64() const { return word() == MachineRepresentation::kWord64; }
617 MachineRepresentation word() const { return word_; } 621 MachineRepresentation word() const { return word_; }
618 622
619 bool UnalignedLoadSupported(const MachineType& machineType, 623 bool UnalignedLoadSupported(const MachineType& machineType,
620 uint8_t alignment) { 624 uint8_t alignment) {
621 return alignment_requirements_.IsUnalignedLoadSupported(machineType, 625 return alignment_requirements_.IsUnalignedLoadSupported(machineType,
622 alignment); 626 alignment);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 }; 673 };
670 674
671 675
672 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) 676 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags)
673 677
674 } // namespace compiler 678 } // namespace compiler
675 } // namespace internal 679 } // namespace internal
676 } // namespace v8 680 } // namespace v8
677 681
678 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ 682 #endif // V8_COMPILER_MACHINE_OPERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698