Revert "Implement simple effect typing for variables" and "Handle switch effects".

This reverts r15776 and r15777 due to compile failures on Chromium Mac bots.

TBR=rossberg@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15786 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 24dec186
......@@ -259,7 +259,6 @@ class Statement: public AstNode {
Statement() : statement_pos_(RelocInfo::kNoPosition) {}
bool IsEmpty() { return AsEmptyStatement() != NULL; }
virtual bool IsJump() const { return false; }
void set_statement_pos(int statement_pos) { statement_pos_ = statement_pos; }
int statement_pos() const { return statement_pos_; }
......@@ -390,7 +389,7 @@ class Expression: public AstNode {
protected:
explicit Expression(Isolate* isolate)
: bounds_(Bounds::Unbounded(isolate)),
: bounds_(Type::None(), Type::Any(), isolate),
id_(GetNextId(isolate)),
test_id_(GetNextId(isolate)) {}
void set_to_boolean_types(byte types) { to_boolean_types_ = types; }
......@@ -460,11 +459,6 @@ class Block: public BreakableStatement {
ZoneList<Statement*>* statements() { return &statements_; }
bool is_initializer_block() const { return is_initializer_block_; }
virtual bool IsJump() const {
return !statements_.is_empty() && statements_.last()->IsJump()
&& labels() == NULL; // Good enough as an approximation...
}
Scope* scope() const { return scope_; }
void set_scope(Scope* scope) { scope_ = scope; }
......@@ -1015,7 +1009,6 @@ class ExpressionStatement: public Statement {
void set_expression(Expression* e) { expression_ = e; }
Expression* expression() const { return expression_; }
virtual bool IsJump() const { return expression_->IsThrow(); }
protected:
explicit ExpressionStatement(Expression* expression)
......@@ -1026,16 +1019,7 @@ class ExpressionStatement: public Statement {
};
class JumpStatement: public Statement {
public:
virtual bool IsJump() const { return true; }
protected:
JumpStatement() {}
};
class ContinueStatement: public JumpStatement {
class ContinueStatement: public Statement {
public:
DECLARE_NODE_TYPE(ContinueStatement)
......@@ -1050,7 +1034,7 @@ class ContinueStatement: public JumpStatement {
};
class BreakStatement: public JumpStatement {
class BreakStatement: public Statement {
public:
DECLARE_NODE_TYPE(BreakStatement)
......@@ -1065,7 +1049,7 @@ class BreakStatement: public JumpStatement {
};
class ReturnStatement: public JumpStatement {
class ReturnStatement: public Statement {
public:
DECLARE_NODE_TYPE(ReturnStatement)
......@@ -1184,11 +1168,6 @@ class IfStatement: public Statement {
Statement* then_statement() const { return then_statement_; }
Statement* else_statement() const { return else_statement_; }
virtual bool IsJump() const {
return HasThenStatement() && then_statement()->IsJump()
&& HasElseStatement() && else_statement()->IsJump();
}
BailoutId IfId() const { return if_id_; }
BailoutId ThenId() const { return then_id_; }
BailoutId ElseId() const { return else_id_; }
......
This diff is collapsed.
......@@ -90,12 +90,6 @@ bool SplayTree<Config, Allocator>::FindInternal(const Key& key) {
}
template<typename Config, class Allocator>
bool SplayTree<Config, Allocator>::Contains(const Key& key) {
return FindInternal(key);
}
template<typename Config, class Allocator>
bool SplayTree<Config, Allocator>::Find(const Key& key, Locator* locator) {
if (FindInternal(key)) {
......@@ -299,10 +293,9 @@ void SplayTree<Config, Allocator>::ForEach(Callback* callback) {
template <typename Config, class Allocator> template <class Callback>
void SplayTree<Config, Allocator>::ForEachNode(Callback* callback) {
if (root_ == NULL) return;
// Pre-allocate some space for tiny trees.
List<Node*, Allocator> nodes_to_visit(10, allocator_);
nodes_to_visit.Add(root_, allocator_);
if (root_ != NULL) nodes_to_visit.Add(root_, allocator_);
int pos = 0;
while (pos < nodes_to_visit.length()) {
Node* node = nodes_to_visit[pos++];
......
......@@ -39,9 +39,9 @@ namespace internal {
//
// typedef Key: the key type
// typedef Value: the value type
// static const Key kNoKey: the dummy key used when no key is set
// static Value kNoValue(): the dummy value used to initialize nodes
// static int (Compare)(Key& a, Key& b) -> {-1, 0, 1}: comparison function
// static const kNoKey: the dummy key used when no key is set
// static const kNoValue: the dummy value used to initialize nodes
// int (Compare)(Key& a, Key& b) -> {-1, 0, 1}: comparison function
//
// The tree is also parameterized by an allocation policy
// (Allocator). The policy is used for allocating lists in the C free
......@@ -74,11 +74,6 @@ class SplayTree {
UNREACHABLE();
}
AllocationPolicy allocator() { return allocator_; }
// Checks if there is a mapping for the key.
bool Contains(const Key& key);
// Inserts the given key in this tree with the given value. Returns
// true if a node was inserted, otherwise false. If found the locator
// is enabled and provides access to the mapping for the key.
......@@ -109,9 +104,6 @@ class SplayTree {
// Remove the node with the given key from the tree.
bool Remove(const Key& key);
// Remove all keys from the tree.
void Clear() { ResetRoot(); }
bool is_empty() { return root_ == NULL; }
// Perform the splay operation for the given key. Moves the node with
......
......@@ -303,11 +303,6 @@ struct Bounds {
explicit Bounds(Handle<Type> t) : lower(t), upper(t) {}
Bounds(Type* t, Isolate* isl) : lower(t, isl), upper(t, isl) {}
// Unrestricted bounds.
static Bounds Unbounded(Isolate* isl) {
return Bounds(Type::None(), Type::Any(), isl);
}
// Meet: both b1 and b2 are known to hold.
static Bounds Both(Bounds b1, Bounds b2, Isolate* isl) {
return Bounds(
......
This diff is collapsed.
......@@ -35,7 +35,6 @@
#include "compiler.h"
#include "type-info.h"
#include "types.h"
#include "effects.h"
#include "zone.h"
#include "scopes.h"
......@@ -58,13 +57,8 @@ class AstTyper: public AstVisitor {
private:
explicit AstTyper(CompilationInfo* info);
static const int kNoVar = INT_MIN;
typedef v8::internal::Effects<int, kNoVar> Effects;
typedef v8::internal::NestedEffects<int, kNoVar> Store;
CompilationInfo* info_;
TypeFeedbackOracle oracle_;
Store store_;
TypeFeedbackOracle* oracle() { return &oracle_; }
Zone* zone() const { return info_->zone(); }
......@@ -76,17 +70,6 @@ class AstTyper: public AstVisitor {
e->set_bounds(Bounds::NarrowLower(e->bounds(), t, isolate_));
}
Effects EnterEffects() {
store_ = store_.Push();
return store_.Top();
}
void ExitEffects() { store_ = store_.Pop(); }
int variable_index(Variable* var) {
return var->IsStackLocal() ? var->index() :
var->IsParameter() ? -var->index() : kNoVar;
}
void VisitDeclarations(ZoneList<Declaration*>* declarations);
void VisitStatements(ZoneList<Statement*>* statements);
......
......@@ -109,12 +109,6 @@ void* ZoneList<T>::operator new(size_t size, Zone* zone) {
}
template <typename T>
void* ZoneSplayTree<T>::operator new(size_t size, Zone* zone) {
return zone->New(static_cast<int>(size));
}
} } // namespace v8::internal
#endif // V8_ZONE_INL_H_
......@@ -177,7 +177,6 @@ struct ZoneAllocationPolicy {
explicit ZoneAllocationPolicy(Zone* zone) : zone_(zone) { }
INLINE(void* New(size_t size));
INLINE(static void Delete(void *pointer)) { }
Zone* zone() { return zone_; }
private:
Zone* zone_;
......@@ -247,8 +246,6 @@ class ZoneSplayTree: public SplayTree<Config, ZoneAllocationPolicy> {
explicit ZoneSplayTree(Zone* zone)
: SplayTree<Config, ZoneAllocationPolicy>(ZoneAllocationPolicy(zone)) {}
~ZoneSplayTree();
INLINE(void* operator new(size_t size, Zone* zone));
};
......
......@@ -290,7 +290,6 @@
'../../src/double.h',
'../../src/dtoa.cc',
'../../src/dtoa.h',
'../../src/effects.h',
'../../src/elements-kind.cc',
'../../src/elements-kind.h',
'../../src/elements.cc',
......
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