Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: src/ast/ast-value-factory.cc

Issue 2328593002: [Parser] Don't internalize on-the-fly. (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/ast-value-factory.h ('k') | src/parsing/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast-value-factory.cc
diff --git a/src/ast/ast-value-factory.cc b/src/ast/ast-value-factory.cc
index e94501e7cb17e91821cbe1bd4fc806f35a80aa96..33ccec7fa893ae93b960df580cfcc565081b110e 100644
--- a/src/ast/ast-value-factory.cc
+++ b/src/ast/ast-value-factory.cc
@@ -237,28 +237,14 @@ AstRawString* AstValueFactory::GetTwoByteStringInternal(
const AstRawString* AstValueFactory::GetString(Handle<String> literal) {
- // For the FlatContent to stay valid, we shouldn't do any heap
- // allocation. Make sure we won't try to internalize the string in GetString.
AstRawString* result = NULL;
- Isolate* saved_isolate = isolate_;
- isolate_ = NULL;
- {
- DisallowHeapAllocation no_gc;
- String::FlatContent content = literal->GetFlatContent();
- if (content.IsOneByte()) {
- result = GetOneByteStringInternal(content.ToOneByteVector());
- } else {
- DCHECK(content.IsTwoByte());
- result = GetTwoByteStringInternal(content.ToUC16Vector());
- }
- }
- isolate_ = saved_isolate;
- if (strings_ != nullptr && isolate_) {
- // Only the string we are creating is uninternalized at this point.
- DCHECK_EQ(result, strings_);
- DCHECK_NULL(strings_->next());
- result->Internalize(isolate_);
- ResetStrings();
+ DisallowHeapAllocation no_gc;
+ String::FlatContent content = literal->GetFlatContent();
+ if (content.IsOneByte()) {
+ result = GetOneByteStringInternal(content.ToOneByteVector());
+ } else {
+ DCHECK(content.IsTwoByte());
+ result = GetTwoByteStringInternal(content.ToUC16Vector());
}
return result;
}
@@ -308,13 +294,6 @@ const AstRawString* AstValueFactory::ConcatStrings(const AstRawString* left,
}
void AstValueFactory::Internalize(Isolate* isolate) {
- if (isolate_) {
- DCHECK_NULL(strings_);
- DCHECK_NULL(values_);
- // Everything is already internalized.
- return;
- }
-
// Strings need to be internalized before values, because values refer to
// strings.
for (AstString* current = strings_; current != nullptr;) {
@@ -327,7 +306,6 @@ void AstValueFactory::Internalize(Isolate* isolate) {
current->Internalize(isolate);
current = next;
}
- isolate_ = isolate;
ResetStrings();
values_ = nullptr;
}
« no previous file with comments | « src/ast/ast-value-factory.h ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698