summaryrefslogtreecommitdiff
path: root/deps/v8/src/runtime/runtime-literals.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/runtime/runtime-literals.cc')
-rw-r--r--deps/v8/src/runtime/runtime-literals.cc28
1 files changed, 16 insertions, 12 deletions
diff --git a/deps/v8/src/runtime/runtime-literals.cc b/deps/v8/src/runtime/runtime-literals.cc
index 0c7a28c279..0ffc6e932e 100644
--- a/deps/v8/src/runtime/runtime-literals.cc
+++ b/deps/v8/src/runtime/runtime-literals.cc
@@ -113,9 +113,12 @@ MaybeHandle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk(
copy->map(isolate).instance_descriptors(isolate), isolate);
int limit = copy->map(isolate).NumberOfOwnDescriptors();
for (int i = 0; i < limit; i++) {
- DCHECK_EQ(kField, descriptors->GetDetails(i).location());
- DCHECK_EQ(kData, descriptors->GetDetails(i).kind());
- FieldIndex index = FieldIndex::ForDescriptor(copy->map(isolate), i);
+ PropertyDetails details = descriptors->GetDetails(i);
+ DCHECK_EQ(kField, details.location());
+ DCHECK_EQ(kData, details.kind());
+ FieldIndex index = FieldIndex::ForPropertyIndex(
+ copy->map(isolate), details.field_index(),
+ details.representation());
if (copy->IsUnboxedDoubleField(isolate, index)) continue;
Object raw = copy->RawFastPropertyAt(isolate, index);
if (raw.IsJSObject(isolate)) {
@@ -123,11 +126,9 @@ MaybeHandle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk(
ASSIGN_RETURN_ON_EXCEPTION(
isolate, value, VisitElementOrProperty(copy, value), JSObject);
if (copying) copy->FastPropertyAtPut(index, *value);
- } else if (copying && raw.IsMutableHeapNumber(isolate)) {
- DCHECK(descriptors->GetDetails(i).representation().IsDouble());
- uint64_t double_value = MutableHeapNumber::cast(raw).value_as_bits();
- auto value =
- isolate->factory()->NewMutableHeapNumberFromBits(double_value);
+ } else if (copying && details.representation().IsDouble()) {
+ uint64_t double_value = HeapNumber::cast(raw).value_as_bits();
+ auto value = isolate->factory()->NewHeapNumberFromBits(double_value);
copy->FastPropertyAtPut(index, *value);
}
}
@@ -154,8 +155,10 @@ MaybeHandle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk(
case PACKED_ELEMENTS:
case PACKED_FROZEN_ELEMENTS:
case PACKED_SEALED_ELEMENTS:
+ case PACKED_NONEXTENSIBLE_ELEMENTS:
case HOLEY_FROZEN_ELEMENTS:
case HOLEY_SEALED_ELEMENTS:
+ case HOLEY_NONEXTENSIBLE_ELEMENTS:
case HOLEY_ELEMENTS: {
Handle<FixedArray> elements(FixedArray::cast(copy->elements(isolate)),
isolate);
@@ -652,15 +655,16 @@ RUNTIME_FUNCTION(Runtime_CreateRegExpLiteral) {
DCHECK(maybe_vector->IsFeedbackVector());
vector = Handle<FeedbackVector>::cast(maybe_vector);
}
- Handle<Object> boilerplate;
if (vector.is_null()) {
+ Handle<JSRegExp> new_regexp;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, boilerplate,
+ isolate, new_regexp,
JSRegExp::New(isolate, pattern, JSRegExp::Flags(flags)));
- return *JSRegExp::Copy(Handle<JSRegExp>::cast(boilerplate));
+ return *new_regexp;
}
// Check if boilerplate exists. If not, create it first.
+ Handle<JSRegExp> boilerplate;
Handle<Object> literal_site(vector->Get(literal_slot)->cast<Object>(),
isolate);
if (!HasBoilerplate(literal_site)) {
@@ -673,7 +677,7 @@ RUNTIME_FUNCTION(Runtime_CreateRegExpLiteral) {
}
vector->Set(literal_slot, *boilerplate);
}
- return *JSRegExp::Copy(Handle<JSRegExp>::cast(boilerplate));
+ return *JSRegExp::Copy(boilerplate);
}
} // namespace internal