Index: src/ast.h |
diff --git a/src/ast.h b/src/ast.h |
index d8bc18e27829907ad37de2c6a50f94e17d547920..6c4a610422182a319d2bcd184d9c59f45ecf93c4 100644 |
--- a/src/ast.h |
+++ b/src/ast.h |
@@ -31,7 +31,6 @@ |
#include "execution.h" |
#include "factory.h" |
#include "jsregexp.h" |
-#include "jump-target.h" |
#include "runtime.h" |
#include "token.h" |
#include "variables.h" |
@@ -220,7 +219,7 @@ class Expression: public AstNode { |
kTest |
}; |
- Expression() : bitfields_(0) {} |
+ Expression() {} |
virtual Expression* AsExpression() { return this; } |
@@ -266,70 +265,9 @@ class Expression: public AstNode { |
return Handle<Map>(); |
} |
- // Static type information for this expression. |
- StaticType* type() { return &type_; } |
- |
- // True if the expression is a loop condition. |
- bool is_loop_condition() const { |
- return LoopConditionField::decode(bitfields_); |
- } |
- void set_is_loop_condition(bool flag) { |
- bitfields_ = (bitfields_ & ~LoopConditionField::mask()) | |
- LoopConditionField::encode(flag); |
- } |
- |
// The value of the expression is guaranteed to be a smi, because the |
// top operation is a bit operation with a mask, or a shift. |
bool GuaranteedSmiResult(); |
- |
- // AST analysis results. |
- void CopyAnalysisResultsFrom(Expression* other); |
- |
- // True if the expression rooted at this node can be compiled by the |
- // side-effect free compiler. |
- bool side_effect_free() { return SideEffectFreeField::decode(bitfields_); } |
- void set_side_effect_free(bool is_side_effect_free) { |
- bitfields_ &= ~SideEffectFreeField::mask(); |
- bitfields_ |= SideEffectFreeField::encode(is_side_effect_free); |
- } |
- |
- // Will the use of this expression treat -0 the same as 0 in all cases? |
- // If so, we can return 0 instead of -0 if we want to, to optimize code. |
- bool no_negative_zero() { return NoNegativeZeroField::decode(bitfields_); } |
- void set_no_negative_zero(bool no_negative_zero) { |
- bitfields_ &= ~NoNegativeZeroField::mask(); |
- bitfields_ |= NoNegativeZeroField::encode(no_negative_zero); |
- } |
- |
- // Will ToInt32 (ECMA 262-3 9.5) or ToUint32 (ECMA 262-3 9.6) |
- // be applied to the value of this expression? |
- // If so, we may be able to optimize the calculation of the value. |
- bool to_int32() { return ToInt32Field::decode(bitfields_); } |
- void set_to_int32(bool to_int32) { |
- bitfields_ &= ~ToInt32Field::mask(); |
- bitfields_ |= ToInt32Field::encode(to_int32); |
- } |
- |
- // How many bitwise logical or shift operators are used in this expression? |
- int num_bit_ops() { return NumBitOpsField::decode(bitfields_); } |
- void set_num_bit_ops(int num_bit_ops) { |
- bitfields_ &= ~NumBitOpsField::mask(); |
- num_bit_ops = Min(num_bit_ops, kMaxNumBitOps); |
- bitfields_ |= NumBitOpsField::encode(num_bit_ops); |
- } |
- |
- private: |
- static const int kMaxNumBitOps = (1 << 5) - 1; |
- |
- uint32_t bitfields_; |
- StaticType type_; |
- |
- // Using template BitField<type, start, size>. |
- class SideEffectFreeField : public BitField<bool, 0, 1> {}; |
- class NoNegativeZeroField : public BitField<bool, 1, 1> {}; |
- class ToInt32Field : public BitField<bool, 2, 1> {}; |
- class NumBitOpsField : public BitField<int, 3, 5> {}; |
- class LoopConditionField: public BitField<bool, 8, 1> {}; |
}; |
@@ -360,7 +298,7 @@ class BreakableStatement: public Statement { |
virtual BreakableStatement* AsBreakableStatement() { return this; } |
// Code generation |
- BreakTarget* break_target() { return &break_target_; } |
+ Label* break_target() { return &break_target_; } |
// Testers. |
bool is_target_for_anonymous() const { return type_ == TARGET_FOR_ANONYMOUS; } |
@@ -375,7 +313,7 @@ class BreakableStatement: public Statement { |
private: |
ZoneStringList* labels_; |
Type type_; |
- BreakTarget break_target_; |
+ Label break_target_; |
int entry_id_; |
int exit_id_; |
}; |
@@ -446,7 +384,7 @@ class IterationStatement: public BreakableStatement { |
virtual int ContinueId() const = 0; |
// Code generation |
- BreakTarget* continue_target() { return &continue_target_; } |
+ Label* continue_target() { return &continue_target_; } |
protected: |
explicit inline IterationStatement(ZoneStringList* labels); |
@@ -457,7 +395,7 @@ class IterationStatement: public BreakableStatement { |
private: |
Statement* body_; |
- BreakTarget continue_target_; |
+ Label continue_target_; |
int osr_entry_id_; |
}; |
@@ -693,7 +631,7 @@ class CaseClause: public ZoneObject { |
CHECK(!is_default()); |
return label_; |
} |
- JumpTarget* body_target() { return &body_target_; } |
+ Label* body_target() { return &body_target_; } |
ZoneList<Statement*>* statements() const { return statements_; } |
int position() { return position_; } |
@@ -708,7 +646,7 @@ class CaseClause: public ZoneObject { |
private: |
Expression* label_; |
- JumpTarget body_target_; |
+ Label body_target_; |
ZoneList<Statement*>* statements_; |
int position_; |
enum CompareTypeFeedback { NONE, SMI_ONLY, OBJECT_ONLY }; |
@@ -781,23 +719,23 @@ class IfStatement: public Statement { |
// stack in the compiler; this should probably be reworked. |
class TargetCollector: public AstNode { |
public: |
- explicit TargetCollector(ZoneList<BreakTarget*>* targets) |
+ explicit TargetCollector(ZoneList<Label*>* targets) |
: targets_(targets) { |
} |
// Adds a jump target to the collector. The collector stores a pointer not |
// a copy of the target to make binding work, so make sure not to pass in |
// references to something on the stack. |
- void AddTarget(BreakTarget* target); |
+ void AddTarget(Label* target); |
// Virtual behaviour. TargetCollectors are never part of the AST. |
virtual void Accept(AstVisitor* v) { UNREACHABLE(); } |
virtual TargetCollector* AsTargetCollector() { return this; } |
- ZoneList<BreakTarget*>* targets() { return targets_; } |
+ ZoneList<Label*>* targets() { return targets_; } |
private: |
- ZoneList<BreakTarget*>* targets_; |
+ ZoneList<Label*>* targets_; |
}; |
@@ -806,16 +744,16 @@ class TryStatement: public Statement { |
explicit TryStatement(Block* try_block) |
: try_block_(try_block), escaping_targets_(NULL) { } |
- void set_escaping_targets(ZoneList<BreakTarget*>* targets) { |
+ void set_escaping_targets(ZoneList<Label*>* targets) { |
escaping_targets_ = targets; |
} |
Block* try_block() const { return try_block_; } |
- ZoneList<BreakTarget*>* escaping_targets() const { return escaping_targets_; } |
+ ZoneList<Label*>* escaping_targets() const { return escaping_targets_; } |
private: |
Block* try_block_; |
- ZoneList<BreakTarget*>* escaping_targets_; |
+ ZoneList<Label*>* escaping_targets_; |
}; |