Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: remove unboxed double support completely #416

Merged
merged 1 commit into from
Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/llv8-constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,9 @@ void Map::Load() {
kNumberOfOwnDescriptorsMask = (1 << kDescriptorIndexBitCount) - 1;
kNumberOfOwnDescriptorsMask <<= kNumberOfOwnDescriptorsShift;
}
kLayoutDescriptor =
LoadConstant({"class_Map__layout_descriptor__LayoutDescriptor"});
}


bool Map::HasUnboxedDoubleFields() {
// V8 has now disabled unboxed doubles in all supported Node.js branches. Per
// the V8 authors (v8/v8@42409a2e) it seems unlikely this support will ever
// return, so we could probably just remove it entirely.
return false;
}

void JSObject::Load() {
kPropertiesOffset =
LoadConstant("class_JSReceiver__raw_properties_or_hash__Object",
Expand Down
1 change: 0 additions & 1 deletion src/llv8-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class Map : public Module {
int64_t kInObjectPropertiesStartOffset;
int64_t kInstanceSizeOffset;
int64_t kInstanceTypeOffset;
Constant<int64_t> kLayoutDescriptor;

int64_t kNumberOfOwnDescriptorsMask;
int64_t kNumberOfOwnDescriptorsShift;
Expand Down
14 changes: 0 additions & 14 deletions src/llv8-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,20 +406,6 @@ inline HeapNumber JSObject::GetDoubleField(int64_t index, Error err) {

// TODO(mmarchini): Explain why index might be lower than zero.
if (index < 0) {
// When unboxed doubles are not allowed, all double fields are stored as
// HeapNumber objects.
if (v8()->map()->HasUnboxedDoubleFields()) {
// TODO(mmarchini): GetInObjectValue call chain should be
// CheckedType-aware instead of relying on Error.
Error get_in_object_value_err;
double result = GetInObjectValue<double>(instance_size, index,
get_in_object_value_err);
if (get_in_object_value_err.Fail()) {
return HeapNumber(v8(), CheckedType<double>());
} else {
return HeapNumber(v8(), CheckedType<double>(result));
}
}
return GetInObjectValue<HeapNumber>(instance_size, index, err);
}
HeapObject extra_properties_obj = Properties(err);
Expand Down