Reviewers: ulan,
Description:
Add three string constants from parser to the root-set.
[email protected]
Please review this at https://codereview.chromium.org/62143002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+13, -15 lines):
M include/v8.h
M src/func-name-inferrer.cc
M src/heap.h
M src/parser.cc
M src/rewriter.cc
M src/scopes.cc
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index
5286baae9a9ff00e9636370f4e8c5eddaa2958ea..1f8cbfd83b0e0986336b9b0bcef6985d0659a4ef
100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5414,7 +5414,7 @@ class Internals {
static const int kNullValueRootIndex = 7;
static const int kTrueValueRootIndex = 8;
static const int kFalseValueRootIndex = 9;
- static const int kEmptyStringRootIndex = 132;
+ static const int kEmptyStringRootIndex = 134;
static const int kNodeClassIdOffset = 1 * kApiPointerSize;
static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3;
Index: src/func-name-inferrer.cc
diff --git a/src/func-name-inferrer.cc b/src/func-name-inferrer.cc
index
84d3bf06b87cc852985a37c0a2664271a571e4a8..5409a4e1800c56a788a7649f7f7cd42c53363c91
100644
--- a/src/func-name-inferrer.cc
+++ b/src/func-name-inferrer.cc
@@ -62,7 +62,7 @@ void FuncNameInferrer::PushLiteralName(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());
}
}
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index
cb421d471b3cb046afcf4e67bb5b6fbdf5116eb3..d15a51c16d4d9215681ac70586e4bd2a71151ac0
100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -209,8 +209,10 @@ namespace internal {
V(Boolean_string, "Boolean") \
V(callee_string, "callee") \
V(constructor_string, "constructor") \
- V(result_string, ".result") \
+ V(dot_result_string, ".result") \
V(dot_for_string, ".for.") \
+ V(dot_iterator_string, ".iterator") \
+ V(dot_generator_object_string, ".generator_object") \
V(eval_string, "eval") \
V(empty_string, "") \
V(function_string, "function") \
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index
9a68bd7b4223e54bf9dd408665acb26bf4c305a1..0b1bf63f5da1d9db58b1bd3d720eee8d4eeb50ca
100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2623,13 +2623,10 @@ void
Parser::InitializeForEachStatement(ForEachStatement* stmt,
if (for_of != NULL) {
Factory* heap_factory = isolate()->factory();
- Handle<String> iterator_str = heap_factory->InternalizeOneByteString(
- STATIC_ASCII_VECTOR(".iterator"));
- Handle<String> result_str = heap_factory->InternalizeOneByteString(
- STATIC_ASCII_VECTOR(".result"));
- Variable* iterator =
- top_scope_->DeclarationScope()->NewTemporary(iterator_str);
- Variable* result =
top_scope_->DeclarationScope()->NewTemporary(result_str);
+ Variable* iterator = top_scope_->DeclarationScope()->NewTemporary(
+ heap_factory->dot_iterator_string());
+ Variable* result = top_scope_->DeclarationScope()->NewTemporary(
+ heap_factory->dot_result_string());
Expression* assign_iterator;
Expression* next_result;
@@ -4100,9 +4097,8 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// in a temporary variable, a definition that is used by "yield"
// expressions. Presence of a variable for the generator object in
the
// FunctionState indicates that this function is a generator.
- Handle<String> tempname =
isolate()->factory()->InternalizeOneByteString(
- STATIC_ASCII_VECTOR(".generator_object"));
- Variable* temp =
top_scope_->DeclarationScope()->NewTemporary(tempname);
+ Variable* temp = top_scope_->DeclarationScope()->NewTemporary(
+ isolate()->factory()->dot_generator_object_string());
function_state.set_generator_object_variable(temp);
}
Index: src/rewriter.cc
diff --git a/src/rewriter.cc b/src/rewriter.cc
index
70b362fd7d8656b9fd8a137cfcb3cf5139190aa0..ba35284d7f927eb222b691828622f08ee481f86f
100644
--- a/src/rewriter.cc
+++ b/src/rewriter.cc
@@ -263,7 +263,7 @@ bool Rewriter::Rewrite(CompilationInfo* info) {
ZoneList<Statement*>* body = function->body();
if (!body->is_empty()) {
Variable* result = scope->NewTemporary(
- info->isolate()->factory()->result_string());
+ info->isolate()->factory()->dot_result_string());
Processor processor(result, info->zone());
processor.Process(body);
if (processor.HasStackOverflow()) return false;
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index
ee327fb79f7dee73aebd932cc092e373e13ba055..137ab68b2c0f8a753ea872a04a051e0e74416e78
100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -1302,7 +1302,7 @@ void Scope::AllocateParameterLocals() {
void Scope::AllocateNonParameterLocal(Variable* var) {
ASSERT(var->scope() == this);
- ASSERT(!var->IsVariable(isolate_->factory()->result_string()) ||
+ ASSERT(!var->IsVariable(isolate_->factory()->dot_result_string()) ||
!var->IsStackLocal());
if (var->IsUnallocated() && MustAllocate(var)) {
if (MustAllocateInContext(var)) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.