Skip to content

Commit 04cedbb

Browse files
kvakilNo9
authored andcommitted
src: remove unboxed double support completely
After #404, we no longer support unboxed doubles. Let's remove the relevant code.
1 parent 1e111aa commit 04cedbb

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

src/llv8-constants.cc

-9
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,9 @@ void Map::Load() {
133133
kNumberOfOwnDescriptorsMask = (1 << kDescriptorIndexBitCount) - 1;
134134
kNumberOfOwnDescriptorsMask <<= kNumberOfOwnDescriptorsShift;
135135
}
136-
kLayoutDescriptor =
137-
LoadConstant({"class_Map__layout_descriptor__LayoutDescriptor"});
138136
}
139137

140138

141-
bool Map::HasUnboxedDoubleFields() {
142-
// V8 has now disabled unboxed doubles in all supported Node.js branches. Per
143-
// the V8 authors (v8/v8@42409a2e) it seems unlikely this support will ever
144-
// return, so we could probably just remove it entirely.
145-
return false;
146-
}
147-
148139
void JSObject::Load() {
149140
kPropertiesOffset =
150141
LoadConstant("class_JSReceiver__raw_properties_or_hash__Object",

src/llv8-constants.h

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class Map : public Module {
7777
int64_t kInObjectPropertiesStartOffset;
7878
int64_t kInstanceSizeOffset;
7979
int64_t kInstanceTypeOffset;
80-
Constant<int64_t> kLayoutDescriptor;
8180

8281
int64_t kNumberOfOwnDescriptorsMask;
8382
int64_t kNumberOfOwnDescriptorsShift;

src/llv8-inl.h

-14
Original file line numberDiff line numberDiff line change
@@ -406,20 +406,6 @@ inline HeapNumber JSObject::GetDoubleField(int64_t index, Error err) {
406406

407407
// TODO(mmarchini): Explain why index might be lower than zero.
408408
if (index < 0) {
409-
// When unboxed doubles are not allowed, all double fields are stored as
410-
// HeapNumber objects.
411-
if (v8()->map()->HasUnboxedDoubleFields()) {
412-
// TODO(mmarchini): GetInObjectValue call chain should be
413-
// CheckedType-aware instead of relying on Error.
414-
Error get_in_object_value_err;
415-
double result = GetInObjectValue<double>(instance_size, index,
416-
get_in_object_value_err);
417-
if (get_in_object_value_err.Fail()) {
418-
return HeapNumber(v8(), CheckedType<double>());
419-
} else {
420-
return HeapNumber(v8(), CheckedType<double>(result));
421-
}
422-
}
423409
return GetInObjectValue<HeapNumber>(instance_size, index, err);
424410
}
425411
HeapObject extra_properties_obj = Properties(err);

0 commit comments

Comments
 (0)