[turbofan] Serialization of heap numbers

Bug: v8:7790
Change-Id: I9642f37f3dae3f9c07661ddca1a981e223148e49
Reviewed-on: https://chromium-review.googlesource.com/1192842
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55441}
This commit is contained in:
Jaroslav Sevcik 2018-08-28 09:15:03 +02:00 committed by Commit Bot
parent f96053fc4f
commit 8e0feb6819

View File

@ -103,14 +103,24 @@ class HeapNumberData : public HeapObjectData {
public:
HeapNumberData(JSHeapBroker* broker_, Handle<HeapNumber> object_,
HeapObjectType type_)
: HeapObjectData(broker_, object_, type_) {}
: HeapObjectData(broker_, object_, type_), value_(object_->value()) {}
double value() const { return value_; }
private:
double const value_;
};
class MutableHeapNumberData : public HeapObjectData {
public:
MutableHeapNumberData(JSHeapBroker* broker_,
Handle<MutableHeapNumber> object_, HeapObjectType type_)
: HeapObjectData(broker_, object_, type_) {}
: HeapObjectData(broker_, object_, type_), value_(object_->value()) {}
double value() const { return value_; }
private:
double const value_;
};
class ContextData : public HeapObjectData {
@ -1003,8 +1013,6 @@ BIMODAL_ACCESSOR(HeapObject, Map, map)
HANDLE_ACCESSOR_C(HeapObject, bool, IsExternalString)
HANDLE_ACCESSOR_C(HeapObject, bool, IsSeqString)
HANDLE_ACCESSOR_C(HeapNumber, double, value)
HANDLE_ACCESSOR(JSArray, Object, length)
BIMODAL_ACCESSOR_C(JSFunction, bool, has_prototype)
@ -1039,8 +1047,6 @@ HANDLE_ACCESSOR_C(Map, int, GetInObjectPropertiesStartInWords)
HANDLE_ACCESSOR_C(Map, int, NumberOfOwnDescriptors)
HANDLE_ACCESSOR(Map, Object, constructor_or_backpointer)
HANDLE_ACCESSOR_C(MutableHeapNumber, double, value)
#define DEF_NATIVE_CONTEXT_ACCESSOR(type, name) \
BIMODAL_ACCESSOR(NativeContext, type, name)
BROKER_NATIVE_CONTEXT_FIELDS(DEF_NATIVE_CONTEXT_ACCESSOR)
@ -1122,6 +1128,16 @@ double ObjectRef::OddballToNumber() const {
}
}
double HeapNumberRef::value() const {
IF_BROKER_DISABLED_ACCESS_HANDLE_C(HeapNumber, value);
return data()->AsHeapNumber()->value();
}
double MutableHeapNumberRef::value() const {
IF_BROKER_DISABLED_ACCESS_HANDLE_C(MutableHeapNumber, value);
return data()->AsMutableHeapNumber()->value();
}
CellRef ModuleRef::GetCell(int cell_index) {
AllowHandleAllocation handle_allocation;
AllowHandleDereference allow_handle_dereference;