| OLD | NEW |
| 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/flags.h" | 8 #include "src/base/flags.h" |
| 9 #include "src/machine-type.h" | 9 #include "src/machine-type.h" |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 CheckedLoadRepresentation CheckedLoadRepresentationOf(Operator const*); | 81 CheckedLoadRepresentation CheckedLoadRepresentationOf(Operator const*); |
| 82 | 82 |
| 83 | 83 |
| 84 // A CheckedStore needs a MachineType. | 84 // A CheckedStore needs a MachineType. |
| 85 typedef MachineRepresentation CheckedStoreRepresentation; | 85 typedef MachineRepresentation CheckedStoreRepresentation; |
| 86 | 86 |
| 87 CheckedStoreRepresentation CheckedStoreRepresentationOf(Operator const*); | 87 CheckedStoreRepresentation CheckedStoreRepresentationOf(Operator const*); |
| 88 | 88 |
| 89 MachineRepresentation StackSlotRepresentationOf(Operator const* op); | 89 MachineRepresentation StackSlotRepresentationOf(Operator const* op); |
| 90 | 90 |
| 91 MachineRepresentation AtomicStoreRepresentationOf(Operator const* op); |
| 92 |
| 91 // Interface for building machine-level operators. These operators are | 93 // Interface for building machine-level operators. These operators are |
| 92 // machine-level but machine-independent and thus define a language suitable | 94 // machine-level but machine-independent and thus define a language suitable |
| 93 // for generating code to run on architectures such as ia32, x64, arm, etc. | 95 // for generating code to run on architectures such as ia32, x64, arm, etc. |
| 94 class MachineOperatorBuilder final : public ZoneObject { | 96 class MachineOperatorBuilder final : public ZoneObject { |
| 95 public: | 97 public: |
| 96 // Flags that specify which operations are available. This is useful | 98 // Flags that specify which operations are available. This is useful |
| 97 // for operations that are unsupported by some back-ends. | 99 // for operations that are unsupported by some back-ends. |
| 98 enum Flag { | 100 enum Flag { |
| 99 kNoFlags = 0u, | 101 kNoFlags = 0u, |
| 100 // Note that Float*Max behaves like `(b < a) ? a : b`, not like Math.max(). | 102 // Note that Float*Max behaves like `(b < a) ? a : b`, not like Math.max(). |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 const Operator* LoadFramePointer(); | 506 const Operator* LoadFramePointer(); |
| 505 const Operator* LoadParentFramePointer(); | 507 const Operator* LoadParentFramePointer(); |
| 506 | 508 |
| 507 // checked-load heap, index, length | 509 // checked-load heap, index, length |
| 508 const Operator* CheckedLoad(CheckedLoadRepresentation); | 510 const Operator* CheckedLoad(CheckedLoadRepresentation); |
| 509 // checked-store heap, index, length, value | 511 // checked-store heap, index, length, value |
| 510 const Operator* CheckedStore(CheckedStoreRepresentation); | 512 const Operator* CheckedStore(CheckedStoreRepresentation); |
| 511 | 513 |
| 512 // atomic-load [base + index] | 514 // atomic-load [base + index] |
| 513 const Operator* AtomicLoad(LoadRepresentation rep); | 515 const Operator* AtomicLoad(LoadRepresentation rep); |
| 516 // atomic-store [base + index], value |
| 517 const Operator* AtomicStore(MachineRepresentation rep); |
| 514 | 518 |
| 515 // Target machine word-size assumed by this builder. | 519 // Target machine word-size assumed by this builder. |
| 516 bool Is32() const { return word() == MachineRepresentation::kWord32; } | 520 bool Is32() const { return word() == MachineRepresentation::kWord32; } |
| 517 bool Is64() const { return word() == MachineRepresentation::kWord64; } | 521 bool Is64() const { return word() == MachineRepresentation::kWord64; } |
| 518 MachineRepresentation word() const { return word_; } | 522 MachineRepresentation word() const { return word_; } |
| 519 | 523 |
| 520 // Pseudo operators that translate to 32/64-bit operators depending on the | 524 // Pseudo operators that translate to 32/64-bit operators depending on the |
| 521 // word-size of the target machine assumed by this builder. | 525 // word-size of the target machine assumed by this builder. |
| 522 #define PSEUDO_OP_LIST(V) \ | 526 #define PSEUDO_OP_LIST(V) \ |
| 523 V(Word, And) \ | 527 V(Word, And) \ |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 }; | 560 }; |
| 557 | 561 |
| 558 | 562 |
| 559 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 563 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
| 560 | 564 |
| 561 } // namespace compiler | 565 } // namespace compiler |
| 562 } // namespace internal | 566 } // namespace internal |
| 563 } // namespace v8 | 567 } // namespace v8 |
| 564 | 568 |
| 565 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 569 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
| OLD | NEW |