| Index: src/ast/ast-value-factory.cc
|
| diff --git a/src/ast/ast-value-factory.cc b/src/ast/ast-value-factory.cc
|
| index a2717518395623b08591b835d798d7238556dea7..d110bacecd1c59301948b7b5e939882b007b7537 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;
|
| }
|
| @@ -276,13 +262,6 @@ const AstConsString* AstValueFactory::NewConsString(
|
|
|
|
|
| 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;) {
|
| @@ -295,7 +274,6 @@ void AstValueFactory::Internalize(Isolate* isolate) {
|
| current->Internalize(isolate);
|
| current = next;
|
| }
|
| - isolate_ = isolate;
|
| ResetStrings();
|
| values_ = nullptr;
|
| }
|
|
|