| Index: src/compiler/js-type-hint-lowering.h
|
| diff --git a/src/compiler/js-type-hint-lowering.h b/src/compiler/js-type-hint-lowering.h
|
| index 6627a66c691bf59448bc7f9d3ef2261c953c0d1e..6cd91611881e980a4dde3c46c4b37f3aa0aec2e1 100644
|
| --- a/src/compiler/js-type-hint-lowering.h
|
| +++ b/src/compiler/js-type-hint-lowering.h
|
| @@ -14,6 +14,7 @@ namespace v8 {
|
| namespace internal {
|
|
|
| // Forward declarations.
|
| +class CompilationDependencies;
|
| class FeedbackNexus;
|
| class FeedbackSlot;
|
|
|
| @@ -47,7 +48,8 @@ class JSTypeHintLowering {
|
| typedef base::Flags<Flag> Flags;
|
|
|
| JSTypeHintLowering(JSGraph* jsgraph, Handle<FeedbackVector> feedback_vector,
|
| - Flags flags);
|
| + Handle<Context> native_context,
|
| + CompilationDependencies* dependencies, Flags flags);
|
|
|
| // Potential reduction of binary (arithmetic, logical, shift and relational
|
| // comparison) operations.
|
| @@ -63,11 +65,53 @@ class JSTypeHintLowering {
|
| Reduction ReduceToPrimitiveToStringOperation(Node* value, Node* effect,
|
| Node* control,
|
| FeedbackSlot slot) const;
|
| + class LoweringResult {
|
| + public:
|
| + Node* value() const { return value_; }
|
| + Node* effect() const { return effect_; }
|
| + Node* control() const { return control_; }
|
| +
|
| + bool Changed() const { return kind_ != LoweringResultKind::kNoChange; }
|
| + bool IsExit() const { return kind_ == LoweringResultKind::kExit; }
|
| + bool IsSideEffectFree() const {
|
| + return kind_ == LoweringResultKind::kSideEffectFree;
|
| + }
|
| +
|
| + static LoweringResult SideEffectFree(Node* value, Node* effect,
|
| + Node* control) {
|
| + DCHECK_NOT_NULL(effect);
|
| + DCHECK_NOT_NULL(control);
|
| + return LoweringResult(LoweringResultKind::kSideEffectFree, value, effect,
|
| + control);
|
| + }
|
| +
|
| + static LoweringResult NoChange() {
|
| + return LoweringResult(LoweringResultKind::kNoChange, nullptr, nullptr,
|
| + nullptr);
|
| + }
|
| +
|
| + static LoweringResult Exit(Node* control) {
|
| + return LoweringResult(LoweringResultKind::kExit, nullptr, nullptr,
|
| + control);
|
| + }
|
| +
|
| + private:
|
| + enum class LoweringResultKind { kNoChange, kSideEffectFree, kExit };
|
| +
|
| + LoweringResult(LoweringResultKind kind, Node* value, Node* effect,
|
| + Node* control)
|
| + : kind_(kind), value_(value), effect_(effect), control_(control) {}
|
| +
|
| + LoweringResultKind kind_;
|
| + Node* value_;
|
| + Node* effect_;
|
| + Node* control_;
|
| + };
|
|
|
| // Potential reduction of property access operations.
|
| - Reduction ReduceLoadNamedOperation(const Operator* op, Node* obj,
|
| - Node* effect, Node* control,
|
| - FeedbackSlot slot) const;
|
| + LoweringResult ReduceLoadNamedOperation(const Operator* op, Node* obj,
|
| + Node* effect, Node* control,
|
| + FeedbackSlot slot) const;
|
| Reduction ReduceLoadKeyedOperation(const Operator* op, Node* obj, Node* key,
|
| Node* effect, Node* control,
|
| FeedbackSlot slot) const;
|
| @@ -88,11 +132,18 @@ class JSTypeHintLowering {
|
| const Handle<FeedbackVector>& feedback_vector() const {
|
| return feedback_vector_;
|
| }
|
| + Graph* graph() const;
|
| +
|
| + Handle<Context> native_context() const { return native_context_; }
|
| + CompilationDependencies* dependencies() const { return dependencies_; }
|
|
|
| JSGraph* jsgraph_;
|
| Flags const flags_;
|
| Handle<FeedbackVector> feedback_vector_;
|
|
|
| + Handle<Context> native_context_;
|
| + CompilationDependencies* dependencies_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(JSTypeHintLowering);
|
| };
|
|
|
|
|