From 204b6ff066eb735fe183783dc5b6d7ca14777867 Mon Sep 17 00:00:00 2001 From: bradnelson Date: Mon, 31 Aug 2015 10:36:54 -0700 Subject: [PATCH] Drop region parameter to Unbounded, as it can be done without. Unbounded is defined in terms of None any Any, which don't require an explicit zone. Switching Unbounded to be the same. BUG= None TEST= trybots R= titzer@chromium.org LOG=N Review URL: https://codereview.chromium.org/1322003002 Cr-Commit-Position: refs/heads/master@{#30482} --- src/ast.h | 2 +- src/compiler/typer.cc | 32 +++++++++---------- src/effects.h | 6 ++-- src/types.h | 4 +-- src/typing-reset.cc | 4 +-- src/typing-reset.h | 3 -- .../cctest/expression-type-collector-macros.h | 2 +- 7 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/ast.h b/src/ast.h index 7eb73d902..1a56b32c0 100644 --- a/src/ast.h +++ b/src/ast.h @@ -406,7 +406,7 @@ class Expression : public AstNode { Expression(Zone* zone, int pos) : AstNode(pos), base_id_(BailoutId::None().ToInt()), - bounds_(Bounds::Unbounded(zone)), + bounds_(Bounds::Unbounded()), bit_field_(0) {} static int parent_num_ids() { return 0; } void set_to_boolean_types(uint16_t types) { diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc index a6c69bbd2..778d96fb0 100644 --- a/src/compiler/typer.cc +++ b/src/compiler/typer.cc @@ -483,7 +483,7 @@ Bounds Typer::Visitor::TypeStart(Node* node) { Bounds Typer::Visitor::TypeIfException(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } @@ -497,12 +497,12 @@ Bounds Typer::Visitor::TypeParameter(Node* node) { return Bounds(Type::None(), function_type->Parameter(index)); } } - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } Bounds Typer::Visitor::TypeOsrValue(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } @@ -605,18 +605,18 @@ Bounds Typer::Visitor::TypeTypedStateValues(Node* node) { Bounds Typer::Visitor::TypeCall(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } Bounds Typer::Visitor::TypeProjection(Node* node) { // TODO(titzer): use the output type of the input to determine the bounds. - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } Bounds Typer::Visitor::TypeDead(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } @@ -1204,12 +1204,12 @@ Bounds Typer::Visitor::TypeJSLoadProperty(Node* node) { Bounds Typer::Visitor::TypeJSLoadNamed(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } Bounds Typer::Visitor::TypeJSLoadGlobal(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } @@ -1377,12 +1377,12 @@ Bounds Typer::Visitor::TypeJSStoreContext(Node* node) { Bounds Typer::Visitor::TypeJSLoadDynamicGlobal(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } Bounds Typer::Visitor::TypeJSLoadDynamicContext(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } @@ -1432,7 +1432,7 @@ Bounds Typer::Visitor::TypeJSCreateScriptContext(Node* node) { Bounds Typer::Visitor::TypeJSYield(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } @@ -1483,7 +1483,7 @@ Bounds Typer::Visitor::TypeJSCallRuntime(Node* node) { default: break; } - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } @@ -1495,7 +1495,7 @@ Bounds Typer::Visitor::TypeJSForInNext(Node* node) { Bounds Typer::Visitor::TypeJSForInPrepare(Node* node) { // TODO(bmeurer): Return a tuple type here. - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } @@ -1512,7 +1512,7 @@ Bounds Typer::Visitor::TypeJSForInStep(Node* node) { Bounds Typer::Visitor::TypeJSStackCheck(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } @@ -1764,7 +1764,7 @@ Bounds Typer::Visitor::TypeObjectIsNonNegativeSmi(Node* node) { // Machine operators. Bounds Typer::Visitor::TypeLoad(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } @@ -2213,7 +2213,7 @@ Bounds Typer::Visitor::TypeLoadFramePointer(Node* node) { Bounds Typer::Visitor::TypeCheckedLoad(Node* node) { - return Bounds::Unbounded(zone()); + return Bounds::Unbounded(); } diff --git a/src/effects.h b/src/effects.h index e18baeafd..8d539f64b 100644 --- a/src/effects.h +++ b/src/effects.h @@ -35,11 +35,11 @@ struct Effect { // The unknown effect. static Effect Unknown(Zone* zone) { - return Effect(Bounds::Unbounded(zone), POSSIBLE); + return Effect(Bounds::Unbounded(), POSSIBLE); } static Effect Forget(Zone* zone) { - return Effect(Bounds::Unbounded(zone), DEFINITE); + return Effect(Bounds::Unbounded(), DEFINITE); } // Sequential composition, as in 'e1; e2'. @@ -87,7 +87,7 @@ class EffectsMixin: public Base { Bounds LookupBounds(Var var) { Effect effect = Lookup(var); return effect.modality == Effect::DEFINITE - ? effect.bounds : Bounds::Unbounded(Base::zone()); + ? effect.bounds : Bounds::Unbounded(); } // Sequential composition. diff --git a/src/types.h b/src/types.h index 66f209c12..2699845c4 100644 --- a/src/types.h +++ b/src/types.h @@ -1134,8 +1134,8 @@ struct BoundsImpl { } // Unrestricted bounds. - static BoundsImpl Unbounded(Region* region) { - return BoundsImpl(Type::None(region), Type::Any(region)); + static BoundsImpl Unbounded() { + return BoundsImpl(Type::None(), Type::Any()); } // Meet: both b1 and b2 are known to hold. diff --git a/src/typing-reset.cc b/src/typing-reset.cc index 0650656b2..97a641a8d 100644 --- a/src/typing-reset.cc +++ b/src/typing-reset.cc @@ -15,11 +15,11 @@ namespace internal { TypingReseter::TypingReseter(CompilationInfo* info) - : AstExpressionVisitor(info), info_(info) {} + : AstExpressionVisitor(info) {} void TypingReseter::VisitExpression(Expression* expression) { - expression->set_bounds(Bounds::Unbounded(info_->zone())); + expression->set_bounds(Bounds::Unbounded()); } } } // namespace v8::internal diff --git a/src/typing-reset.h b/src/typing-reset.h index 5e7d62820..7d87dc0f5 100644 --- a/src/typing-reset.h +++ b/src/typing-reset.h @@ -19,9 +19,6 @@ class TypingReseter : public AstExpressionVisitor { protected: void VisitExpression(Expression* expression) override; - - private: - CompilationInfo* info_; }; } } // namespace v8::internal diff --git a/test/cctest/expression-type-collector-macros.h b/test/cctest/expression-type-collector-macros.h index 2dcc1dcae..edc1f0911 100644 --- a/test/cctest/expression-type-collector-macros.h +++ b/test/cctest/expression-type-collector-macros.h @@ -14,7 +14,7 @@ CHECK_EQ(index, types.size()); \ } -#define DEFAULT_TYPE Bounds::Unbounded(handles.main_zone()) +#define DEFAULT_TYPE Bounds::Unbounded() #define INT32_TYPE \ Bounds(Type::Signed32(handles.main_zone()), \ Type::Signed32(handles.main_zone())) -- 2.34.1