Commit 7f21bbc1 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[ubsan] Port Foreign and Managed to the new design

Bug: v8:3770
Change-Id: Ie80ce957ff1d2bcd3596491066f6562ce0ad129a
Reviewed-on: https://chromium-review.googlesource.com/c/1380114
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58294}
parent 766ef168
......@@ -8900,7 +8900,7 @@ void Isolate::RemoveMessageListeners(MessageCallback that) {
for (int i = 0; i < listeners->length(); i++) {
if (listeners->get(i)->IsUndefined(isolate)) continue; // skip deleted ones
i::FixedArray listener = i::FixedArray::cast(listeners->get(i));
i::Foreign* callback_obj = i::Foreign::cast(listener->get(0));
i::Foreign callback_obj = i::Foreign::cast(listener->get(0));
if (callback_obj->foreign_address() == FUNCTION_ADDR(that)) {
listeners->set(i, i::ReadOnlyRoots(isolate).undefined_value());
}
......
......@@ -1128,7 +1128,7 @@ class RecordMigratedSlotVisitor : public ObjectVisitor {
// Entries that are skipped for recording.
inline void VisitExternalReference(Code host, RelocInfo* rinfo) final {}
inline void VisitExternalReference(Foreign* host, Address* p) final {}
inline void VisitExternalReference(Foreign host, Address* p) final {}
inline void VisitRuntimeEntry(Code host, RelocInfo* rinfo) final {}
inline void VisitInternalReference(Code host, RelocInfo* rinfo) final {}
......
......@@ -150,7 +150,7 @@ void MessageHandler::ReportMessageNoExceptions(
HandleScope scope(isolate);
if (global_listeners->get(i)->IsUndefined(isolate)) continue;
FixedArray listener = FixedArray::cast(global_listeners->get(i));
Foreign* callback_obj = Foreign::cast(listener->get(0));
Foreign callback_obj = Foreign::cast(listener->get(0));
int32_t message_levels =
static_cast<int32_t>(Smi::ToInt(listener->get(2)));
if (!(message_levels & error_level)) {
......
......@@ -536,7 +536,7 @@ typedef AbstractCode AbstractCodeArgType;
typedef ByteArray ByteArrayArgType;
typedef FixedArray FixedArrayArgType;
typedef FixedDoubleArray FixedDoubleArrayArgType;
typedef Foreign* ForeignArgType;
typedef Foreign ForeignArgType;
typedef HeapObject* HeapObjectArgType;
typedef JSArray JSArrayArgType;
typedef JSAsyncGeneratorObject JSAsyncGeneratorObjectArgType;
......
......@@ -15,7 +15,9 @@
namespace v8 {
namespace internal {
CAST_ACCESSOR(Foreign)
OBJECT_CONSTRUCTORS_IMPL(Foreign, HeapObjectPtr)
CAST_ACCESSOR2(Foreign)
// static
bool Foreign::IsNormalized(Object* value) {
......
......@@ -5,7 +5,7 @@
#ifndef V8_OBJECTS_FOREIGN_H_
#define V8_OBJECTS_FOREIGN_H_
#include "src/objects.h"
#include "src/objects/heap-object.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......@@ -14,14 +14,14 @@ namespace v8 {
namespace internal {
// Foreign describes objects pointing from JavaScript to C structures.
class Foreign : public HeapObject {
class Foreign : public HeapObjectPtr {
public:
// [address]: field containing the address.
inline Address foreign_address();
static inline bool IsNormalized(Object* object);
DECL_CAST(Foreign)
DECL_CAST2(Foreign)
// Dispatched behavior.
DECL_PRINTER(Foreign)
......@@ -43,7 +43,7 @@ class Foreign : public HeapObject {
inline void set_foreign_address(Address value);
DISALLOW_IMPLICIT_CONSTRUCTORS(Foreign);
OBJECT_CONSTRUCTORS(Foreign, HeapObjectPtr);
};
} // namespace internal
......
......@@ -1642,7 +1642,7 @@ Intl::ResolvedLocale Intl::ResolveLocale(
return Intl::ResolvedLocale{canonicalized_locale, icu_locale, extensions};
}
Managed<icu::UnicodeString>* Intl::SetTextToBreakIterator(
Managed<icu::UnicodeString> Intl::SetTextToBreakIterator(
Isolate* isolate, Handle<String> text, icu::BreakIterator* break_iterator) {
icu::UnicodeString* u_text =
(icu::UnicodeString*)(Intl::ToICUUnicodeString(isolate, text).clone());
......
......@@ -248,7 +248,7 @@ class Intl {
const std::set<std::string>& relevant_extension_keys);
// Utility function to set text to BreakIterator.
static Managed<icu::UnicodeString>* SetTextToBreakIterator(
static Managed<icu::UnicodeString> SetTextToBreakIterator(
Isolate* isolate, Handle<String> text,
icu::BreakIterator* break_iterator);
......
......@@ -31,10 +31,10 @@ inline JSV8BreakIterator::Type JSV8BreakIterator::type() const {
}
ACCESSORS2(JSV8BreakIterator, locale, String, kLocaleOffset)
ACCESSORS(JSV8BreakIterator, break_iterator, Managed<icu::BreakIterator>,
kBreakIteratorOffset)
ACCESSORS(JSV8BreakIterator, unicode_string, Managed<icu::UnicodeString>,
kUnicodeStringOffset)
ACCESSORS2(JSV8BreakIterator, break_iterator, Managed<icu::BreakIterator>,
kBreakIteratorOffset)
ACCESSORS2(JSV8BreakIterator, unicode_string, Managed<icu::UnicodeString>,
kUnicodeStringOffset)
ACCESSORS(JSV8BreakIterator, bound_adopt_text, Object, kBoundAdoptTextOffset)
ACCESSORS(JSV8BreakIterator, bound_first, Object, kBoundFirstOffset)
ACCESSORS(JSV8BreakIterator, bound_next, Object, kBoundNextOffset)
......
......@@ -126,7 +126,7 @@ void JSV8BreakIterator::AdoptText(
icu::BreakIterator* break_iterator =
break_iterator_holder->break_iterator()->raw();
CHECK_NOT_NULL(break_iterator);
Managed<icu::UnicodeString>* unicode_string =
Managed<icu::UnicodeString> unicode_string =
Intl::SetTextToBreakIterator(isolate, text, break_iterator);
break_iterator_holder->set_unicode_string(unicode_string);
}
......
......@@ -61,8 +61,8 @@ class JSV8BreakIterator : public JSObject {
DECL_VERIFIER(JSV8BreakIterator)
DECL_ACCESSORS2(locale, String)
DECL_ACCESSORS(break_iterator, Managed<icu::BreakIterator>)
DECL_ACCESSORS(unicode_string, Managed<icu::UnicodeString>)
DECL_ACCESSORS2(break_iterator, Managed<icu::BreakIterator>)
DECL_ACCESSORS2(unicode_string, Managed<icu::UnicodeString>)
DECL_ACCESSORS(bound_adopt_text, Object)
DECL_ACCESSORS(bound_first, Object)
DECL_ACCESSORS(bound_next, Object)
......
......@@ -20,7 +20,7 @@ namespace internal {
OBJECT_CONSTRUCTORS_IMPL(JSCollator, JSObject)
ACCESSORS(JSCollator, icu_collator, Managed<icu::Collator>, kICUCollatorOffset)
ACCESSORS2(JSCollator, icu_collator, Managed<icu::Collator>, kICUCollatorOffset)
ACCESSORS(JSCollator, bound_compare, Object, kBoundCompareOffset);
ACCESSORS2(JSCollator, locale, String, kLocaleOffset)
......
......@@ -57,7 +57,7 @@ class JSCollator : public JSObject {
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_COLLATOR_FIELDS)
#undef JS_COLLATOR_FIELDS
DECL_ACCESSORS(icu_collator, Managed<icu::Collator>)
DECL_ACCESSORS2(icu_collator, Managed<icu::Collator>)
DECL_ACCESSORS(bound_compare, Object);
DECL_ACCESSORS2(locale, String)
......
......@@ -20,9 +20,10 @@ namespace internal {
OBJECT_CONSTRUCTORS_IMPL(JSDateTimeFormat, JSObject)
ACCESSORS(JSDateTimeFormat, icu_locale, Managed<icu::Locale>, kICULocaleOffset);
ACCESSORS(JSDateTimeFormat, icu_simple_date_format,
Managed<icu::SimpleDateFormat>, kICUSimpleDateFormatOffset)
ACCESSORS2(JSDateTimeFormat, icu_locale, Managed<icu::Locale>,
kICULocaleOffset);
ACCESSORS2(JSDateTimeFormat, icu_simple_date_format,
Managed<icu::SimpleDateFormat>, kICUSimpleDateFormatOffset)
ACCESSORS(JSDateTimeFormat, bound_format, Object, kBoundFormatOffset);
SMI_ACCESSORS(JSDateTimeFormat, flags, kFlagsOffset)
......
......@@ -282,7 +282,7 @@ MaybeHandle<JSObject> JSDateTimeFormat::ResolvedOptions(
Handle<Object> resolved_obj;
CHECK_NOT_NULL(date_time_format->icu_locale());
CHECK(!date_time_format->icu_locale().is_null());
CHECK_NOT_NULL(date_time_format->icu_locale()->raw());
UErrorCode status = U_ZERO_ERROR;
char language[ULOC_FULLNAME_CAPACITY];
......
......@@ -104,8 +104,8 @@ class JSDateTimeFormat : public JSObject {
STATIC_ASSERT(Intl::HourCycle::kH23 <= HourCycleBits::kMax);
STATIC_ASSERT(Intl::HourCycle::kH24 <= HourCycleBits::kMax);
DECL_ACCESSORS(icu_locale, Managed<icu::Locale>)
DECL_ACCESSORS(icu_simple_date_format, Managed<icu::SimpleDateFormat>)
DECL_ACCESSORS2(icu_locale, Managed<icu::Locale>)
DECL_ACCESSORS2(icu_simple_date_format, Managed<icu::SimpleDateFormat>)
DECL_ACCESSORS(bound_format, Object)
DECL_INT_ACCESSORS(flags)
......
......@@ -22,8 +22,8 @@ OBJECT_CONSTRUCTORS_IMPL(JSListFormat, JSObject)
// Base list format accessors.
ACCESSORS2(JSListFormat, locale, String, kLocaleOffset)
ACCESSORS(JSListFormat, icu_formatter, Managed<icu::ListFormatter>,
kICUFormatterOffset)
ACCESSORS2(JSListFormat, icu_formatter, Managed<icu::ListFormatter>,
kICUFormatterOffset)
SMI_ACCESSORS(JSListFormat, flags, kFlagsOffset)
inline void JSListFormat::set_style(Style style) {
......
......@@ -58,7 +58,7 @@ class JSListFormat : public JSObject {
// ListFormat accessors.
DECL_ACCESSORS2(locale, String)
DECL_ACCESSORS(icu_formatter, Managed<icu::ListFormatter>)
DECL_ACCESSORS2(icu_formatter, Managed<icu::ListFormatter>)
// Style: identifying the relative time format style used.
//
......
......@@ -21,8 +21,8 @@ namespace internal {
OBJECT_CONSTRUCTORS_IMPL(JSNumberFormat, JSObject)
ACCESSORS2(JSNumberFormat, locale, String, kLocaleOffset)
ACCESSORS(JSNumberFormat, icu_number_format, Managed<icu::NumberFormat>,
kICUNumberFormatOffset)
ACCESSORS2(JSNumberFormat, icu_number_format, Managed<icu::NumberFormat>,
kICUNumberFormatOffset)
ACCESSORS(JSNumberFormat, bound_format, Object, kBoundFormatOffset)
SMI_ACCESSORS(JSNumberFormat, flags, kFlagsOffset)
......
......@@ -123,7 +123,7 @@ class JSNumberFormat : public JSObject {
STATIC_ASSERT(CurrencyDisplay::NAME <= CurrencyDisplayBits::kMax);
DECL_ACCESSORS2(locale, String)
DECL_ACCESSORS(icu_number_format, Managed<icu::NumberFormat>)
DECL_ACCESSORS2(icu_number_format, Managed<icu::NumberFormat>)
DECL_ACCESSORS(bound_format, Object)
DECL_INT_ACCESSORS(flags)
......
......@@ -23,10 +23,10 @@ OBJECT_CONSTRUCTORS_IMPL(JSPluralRules, JSObject)
ACCESSORS2(JSPluralRules, locale, String, kLocaleOffset)
SMI_ACCESSORS(JSPluralRules, flags, kFlagsOffset)
ACCESSORS(JSPluralRules, icu_plural_rules, Managed<icu::PluralRules>,
kICUPluralRulesOffset)
ACCESSORS(JSPluralRules, icu_decimal_format, Managed<icu::DecimalFormat>,
kICUDecimalFormatOffset)
ACCESSORS2(JSPluralRules, icu_plural_rules, Managed<icu::PluralRules>,
kICUPluralRulesOffset)
ACCESSORS2(JSPluralRules, icu_decimal_format, Managed<icu::DecimalFormat>,
kICUDecimalFormatOffset)
inline void JSPluralRules::set_type(Type type) {
DCHECK_LT(type, Type::COUNT);
......
......@@ -82,8 +82,8 @@ class JSPluralRules : public JSObject {
DECL_ACCESSORS2(locale, String)
DECL_INT_ACCESSORS(flags)
DECL_ACCESSORS(icu_plural_rules, Managed<icu::PluralRules>)
DECL_ACCESSORS(icu_decimal_format, Managed<icu::DecimalFormat>)
DECL_ACCESSORS2(icu_plural_rules, Managed<icu::PluralRules>)
DECL_ACCESSORS2(icu_decimal_format, Managed<icu::DecimalFormat>)
OBJECT_CONSTRUCTORS(JSPluralRules, JSObject);
};
......
......@@ -22,8 +22,8 @@ OBJECT_CONSTRUCTORS_IMPL(JSRelativeTimeFormat, JSObject)
// Base relative time format accessors.
ACCESSORS2(JSRelativeTimeFormat, locale, String, kLocaleOffset)
ACCESSORS(JSRelativeTimeFormat, icu_formatter,
Managed<icu::RelativeDateTimeFormatter>, kICUFormatterOffset)
ACCESSORS2(JSRelativeTimeFormat, icu_formatter,
Managed<icu::RelativeDateTimeFormatter>, kICUFormatterOffset)
SMI_ACCESSORS(JSRelativeTimeFormat, flags, kFlagsOffset)
inline void JSRelativeTimeFormat::set_style(Style style) {
......
......@@ -57,7 +57,7 @@ class JSRelativeTimeFormat : public JSObject {
// RelativeTimeFormat accessors.
DECL_ACCESSORS2(locale, String)
DECL_ACCESSORS(icu_formatter, Managed<icu::RelativeDateTimeFormatter>)
DECL_ACCESSORS2(icu_formatter, Managed<icu::RelativeDateTimeFormatter>)
// Style: identifying the relative time format style used.
//
......
......@@ -21,10 +21,10 @@ namespace internal {
OBJECT_CONSTRUCTORS_IMPL(JSSegmentIterator, JSObject)
// Base segment iterator accessors.
ACCESSORS(JSSegmentIterator, icu_break_iterator, Managed<icu::BreakIterator>,
kICUBreakIteratorOffset)
ACCESSORS(JSSegmentIterator, unicode_string, Managed<icu::UnicodeString>,
kUnicodeStringOffset)
ACCESSORS2(JSSegmentIterator, icu_break_iterator, Managed<icu::BreakIterator>,
kICUBreakIteratorOffset)
ACCESSORS2(JSSegmentIterator, unicode_string, Managed<icu::UnicodeString>,
kUnicodeStringOffset)
SMI_ACCESSORS(JSSegmentIterator, flags, kFlagsOffset)
......
......@@ -64,7 +64,7 @@ MaybeHandle<JSSegmentIterator> JSSegmentIterator::Create(
segment_iterator->set_icu_break_iterator(*managed_break_iterator);
// 3. Let iterator.[[SegmentIteratorString]] be string.
Managed<icu::UnicodeString>* unicode_string =
Managed<icu::UnicodeString> unicode_string =
Intl::SetTextToBreakIterator(isolate, text, break_iterator);
segment_iterator->set_unicode_string(unicode_string);
......
......@@ -64,8 +64,8 @@ class JSSegmentIterator : public JSObject {
DECL_CAST2(JSSegmentIterator)
// SegmentIterator accessors.
DECL_ACCESSORS(icu_break_iterator, Managed<icu::BreakIterator>)
DECL_ACCESSORS(unicode_string, Managed<icu::UnicodeString>)
DECL_ACCESSORS2(icu_break_iterator, Managed<icu::BreakIterator>)
DECL_ACCESSORS2(unicode_string, Managed<icu::UnicodeString>)
DECL_PRINTER(JSSegmentIterator)
DECL_VERIFIER(JSSegmentIterator)
......
......@@ -22,8 +22,8 @@ OBJECT_CONSTRUCTORS_IMPL(JSSegmenter, JSObject)
// Base segmenter accessors.
ACCESSORS2(JSSegmenter, locale, String, kLocaleOffset)
ACCESSORS(JSSegmenter, icu_break_iterator, Managed<icu::BreakIterator>,
kICUBreakIteratorOffset)
ACCESSORS2(JSSegmenter, icu_break_iterator, Managed<icu::BreakIterator>,
kICUBreakIteratorOffset)
SMI_ACCESSORS(JSSegmenter, flags, kFlagsOffset)
inline void JSSegmenter::set_line_break_style(LineBreakStyle line_break_style) {
......
......@@ -50,7 +50,7 @@ class JSSegmenter : public JSObject {
// Segmenter accessors.
DECL_ACCESSORS2(locale, String)
DECL_ACCESSORS(icu_break_iterator, Managed<icu::BreakIterator>)
DECL_ACCESSORS2(icu_break_iterator, Managed<icu::BreakIterator>)
// LineBreakStyle: identifying the style used for line break.
//
......
......@@ -48,15 +48,19 @@ void ManagedObjectFinalizer(const v8::WeakCallbackInfo<void>& data);
template <class CppType>
class Managed : public Foreign {
public:
Managed() : Foreign() {}
explicit Managed(Address ptr) : Foreign(ptr) {}
Managed* operator->() { return this; }
// Get a raw pointer to the C++ object.
V8_INLINE CppType* raw() { return GetSharedPtrPtr()->get(); }
// Get a copy of the shared pointer to the C++ object.
V8_INLINE std::shared_ptr<CppType> get() { return *GetSharedPtrPtr(); }
static Managed<CppType>* cast(Object* obj) {
SLOW_DCHECK(obj->IsForeign());
return reinterpret_cast<Managed<CppType>*>(obj);
static Managed cast(Object* obj) { return Managed(obj->ptr()); }
static Managed unchecked_cast(ObjectPtr obj) {
return bit_cast<Managed>(obj);
}
// Allocate a new {CppType} and wrap it in a {Managed<CppType>}.
......
......@@ -27,8 +27,8 @@ CAST_ACCESSOR2(CallableTask)
ACCESSORS2(CallableTask, callable, JSReceiver, kCallableOffset)
ACCESSORS2(CallableTask, context, Context, kContextOffset)
ACCESSORS(CallbackTask, callback, Foreign, kCallbackOffset)
ACCESSORS(CallbackTask, data, Foreign, kDataOffset)
ACCESSORS2(CallbackTask, callback, Foreign, kCallbackOffset)
ACCESSORS2(CallbackTask, data, Foreign, kDataOffset)
} // namespace internal
} // namespace v8
......
......@@ -31,8 +31,8 @@ class Microtask : public StructPtr {
// used by Blink for example.
class CallbackTask : public Microtask {
public:
DECL_ACCESSORS(callback, Foreign)
DECL_ACCESSORS(data, Foreign)
DECL_ACCESSORS2(callback, Foreign)
DECL_ACCESSORS2(data, Foreign)
// Layout description.
#define CALLBACK_TASK_FIELDS(V) \
......
......@@ -733,7 +733,7 @@ void Serializer::ObjectSerializer::VisitEmbeddedPointer(Code host,
bytes_processed_so_far_ += rinfo->target_address_size();
}
void Serializer::ObjectSerializer::VisitExternalReference(Foreign* host,
void Serializer::ObjectSerializer::VisitExternalReference(Foreign host,
Address* p) {
int skip = SkipTo(reinterpret_cast<Address>(p));
Address target = *p;
......
......@@ -325,7 +325,7 @@ class Serializer::ObjectSerializer : public ObjectVisitor {
void VisitPointers(HeapObject* host, MaybeObjectSlot start,
MaybeObjectSlot end) override;
void VisitEmbeddedPointer(Code host, RelocInfo* target) override;
void VisitExternalReference(Foreign* host, Address* p) override;
void VisitExternalReference(Foreign host, Address* p) override;
void VisitExternalReference(Code host, RelocInfo* rinfo) override;
void VisitInternalReference(Code host, RelocInfo* rinfo) override;
void VisitCodeTarget(Code host, RelocInfo* target) override;
......
......@@ -7,6 +7,7 @@
#include "src/globals.h"
#include "src/objects/code.h"
#include "src/objects/foreign.h"
#include "src/objects/slots.h"
namespace v8 {
......@@ -133,7 +134,7 @@ class ObjectVisitor {
virtual void VisitExternalReference(Code host, RelocInfo* rinfo) {}
// Visits an external reference.
virtual void VisitExternalReference(Foreign* host, Address* p) {}
virtual void VisitExternalReference(Foreign host, Address* p) {}
// Visits an (encoded) internal reference.
virtual void VisitInternalReference(Code host, RelocInfo* rinfo) {}
......
......@@ -75,8 +75,8 @@ CAST_ACCESSOR2(AsmWasmData)
}
// WasmModuleObject
ACCESSORS(WasmModuleObject, managed_native_module, Managed<wasm::NativeModule>,
kNativeModuleOffset)
ACCESSORS2(WasmModuleObject, managed_native_module, Managed<wasm::NativeModule>,
kNativeModuleOffset)
ACCESSORS2(WasmModuleObject, export_wrappers, FixedArray, kExportWrappersOffset)
ACCESSORS2(WasmModuleObject, script, Script, kScriptOffset)
ACCESSORS2(WasmModuleObject, weak_instance_list, WeakArrayList,
......@@ -216,8 +216,8 @@ ACCESSORS2(WasmInstanceObject, imported_function_refs, FixedArray,
kImportedFunctionRefsOffset)
OPTIONAL_ACCESSORS2(WasmInstanceObject, indirect_function_table_refs,
FixedArray, kIndirectFunctionTableRefsOffset)
OPTIONAL_ACCESSORS(WasmInstanceObject, managed_native_allocations, Foreign,
kManagedNativeAllocationsOffset)
OPTIONAL_ACCESSORS2(WasmInstanceObject, managed_native_allocations, Foreign,
kManagedNativeAllocationsOffset)
OPTIONAL_ACCESSORS2(WasmInstanceObject, exceptions_table, FixedArray,
kExceptionsTableOffset)
ACCESSORS(WasmInstanceObject, undefined_value, Oddball, kUndefinedValueOffset)
......@@ -269,8 +269,8 @@ ACCESSORS2(WasmDebugInfo, interpreted_functions, FixedArray,
OPTIONAL_ACCESSORS2(WasmDebugInfo, locals_names, FixedArray, kLocalsNamesOffset)
OPTIONAL_ACCESSORS2(WasmDebugInfo, c_wasm_entries, FixedArray,
kCWasmEntriesOffset)
OPTIONAL_ACCESSORS(WasmDebugInfo, c_wasm_entry_map, Managed<wasm::SignatureMap>,
kCWasmEntryMapOffset)
OPTIONAL_ACCESSORS2(WasmDebugInfo, c_wasm_entry_map,
Managed<wasm::SignatureMap>, kCWasmEntryMapOffset)
#undef OPTIONAL_ACCESSORS
#undef READ_PRIMITIVE_FIELD
......@@ -285,8 +285,8 @@ bool WasmMemoryObject::has_maximum_pages() { return maximum_pages() >= 0; }
SMI_ACCESSORS(WasmExceptionTag, index, kIndexOffset)
// AsmWasmData
ACCESSORS(AsmWasmData, managed_native_module, Managed<wasm::NativeModule>,
kManagedNativeModuleOffset)
ACCESSORS2(AsmWasmData, managed_native_module, Managed<wasm::NativeModule>,
kManagedNativeModuleOffset)
ACCESSORS2(AsmWasmData, export_wrappers, FixedArray, kExportWrappersOffset)
ACCESSORS2(AsmWasmData, asm_js_offset_table, ByteArray, kAsmJsOffsetTableOffset)
ACCESSORS(AsmWasmData, uses_bitset, HeapNumber, kUsesBitsetOffset)
......
......@@ -158,7 +158,7 @@ size_t EstimateNativeAllocationsSize(const WasmModule* module) {
WasmInstanceNativeAllocations* GetNativeAllocations(
WasmInstanceObject instance) {
return reinterpret_cast<Managed<WasmInstanceNativeAllocations>*>(
return Managed<WasmInstanceNativeAllocations>::cast(
instance->managed_native_allocations())
->raw();
}
......
......@@ -110,7 +110,7 @@ class WasmModuleObject : public JSObject {
public:
DECL_CAST2(WasmModuleObject)
DECL_ACCESSORS(managed_native_module, Managed<wasm::NativeModule>)
DECL_ACCESSORS2(managed_native_module, Managed<wasm::NativeModule>)
DECL_ACCESSORS2(export_wrappers, FixedArray)
DECL_ACCESSORS2(script, Script)
DECL_ACCESSORS2(weak_instance_list, WeakArrayList)
......@@ -400,7 +400,7 @@ class WasmInstanceObject : public JSObject {
DECL_OPTIONAL_ACCESSORS2(table_object, WasmTableObject)
DECL_ACCESSORS2(imported_function_refs, FixedArray)
DECL_OPTIONAL_ACCESSORS2(indirect_function_table_refs, FixedArray)
DECL_OPTIONAL_ACCESSORS(managed_native_allocations, Foreign)
DECL_OPTIONAL_ACCESSORS2(managed_native_allocations, Foreign)
DECL_OPTIONAL_ACCESSORS2(exceptions_table, FixedArray)
DECL_ACCESSORS(undefined_value, Oddball)
DECL_ACCESSORS(null_value, Oddball)
......@@ -584,7 +584,7 @@ class WasmDebugInfo : public StructPtr {
DECL_ACCESSORS2(interpreted_functions, FixedArray);
DECL_OPTIONAL_ACCESSORS2(locals_names, FixedArray)
DECL_OPTIONAL_ACCESSORS2(c_wasm_entries, FixedArray)
DECL_OPTIONAL_ACCESSORS(c_wasm_entry_map, Managed<wasm::SignatureMap>)
DECL_OPTIONAL_ACCESSORS2(c_wasm_entry_map, Managed<wasm::SignatureMap>)
DECL_CAST2(WasmDebugInfo)
......@@ -710,7 +710,7 @@ class AsmWasmData : public StructPtr {
Handle<FixedArray> export_wrappers, Handle<ByteArray> asm_js_offset_table,
Handle<HeapNumber> uses_bitset);
DECL_ACCESSORS(managed_native_module, Managed<wasm::NativeModule>)
DECL_ACCESSORS2(managed_native_module, Managed<wasm::NativeModule>)
DECL_ACCESSORS2(export_wrappers, FixedArray)
DECL_ACCESSORS2(asm_js_offset_table, ByteArray)
DECL_ACCESSORS(uses_bitset, HeapNumber)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment