Index: src/ast/ast-value-factory.cc |
diff --git a/src/ast/ast-value-factory.cc b/src/ast/ast-value-factory.cc |
index 63b40d2286a82cbe1ff7a939eaf89b731c3870ff..9191e3b6ffb89d43cbd4739808db780afd86ad4e 100644 |
--- a/src/ast/ast-value-factory.cc |
+++ b/src/ast/ast-value-factory.cc |
@@ -93,9 +93,10 @@ void AstRawString::Internalize(Isolate* isolate) { |
} |
} |
- |
-bool AstRawString::AsArrayIndex(uint32_t* index) const { |
- if (!string_.is_null()) |
+bool AstRawString::AsArrayIndex(uint32_t* index, |
+ HandleDereferenceMode deref_mode) const { |
+ if (deref_mode == HandleDereferenceMode::kHandleDereferenceAllowed && |
+ !string_.is_null()) |
return string_->AsArrayIndex(index); |
if (!is_one_byte_ || literal_bytes_.length() == 0 || |
literal_bytes_.length() > String::kMaxArrayIndexSize) |
@@ -123,11 +124,10 @@ void AstConsString::Internalize(Isolate* isolate) { |
.ToHandleChecked(); |
} |
- |
-bool AstValue::IsPropertyName() const { |
+bool AstValue::IsPropertyName(HandleDereferenceMode deref_mode) const { |
if (type_ == STRING) { |
uint32_t index; |
- return !string_->AsArrayIndex(&index); |
+ return !string_->AsArrayIndex(&index, deref_mode); |
} |
return false; |
} |
@@ -263,6 +263,13 @@ void AstValueFactory::Internalize(Isolate* isolate) { |
// Everything is already internalized. |
return; |
} |
+ |
+ // Create a canonical handle scope if compiling ignition bytecode. This is |
+ // required by the constant array builder to de-duplicate common objects |
+ // without dereferencing handles. |
+ std::unique_ptr<CanonicalHandleScope> canonical; |
+ if (FLAG_ignition) canonical.reset(new CanonicalHandleScope(isolate)); |
+ |
marja
2016/08/08 08:20:13
This code snippet seems to be on a wrong abstracti
rmcilroy
2016/08/08 13:05:56
Moved up to api.cc and compiler-dispatcher-job.cc.
|
// Strings need to be internalized before values, because values refer to |
// strings. |
for (int i = 0; i < strings_.length(); ++i) { |