From: fschneider@chromium.org Date: Fri, 2 Sep 2011 12:59:05 +0000 (+0000) Subject: Remove unused code for AstSentinels and related stuff. X-Git-Tag: upstream/4.7.83~18581 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b20f952e71bcd3bd5a2f82e69f278b689daf2478;p=platform%2Fupstream%2Fv8.git Remove unused code for AstSentinels and related stuff. TEST=compiles Review URL: http://codereview.chromium.org/7792097 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/ast.cc b/src/ast.cc index 7319abe..4d881d1 100644 --- a/src/ast.cc +++ b/src/ast.cc @@ -36,15 +36,6 @@ namespace v8 { namespace internal { -AstSentinels::AstSentinels() - : this_proxy_(Isolate::Current(), true), - identifier_proxy_(Isolate::Current(), false), - valid_left_hand_side_sentinel_(Isolate::Current()), - this_property_(Isolate::Current(), &this_proxy_, NULL, 0), - call_sentinel_(Isolate::Current(), NULL, NULL, 0) { -} - - // ---------------------------------------------------------------------------- // All the Accept member functions for each syntax tree node type. @@ -101,15 +92,6 @@ VariableProxy::VariableProxy(Isolate* isolate, } -VariableProxy::VariableProxy(Isolate* isolate, bool is_this) - : Expression(isolate), - var_(NULL), - is_this_(is_this), - inside_with_(false), - is_trivial_(false) { -} - - void VariableProxy::BindTo(Variable* var) { ASSERT(var_ == NULL); // must be bound only once ASSERT(var != NULL); // must bind @@ -487,12 +469,6 @@ bool SharedFunctionInfoLiteral::IsInlineable() const { } -bool ValidLeftHandSideSentinel::IsInlineable() const { - UNREACHABLE(); - return false; -} - - bool ForStatement::IsInlineable() const { return (init() == NULL || init()->IsInlineable()) && (cond() == NULL || cond()->IsInlineable()) diff --git a/src/ast.h b/src/ast.h index e36eb9b..3d53b5f 100644 --- a/src/ast.h +++ b/src/ast.h @@ -320,20 +320,6 @@ class Expression: public AstNode { }; -/** - * A sentinel used during pre parsing that represents some expression - * that is a valid left hand side without having to actually build - * the expression. - */ -class ValidLeftHandSideSentinel: public Expression { - public: - explicit ValidLeftHandSideSentinel(Isolate* isolate) : Expression(isolate) {} - virtual bool IsValidLeftHandSide() { return true; } - virtual void Accept(AstVisitor* v) { UNREACHABLE(); } - virtual bool IsInlineable() const; -}; - - class BreakableStatement: public Statement { public: enum Type { @@ -1174,24 +1160,11 @@ class VariableProxy: public Expression { bool is_this, bool inside_with, int position = RelocInfo::kNoPosition); - VariableProxy(Isolate* isolate, bool is_this); friend class Scope; }; -class VariableProxySentinel: public VariableProxy { - public: - virtual bool IsValidLeftHandSide() { return !is_this(); } - - private: - VariableProxySentinel(Isolate* isolate, bool is_this) - : VariableProxy(isolate, is_this) { } - - friend class AstSentinels; -}; - - class Slot: public Expression { public: enum Type { @@ -1349,36 +1322,6 @@ class Call: public Expression { }; -class AstSentinels { - public: - ~AstSentinels() { } - - // Returns a property singleton property access on 'this'. Used - // during preparsing. - Property* this_property() { return &this_property_; } - VariableProxySentinel* this_proxy() { return &this_proxy_; } - VariableProxySentinel* identifier_proxy() { return &identifier_proxy_; } - ValidLeftHandSideSentinel* valid_left_hand_side_sentinel() { - return &valid_left_hand_side_sentinel_; - } - Call* call_sentinel() { return &call_sentinel_; } - EmptyStatement* empty_statement() { return &empty_statement_; } - - private: - AstSentinels(); - VariableProxySentinel this_proxy_; - VariableProxySentinel identifier_proxy_; - ValidLeftHandSideSentinel valid_left_hand_side_sentinel_; - Property this_property_; - Call call_sentinel_; - EmptyStatement empty_statement_; - - friend class Isolate; - - DISALLOW_COPY_AND_ASSIGN(AstSentinels); -}; - - class CallNew: public Expression { public: CallNew(Isolate* isolate, diff --git a/src/isolate.cc b/src/isolate.cc index 09cbc8a..d366902 100644 --- a/src/isolate.cc +++ b/src/isolate.cc @@ -1409,7 +1409,6 @@ Isolate::Isolate() global_handles_(NULL), context_switcher_(NULL), thread_manager_(NULL), - ast_sentinels_(NULL), string_tracker_(NULL), regexp_stack_(NULL), embedder_data_(NULL) { @@ -1546,9 +1545,6 @@ Isolate::~Isolate() { delete regexp_stack_; regexp_stack_ = NULL; - delete ast_sentinels_; - ast_sentinels_ = NULL; - delete descriptor_lookup_cache_; descriptor_lookup_cache_ = NULL; delete context_slot_cache_; @@ -1710,7 +1706,6 @@ bool Isolate::Init(Deserializer* des) { bootstrapper_ = new Bootstrapper(); handle_scope_implementer_ = new HandleScopeImplementer(this); stub_cache_ = new StubCache(this); - ast_sentinels_ = new AstSentinels(); regexp_stack_ = new RegExpStack(); regexp_stack_->isolate_ = this; diff --git a/src/isolate.h b/src/isolate.h index 5bb504d..7c690d2 100644 --- a/src/isolate.h +++ b/src/isolate.h @@ -47,7 +47,6 @@ namespace v8 { namespace internal { -class AstSentinels; class Bootstrapper; class CodeGenerator; class CodeRange; @@ -878,8 +877,6 @@ class Isolate { return &objects_string_input_buffer_; } - AstSentinels* ast_sentinels() { return ast_sentinels_; } - RuntimeState* runtime_state() { return &runtime_state_; } StaticResource* compiler_safe_string_input_buffer() { @@ -1138,7 +1135,6 @@ class Isolate { GlobalHandles* global_handles_; ContextSwitcher* context_switcher_; ThreadManager* thread_manager_; - AstSentinels* ast_sentinels_; RuntimeState runtime_state_; StaticResource compiler_safe_string_input_buffer_; Builtins builtins_;