Revision: 25121
Author: [email protected]
Date: Tue Nov 4 21:37:26 2014 UTC
Log: Revert "Parser & internalizing: efficiency fixes."
This reverts commit 94a08565d79a13056b9d964428798dac564905bc for
breaking layout tests.
[email protected]
Review URL: https://codereview.chromium.org/692333006
https://code.google.com/p/v8/source/detail?r=25121
Modified:
/branches/bleeding_edge/src/ast-value-factory.cc
/branches/bleeding_edge/src/parser.cc
=======================================
--- /branches/bleeding_edge/src/ast-value-factory.cc Tue Nov 4 14:15:57
2014 UTC
+++ /branches/bleeding_edge/src/ast-value-factory.cc Tue Nov 4 21:37:26
2014 UTC
@@ -241,11 +241,12 @@
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 @@
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 @@
AstValue* value = new (zone_) AstValue(name);
if (isolate_) {
value->Internalize(isolate_);
- } else {
- values_.Add(value);
}
+ values_.Add(value);
return value;
}
@@ -297,9 +294,8 @@
AstValue* value = new (zone_) AstValue(number);
if (isolate_) {
value->Internalize(isolate_);
- } else {
- values_.Add(value);
}
+ values_.Add(value);
return value;
}
@@ -309,9 +305,8 @@
new (zone_) AstValue(AstValue::SMI, number);
if (isolate_) {
value->Internalize(isolate_);
- } else {
- values_.Add(value);
}
+ values_.Add(value);
return value;
}
@@ -321,9 +316,8 @@
value = new (zone_) AstValue(initializer); \
if (isolate_) { \
value->Internalize(isolate_); \
- } else { \
- values_.Add(value); \
} \
+ values_.Add(value); \
} \
return value;
@@ -370,10 +364,9 @@
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);
}
=======================================
--- /branches/bleeding_edge/src/parser.cc Tue Nov 4 14:15:57 2014 UTC
+++ /branches/bleeding_edge/src/parser.cc Tue Nov 4 21:37:26 2014 UTC
@@ -935,11 +935,6 @@
}
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.