From: ager@chromium.org Date: Thu, 5 Feb 2009 10:06:41 +0000 (+0000) Subject: Remove unused code. This code used to be used to "decide" if a call X-Git-Tag: upstream/4.7.83~24695 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5fa3bd84400d111aa51ebdabb9581c6dbe217cea;p=platform%2Fupstream%2Fv8.git Remove unused code. This code used to be used to "decide" if a call to eval is aliased. Now that we correctly track eval aliasing, we do not need this code. Review URL: http://codereview.chromium.org/20078 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/scopeinfo.cc b/src/scopeinfo.cc index 64706b5eb..3c56acc53 100644 --- a/src/scopeinfo.cc +++ b/src/scopeinfo.cc @@ -50,7 +50,6 @@ static int CompareLocal(Variable* const* v, Variable* const* w) { template ScopeInfo::ScopeInfo(Scope* scope) : function_name_(Factory::empty_symbol()), - supports_eval_(scope->SupportsEval()), parameters_(scope->num_parameters()), stack_slots_(scope->num_stack_slots()), context_slots_(scope->num_heap_slots()), @@ -151,7 +150,6 @@ ScopeInfo::ScopeInfo(Scope* scope) // Encoding format in the Code object: // // - function name -// - supports eval info // // - number of variables in the context object (smi) (= function context // slot index + 1) @@ -247,7 +245,6 @@ static Object** ReadList(Object** p, template ScopeInfo::ScopeInfo(Code* code) : function_name_(Factory::empty_symbol()), - supports_eval_(false), parameters_(4), stack_slots_(8), context_slots_(8), @@ -257,7 +254,6 @@ ScopeInfo::ScopeInfo(Code* code) Object** p0 = &Memory::Object_at(code->sinfo_start()); Object** p = p0; p = ReadSymbol(p, &function_name_); - p = ReadBool(p, &supports_eval_); p = ReadList(p, &context_slots_, &context_modes_); p = ReadList(p, ¶meters_); p = ReadList(p, &stack_slots_); @@ -310,8 +306,8 @@ static Object** WriteList(Object** p, template int ScopeInfo::Serialize(Code* code) { - // function name, supports eval, length & sentinel for 3 tables: - const int extra_slots = 1 + 1 + 2 * 3; + // function name, length & sentinel for 3 tables: + const int extra_slots = 1 + 2 * 3; int size = (extra_slots + context_slots_.length() * 2 + parameters_.length() + @@ -322,7 +318,6 @@ int ScopeInfo::Serialize(Code* code) { Object** p0 = &Memory::Object_at(code->sinfo_start()); Object** p = p0; p = WriteSymbol(p, function_name_); - p = WriteInt(p, supports_eval_); p = WriteList(p, &context_slots_, &context_modes_); p = WriteList(p, ¶meters_); p = WriteList(p, &stack_slots_); @@ -343,8 +338,8 @@ void ScopeInfo::IterateScopeInfo(Code* code, ObjectVisitor* v) { static Object** ContextEntriesAddr(Code* code) { ASSERT(code->sinfo_size() > 0); - // +2 for function name, supports eval: - return &Memory::Object_at(code->sinfo_start()) + 2; + // +1 for function name: + return &Memory::Object_at(code->sinfo_start()) + 1; } @@ -366,21 +361,6 @@ static Object** StackSlotEntriesAddr(Code* code) { } -template -bool ScopeInfo::SupportsEval(Code* code) { - bool result = false; - if (code->sinfo_size() > 0) { - ReadBool(&Memory::Object_at(code->sinfo_start()) + 1, &result); - } -#ifdef DEBUG - { ScopeInfo info(code); - ASSERT(result == info.supports_eval_); - } -#endif - return result; -} - - template int ScopeInfo::NumberOfStackSlots(Code* code) { if (code->sinfo_size() > 0) { @@ -551,9 +531,6 @@ void ScopeInfo::Print() { PrintF("/* no function name */"); PrintF("{"); - if (supports_eval_) - PrintF("\n // supports eval\n"); - PrintList("parameters", 0, parameters_); PrintList("stack slots", 0, stack_slots_); PrintList("context slots", Context::MIN_CONTEXT_SLOTS, diff --git a/src/scopeinfo.h b/src/scopeinfo.h index 285280cdd..f59c02c31 100644 --- a/src/scopeinfo.h +++ b/src/scopeinfo.h @@ -75,8 +75,6 @@ class ScopeInfo BASE_EMBEDDED { Handle function_name() const { return function_name_; } - bool supports_eval() const { return supports_eval_; } - Handle parameter_name(int i) const { return parameters_[i]; } int number_of_parameters() const { return parameters_.length(); } @@ -104,8 +102,6 @@ class ScopeInfo BASE_EMBEDDED { // encoding of it's information in a Code object, which is why these // functions are in this class. - static bool SupportsEval(Code* code); - // Return the number of stack slots for code. static int NumberOfStackSlots(Code* code); @@ -146,7 +142,6 @@ class ScopeInfo BASE_EMBEDDED { private: Handle function_name_; - bool supports_eval_; List, Allocator > parameters_; List, Allocator > stack_slots_; List, Allocator > context_slots_; diff --git a/src/scopes.cc b/src/scopes.cc index b198d962c..87497d00a 100644 --- a/src/scopes.cc +++ b/src/scopes.cc @@ -324,11 +324,6 @@ void Scope::AllocateVariables() { } -bool Scope::SupportsEval() const { - return scope_calls_eval_ || inner_scope_calls_eval_; -} - - bool Scope::AllowsLazyCompilation() const { return !force_eager_compilation_ && HasTrivialOuterContext(); } diff --git a/src/scopes.h b/src/scopes.h index 1eee225de..2c04053f8 100644 --- a/src/scopes.h +++ b/src/scopes.h @@ -222,10 +222,6 @@ class Scope: public ZoneObject { int num_stack_slots() const { return num_stack_slots_; } int num_heap_slots() const { return num_heap_slots_; } - // True if this scope supports calling eval (has a properly - // initialized context). - bool SupportsEval() const; - // Make sure this scope and all outer scopes are eagerly compiled. void ForceEagerCompilation() { force_eager_compilation_ = true; }