Index: src/ast/ast-value-factory.cc |
diff --git a/src/ast/ast-value-factory.cc b/src/ast/ast-value-factory.cc |
index d110bacecd1c59301948b7b5e939882b007b7537..b4fc3dc5a4e86833b312b0b9edb6adf997409afd 100644 |
--- a/src/ast/ast-value-factory.cc |
+++ b/src/ast/ast-value-factory.cc |
@@ -262,6 +262,12 @@ const AstConsString* AstValueFactory::NewConsString( |
void AstValueFactory::Internalize(Isolate* isolate) { |
+ // Create a canonical handle scope if compiling ignition bytecode. This is |
+ // required by the constant array builder to de-duplicate objects without |
+ // dereferencing handles. |
+ std::unique_ptr<CanonicalHandleScope> canonical; |
+ if (FLAG_ignition) canonical.reset(new CanonicalHandleScope(isolate)); |
+ |
// Strings need to be internalized before values, because values refer to |
// strings. |
for (AstString* current = strings_; current != nullptr;) { |