diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-08-14 11:38:45 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-08-14 17:16:47 +0000 |
commit | 3a97ca8dd9b96b599ae2d33e40df0dd2f7ea5859 (patch) | |
tree | 43cc572ba067417c7341db81f71ae7cc6e0fcc3e /chromium/v8/src/compiler/machine-operator.cc | |
parent | f61ab1ac7f855cd281809255c0aedbb1895e1823 (diff) | |
download | qtwebengine-chromium-3a97ca8dd9b96b599ae2d33e40df0dd2f7ea5859.tar.gz |
BASELINE: Update chromium to 45.0.2454.40
Change-Id: Id2121d9f11a8fc633677236c65a3e41feef589e4
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'chromium/v8/src/compiler/machine-operator.cc')
-rw-r--r-- | chromium/v8/src/compiler/machine-operator.cc | 86 |
1 files changed, 71 insertions, 15 deletions
diff --git a/chromium/v8/src/compiler/machine-operator.cc b/chromium/v8/src/compiler/machine-operator.cc index 07bcf3f77f1..2e2229032c0 100644 --- a/chromium/v8/src/compiler/machine-operator.cc +++ b/chromium/v8/src/compiler/machine-operator.cc @@ -12,6 +12,24 @@ namespace v8 { namespace internal { namespace compiler { +std::ostream& operator<<(std::ostream& os, TruncationMode mode) { + switch (mode) { + case TruncationMode::kJavaScript: + return os << "JavaScript"; + case TruncationMode::kRoundToZero: + return os << "RoundToZero"; + } + UNREACHABLE(); + return os; +} + + +TruncationMode TruncationModeOf(Operator const* op) { + DCHECK_EQ(IrOpcode::kTruncateFloat64ToInt32, op->opcode()); + return OpParameter<TruncationMode>(op); +} + + std::ostream& operator<<(std::ostream& os, WriteBarrierKind kind) { switch (kind) { case kNoWriteBarrier: @@ -101,13 +119,14 @@ CheckedStoreRepresentation CheckedStoreRepresentationOf(Operator const* op) { V(Int64Add, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ V(Int64Sub, Operator::kNoProperties, 2, 0, 1) \ V(Int64Mul, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Int64Div, Operator::kNoProperties, 2, 0, 1) \ - V(Int64Mod, Operator::kNoProperties, 2, 0, 1) \ + V(Int64Div, Operator::kNoProperties, 2, 1, 1) \ + V(Int64Mod, Operator::kNoProperties, 2, 1, 1) \ V(Int64LessThan, Operator::kNoProperties, 2, 0, 1) \ V(Int64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Uint64Div, Operator::kNoProperties, 2, 0, 1) \ + V(Uint64Div, Operator::kNoProperties, 2, 1, 1) \ + V(Uint64Mod, Operator::kNoProperties, 2, 1, 1) \ V(Uint64LessThan, Operator::kNoProperties, 2, 0, 1) \ - V(Uint64Mod, Operator::kNoProperties, 2, 0, 1) \ + V(Uint64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ V(ChangeFloat32ToFloat64, Operator::kNoProperties, 1, 0, 1) \ V(ChangeFloat64ToInt32, Operator::kNoProperties, 1, 0, 1) \ V(ChangeFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ @@ -116,24 +135,20 @@ CheckedStoreRepresentation CheckedStoreRepresentationOf(Operator const* op) { V(ChangeUint32ToFloat64, Operator::kNoProperties, 1, 0, 1) \ V(ChangeUint32ToUint64, Operator::kNoProperties, 1, 0, 1) \ V(TruncateFloat64ToFloat32, Operator::kNoProperties, 1, 0, 1) \ - V(TruncateFloat64ToInt32, Operator::kNoProperties, 1, 0, 1) \ V(TruncateInt64ToInt32, Operator::kNoProperties, 1, 0, 1) \ + V(Float32Abs, Operator::kNoProperties, 1, 0, 1) \ V(Float32Add, Operator::kCommutative, 2, 0, 1) \ V(Float32Sub, Operator::kNoProperties, 2, 0, 1) \ V(Float32Mul, Operator::kCommutative, 2, 0, 1) \ V(Float32Div, Operator::kNoProperties, 2, 0, 1) \ - V(Float32Abs, Operator::kNoProperties, 1, 0, 1) \ V(Float32Sqrt, Operator::kNoProperties, 1, 0, 1) \ + V(Float64Abs, Operator::kNoProperties, 1, 0, 1) \ V(Float64Add, Operator::kCommutative, 2, 0, 1) \ V(Float64Sub, Operator::kNoProperties, 2, 0, 1) \ V(Float64Mul, Operator::kCommutative, 2, 0, 1) \ V(Float64Div, Operator::kNoProperties, 2, 0, 1) \ V(Float64Mod, Operator::kNoProperties, 2, 0, 1) \ - V(Float64Abs, Operator::kNoProperties, 1, 0, 1) \ V(Float64Sqrt, Operator::kNoProperties, 1, 0, 1) \ - V(Float64RoundDown, Operator::kNoProperties, 1, 0, 1) \ - V(Float64RoundTruncate, Operator::kNoProperties, 1, 0, 1) \ - V(Float64RoundTiesAway, Operator::kNoProperties, 1, 0, 1) \ V(Float32Equal, Operator::kCommutative, 2, 0, 1) \ V(Float32LessThan, Operator::kNoProperties, 2, 0, 1) \ V(Float32LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ @@ -144,11 +159,17 @@ CheckedStoreRepresentation CheckedStoreRepresentationOf(Operator const* op) { V(Float64ExtractHighWord32, Operator::kNoProperties, 1, 0, 1) \ V(Float64InsertLowWord32, Operator::kNoProperties, 2, 0, 1) \ V(Float64InsertHighWord32, Operator::kNoProperties, 2, 0, 1) \ - V(Float32Max, Operator::kNoProperties, 2, 0, 1) \ - V(Float32Min, Operator::kNoProperties, 2, 0, 1) \ - V(Float64Max, Operator::kNoProperties, 2, 0, 1) \ - V(Float64Min, Operator::kNoProperties, 2, 0, 1) \ - V(LoadStackPointer, Operator::kNoProperties, 0, 0, 1) + V(LoadStackPointer, Operator::kNoProperties, 0, 0, 1) \ + V(LoadFramePointer, Operator::kNoProperties, 0, 0, 1) + +#define PURE_OPTIONAL_OP_LIST(V) \ + V(Float32Max, Operator::kNoProperties, 2, 0, 1) \ + V(Float32Min, Operator::kNoProperties, 2, 0, 1) \ + V(Float64Max, Operator::kNoProperties, 2, 0, 1) \ + V(Float64Min, Operator::kNoProperties, 2, 0, 1) \ + V(Float64RoundDown, Operator::kNoProperties, 1, 0, 1) \ + V(Float64RoundTruncate, Operator::kNoProperties, 1, 0, 1) \ + V(Float64RoundTiesAway, Operator::kNoProperties, 1, 0, 1) #define MACHINE_TYPE_LIST(V) \ @@ -184,8 +205,22 @@ struct MachineOperatorGlobalCache { }; \ Name##Operator k##Name; PURE_OP_LIST(PURE) + PURE_OPTIONAL_OP_LIST(PURE) #undef PURE + template <TruncationMode kMode> + struct TruncateFloat64ToInt32Operator final + : public Operator1<TruncationMode> { + TruncateFloat64ToInt32Operator() + : Operator1<TruncationMode>(IrOpcode::kTruncateFloat64ToInt32, + Operator::kPure, "TruncateFloat64ToInt32", + 1, 0, 0, 1, 0, 0, kMode) {} + }; + TruncateFloat64ToInt32Operator<TruncationMode::kJavaScript> + kTruncateFloat64ToInt32JavaScript; + TruncateFloat64ToInt32Operator<TruncationMode::kRoundToZero> + kTruncateFloat64ToInt32RoundToZero; + #define LOAD(Type) \ struct Load##Type##Operator final : public Operator1<LoadRepresentation> { \ Load##Type##Operator() \ @@ -255,6 +290,27 @@ MachineOperatorBuilder::MachineOperatorBuilder(Zone* zone, MachineType word, PURE_OP_LIST(PURE) #undef PURE +#define PURE(Name, properties, value_input_count, control_input_count, \ + output_count) \ + const OptionalOperator MachineOperatorBuilder::Name() { \ + return OptionalOperator(flags_ & k##Name ? &cache_.k##Name : nullptr); \ + } +PURE_OPTIONAL_OP_LIST(PURE) +#undef PURE + + +const Operator* MachineOperatorBuilder::TruncateFloat64ToInt32( + TruncationMode mode) { + switch (mode) { + case TruncationMode::kJavaScript: + return &cache_.kTruncateFloat64ToInt32JavaScript; + case TruncationMode::kRoundToZero: + return &cache_.kTruncateFloat64ToInt32RoundToZero; + } + UNREACHABLE(); + return nullptr; +} + const Operator* MachineOperatorBuilder::Load(LoadRepresentation rep) { switch (rep) { |