Skip to content

Commit

Permalink
src: remove unboxed double support completely
Browse files Browse the repository at this point in the history
After #404, we no longer support unboxed doubles. Let's remove the
relevant code.
  • Loading branch information
kvakil authored and No9 committed Sep 24, 2022
1 parent 1e111aa commit 04cedbb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
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

0 comments on commit 04cedbb

Please sign in to comment.