Commit def2411a authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Some cleanup to the Typer.

This change does the following:

  a.) Remove unused fields from the Typer.
  b.) Move some interesting unions to types.h.
  c.) Reduce Typer constructor overhead.
  d.) Avoid heap allocation in the Typer.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1199903002

Cr-Commit-Position: refs/heads/master@{#29178}
parent 816abc5e
This diff is collapsed.
......@@ -25,44 +25,31 @@ class Typer {
// TODO(bmeurer,jarin): Remove this once we have a notion of "roots" on Graph.
void Run(const ZoneVector<Node*>& roots);
Graph* graph() { return graph_; }
MaybeHandle<Context> context() { return context_; }
Zone* zone() { return graph_->zone(); }
Isolate* isolate() { return isolate_; }
private:
class Visitor;
class Decorator;
Isolate* isolate_;
Graph* graph_;
MaybeHandle<Context> context_;
Graph* graph() const { return graph_; }
MaybeHandle<Context> context() const { return context_; }
Zone* zone() const { return graph()->zone(); }
Isolate* isolate() const { return isolate_; }
Isolate* const isolate_;
Graph* const graph_;
MaybeHandle<Context> const context_;
Decorator* decorator_;
Zone* zone_;
Type* boolean_or_number;
Type* undefined_or_null;
Type* undefined_or_number;
Type* negative_signed32;
Type* non_negative_signed32;
Type* singleton_false;
Type* singleton_true;
Type* singleton_zero;
Type* singleton_one;
Type* zero_or_one;
Type* zeroish;
Type* signed32ish;
Type* unsigned32ish;
Type* falsish;
Type* truish;
Type* integer;
Type* weakint;
Type* number_fun0_;
Type* number_fun1_;
Type* number_fun2_;
Type* weakint_fun1_;
Type* random_fun_;
LazyTypeCache* cache_;
Type* singleton_false_;
Type* singleton_true_;
Type* singleton_zero_;
Type* singleton_one_;
Type* zero_or_one_;
Type* zeroish_;
Type* signed32ish_;
Type* unsigned32ish_;
Type* falsish_;
Type* truish_;
LazyTypeCache* const cache_;
DISALLOW_COPY_AND_ASSIGN(Typer);
};
......
......@@ -3187,6 +3187,8 @@ void Heap::CreateInitialObjects() {
set_nan_value(*factory->NewHeapNumber(
std::numeric_limits<double>::quiet_NaN(), IMMUTABLE, TENURED));
set_infinity_value(*factory->NewHeapNumber(V8_INFINITY, IMMUTABLE, TENURED));
set_minus_infinity_value(
*factory->NewHeapNumber(-V8_INFINITY, IMMUTABLE, TENURED));
// The hole has not been created yet, but we want to put something
// predictable in the gaps in the string table, so lets make that Smi zero.
......
......@@ -165,6 +165,7 @@ namespace internal {
V(HeapNumber, nan_value, NanValue) \
V(HeapNumber, infinity_value, InfinityValue) \
V(HeapNumber, minus_zero_value, MinusZeroValue) \
V(HeapNumber, minus_infinity_value, MinusInfinityValue) \
V(JSObject, message_listeners, MessageListeners) \
V(UnseededNumberDictionary, code_stubs, CodeStubs) \
V(UnseededNumberDictionary, non_monomorphic_cache, NonMonomorphicCache) \
......
......@@ -221,12 +221,16 @@ namespace internal {
V(Integral32, kSigned32 | kUnsigned32) \
V(PlainNumber, kIntegral32 | kOtherNumber) \
V(OrderedNumber, kPlainNumber | kMinusZero) \
V(MinusZeroOrNaN, kMinusZero | kNaN) \
V(Number, kOrderedNumber | kNaN) \
V(String, kInternalizedString | kOtherString) \
V(UniqueName, kSymbol | kInternalizedString) \
V(Name, kSymbol | kString) \
V(BooleanOrNumber, kBoolean | kNumber) \
V(NullOrUndefined, kNull | kUndefined) \
V(NumberOrString, kNumber | kString) \
V(PlainPrimitive, kNumberOrString | kBoolean | kNull | kUndefined) \
V(NumberOrUndefined, kNumber | kUndefined) \
V(PlainPrimitive, kNumberOrString | kBoolean | kNullOrUndefined) \
V(Primitive, kSymbol | kPlainPrimitive) \
V(DetectableObject, kGlobalObject | kOtherObject) \
V(DetectableReceiver, kDetectableObject | kProxy) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment