Add three string constants from parser to the root-set.

R=ulan@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17531 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1d835561
...@@ -5414,7 +5414,7 @@ class Internals { ...@@ -5414,7 +5414,7 @@ class Internals {
static const int kNullValueRootIndex = 7; static const int kNullValueRootIndex = 7;
static const int kTrueValueRootIndex = 8; static const int kTrueValueRootIndex = 8;
static const int kFalseValueRootIndex = 9; static const int kFalseValueRootIndex = 9;
static const int kEmptyStringRootIndex = 132; static const int kEmptyStringRootIndex = 134;
static const int kNodeClassIdOffset = 1 * kApiPointerSize; static const int kNodeClassIdOffset = 1 * kApiPointerSize;
static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3;
......
...@@ -62,7 +62,7 @@ void FuncNameInferrer::PushLiteralName(Handle<String> name) { ...@@ -62,7 +62,7 @@ void FuncNameInferrer::PushLiteralName(Handle<String> name) {
void FuncNameInferrer::PushVariableName(Handle<String> name) { void FuncNameInferrer::PushVariableName(Handle<String> name) {
if (IsOpen() && !isolate()->heap()->result_string()->Equals(*name)) { if (IsOpen() && !isolate()->heap()->dot_result_string()->Equals(*name)) {
names_stack_.Add(Name(name, kVariableName), zone()); names_stack_.Add(Name(name, kVariableName), zone());
} }
} }
......
...@@ -209,8 +209,10 @@ namespace internal { ...@@ -209,8 +209,10 @@ namespace internal {
V(Boolean_string, "Boolean") \ V(Boolean_string, "Boolean") \
V(callee_string, "callee") \ V(callee_string, "callee") \
V(constructor_string, "constructor") \ V(constructor_string, "constructor") \
V(result_string, ".result") \ V(dot_result_string, ".result") \
V(dot_for_string, ".for.") \ V(dot_for_string, ".for.") \
V(dot_iterator_string, ".iterator") \
V(dot_generator_object_string, ".generator_object") \
V(eval_string, "eval") \ V(eval_string, "eval") \
V(empty_string, "") \ V(empty_string, "") \
V(function_string, "function") \ V(function_string, "function") \
......
...@@ -2623,13 +2623,10 @@ void Parser::InitializeForEachStatement(ForEachStatement* stmt, ...@@ -2623,13 +2623,10 @@ void Parser::InitializeForEachStatement(ForEachStatement* stmt,
if (for_of != NULL) { if (for_of != NULL) {
Factory* heap_factory = isolate()->factory(); Factory* heap_factory = isolate()->factory();
Handle<String> iterator_str = heap_factory->InternalizeOneByteString( Variable* iterator = top_scope_->DeclarationScope()->NewTemporary(
STATIC_ASCII_VECTOR(".iterator")); heap_factory->dot_iterator_string());
Handle<String> result_str = heap_factory->InternalizeOneByteString( Variable* result = top_scope_->DeclarationScope()->NewTemporary(
STATIC_ASCII_VECTOR(".result")); heap_factory->dot_result_string());
Variable* iterator =
top_scope_->DeclarationScope()->NewTemporary(iterator_str);
Variable* result = top_scope_->DeclarationScope()->NewTemporary(result_str);
Expression* assign_iterator; Expression* assign_iterator;
Expression* next_result; Expression* next_result;
...@@ -4252,9 +4249,8 @@ FunctionLiteral* Parser::ParseFunctionLiteral( ...@@ -4252,9 +4249,8 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// in a temporary variable, a definition that is used by "yield" // in a temporary variable, a definition that is used by "yield"
// expressions. Presence of a variable for the generator object in the // expressions. Presence of a variable for the generator object in the
// FunctionState indicates that this function is a generator. // FunctionState indicates that this function is a generator.
Handle<String> tempname = isolate()->factory()->InternalizeOneByteString( Variable* temp = top_scope_->DeclarationScope()->NewTemporary(
STATIC_ASCII_VECTOR(".generator_object")); isolate()->factory()->dot_generator_object_string());
Variable* temp = top_scope_->DeclarationScope()->NewTemporary(tempname);
function_state.set_generator_object_variable(temp); function_state.set_generator_object_variable(temp);
} }
......
...@@ -263,7 +263,7 @@ bool Rewriter::Rewrite(CompilationInfo* info) { ...@@ -263,7 +263,7 @@ bool Rewriter::Rewrite(CompilationInfo* info) {
ZoneList<Statement*>* body = function->body(); ZoneList<Statement*>* body = function->body();
if (!body->is_empty()) { if (!body->is_empty()) {
Variable* result = scope->NewTemporary( Variable* result = scope->NewTemporary(
info->isolate()->factory()->result_string()); info->isolate()->factory()->dot_result_string());
Processor processor(result, info->zone()); Processor processor(result, info->zone());
processor.Process(body); processor.Process(body);
if (processor.HasStackOverflow()) return false; if (processor.HasStackOverflow()) return false;
......
...@@ -1302,7 +1302,7 @@ void Scope::AllocateParameterLocals() { ...@@ -1302,7 +1302,7 @@ void Scope::AllocateParameterLocals() {
void Scope::AllocateNonParameterLocal(Variable* var) { void Scope::AllocateNonParameterLocal(Variable* var) {
ASSERT(var->scope() == this); ASSERT(var->scope() == this);
ASSERT(!var->IsVariable(isolate_->factory()->result_string()) || ASSERT(!var->IsVariable(isolate_->factory()->dot_result_string()) ||
!var->IsStackLocal()); !var->IsStackLocal());
if (var->IsUnallocated() && MustAllocate(var)) { if (var->IsUnallocated() && MustAllocate(var)) {
if (MustAllocateInContext(var)) { if (MustAllocateInContext(var)) {
......
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