Reviewers: marja,
Message:
Committed patchset #1 (id:1) manually as 25121 (presubmit successful).
Description:
Revert "Parser & internalizing: efficiency fixes."
This reverts commit 94a08565d79a13056b9d964428798dac564905bc for
breaking layout tests.
[email protected]
Committed: https://code.google.com/p/v8/source/detail?r=25121
Please review this at https://codereview.chromium.org/692333006/
Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+10, -22 lines):
M src/ast-value-factory.cc
M src/parser.cc
Index: src/ast-value-factory.cc
diff --git a/src/ast-value-factory.cc b/src/ast-value-factory.cc
index
90c472d0825e55a18217db316e0e55d5cfbf590b..895ce39f652845fa83674d61ec98b0c9b8f1b5e1
100644
--- a/src/ast-value-factory.cc
+++ b/src/ast-value-factory.cc
@@ -241,11 +241,12 @@ const AstRawString*
AstValueFactory::GetString(Handle<String> literal) {
const AstConsString* AstValueFactory::NewConsString(
const AstString* left, const AstString* right) {
+ // This Vector will be valid as long as the Collector is alive (meaning
that
+ // the AstRawString will not be moved).
AstConsString* new_string = new (zone_) AstConsString(left, right);
+ strings_.Add(new_string);
if (isolate_) {
new_string->Internalize(isolate_);
- } else {
- strings_.Add(new_string);
}
return new_string;
}
@@ -272,12 +273,9 @@ const AstValue* AstValueFactory::NewString(const
AstRawString* string) {
AstValue* value = new (zone_) AstValue(string);
DCHECK(string != NULL);
if (isolate_) {
- // If we're creating immediately-internalized AstValues, the underlying
- // strings must already be internalized at this point.
- DCHECK(!string->string_.is_null());
+ value->Internalize(isolate_);
}
- // These AstValues don't need to be added to values_, since the
AstRawStrings
- // will be insternalized separately.
+ values_.Add(value);
return value;
}
@@ -286,9 +284,8 @@ const AstValue* AstValueFactory::NewSymbol(const char*
name) {
AstValue* value = new (zone_) AstValue(name);
if (isolate_) {
value->Internalize(isolate_);
- } else {
- values_.Add(value);
}
+ values_.Add(value);
return value;
}
@@ -297,9 +294,8 @@ const AstValue* AstValueFactory::NewNumber(double
number) {
AstValue* value = new (zone_) AstValue(number);
if (isolate_) {
value->Internalize(isolate_);
- } else {
- values_.Add(value);
}
+ values_.Add(value);
return value;
}
@@ -309,9 +305,8 @@ const AstValue* AstValueFactory::NewSmi(int number) {
new (zone_) AstValue(AstValue::SMI, number);
if (isolate_) {
value->Internalize(isolate_);
- } else {
- values_.Add(value);
}
+ values_.Add(value);
return value;
}
@@ -321,9 +316,8 @@ const AstValue* AstValueFactory::NewSmi(int number) {
value = new (zone_) AstValue(initializer); \
if (isolate_) { \
value->Internalize(isolate_); \
- } else { \
- values_.Add(value); \
} \
+ values_.Add(value); \
} \
return value;
@@ -370,10 +364,9 @@ const AstRawString* AstValueFactory::GetString(
AstRawString* new_string = new (zone_) AstRawString(
is_one_byte, Vector<const byte>(new_literal_bytes, length), hash);
entry->key = new_string;
+ strings_.Add(new_string);
if (isolate_) {
new_string->Internalize(isolate_);
- } else {
- strings_.Add(new_string);
}
entry->value = reinterpret_cast<void*>(1);
}
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index
7a88c5270da7ddc02f0564b2cfb91e1085cbe7fd..c5bf0d977708df914299099f36f197a0e5b55eca
100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -935,11 +935,6 @@ FunctionLiteral* Parser::ParseLazy() {
}
Handle<SharedFunctionInfo> shared_info = info()->shared_info();
- // Lazy parsing is only done during runtime, when we're already using the
- // heap. So make the AstValueFactory also internalize all values when it
- // creates them (this is more efficient).
- ast_value_factory()->Internalize(isolate());
-
// Initialize parser state.
source = String::Flatten(source);
FunctionLiteral* result;
--
--
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/d/optout.