Commit 267b067b authored by Seth Brenith's avatar Seth Brenith Committed by V8 LUCI CQ

[torque] Get rid of @generatePrint annotation

I'm trying to remove annotations and make behavior more consistent. For
@generatePrint, there are two options: either generate printers for
every extern class, or never generate printers for extern classes. This
change implements the option of always generating printers. Classes that
require custom printing can easily hide the generated printer by using
DECL_PRINTER. This causes the generated file
gen/torque-generated/objects-printer.cc to grow to 1600 lines, including
many functions that are never used, but I think the consistency benefit
outweighs a little more compilation time on one file. This change also
removes custom printers in cases where the generated printer includes
all of the same content.

If folks would prefer the option to never generate printers, I'm open to
doing that instead. I like the notion that generating more code could
reduce the friction of adding new classes and thereby encourage people
to define precise types rather than using FixedArrays, but the current
implementation of generated printers is limited, and many printers have
been customized to show the data that matters the most. Unlike verifiers
and body descriptors, there are no correctness or safety concerns with
hand-written printers.

Some bugs showed up once we start generating printers for everything,
and this change fixes them:
- Printers incorrectly included ungettable fields like padding
- Printers called getters which might be hidden by hand-written classes
- The generated getter for Map::instance_type used
  ReadField<InstanceType>, which is not an arithmetic type since it's an
  enum

One more tiny drive-by fix: added a missing newline in the printers for
JSMap and JSSet.

Bug: v8:7793
Change-Id: Ib9e9575fbcb57879935ff18bf4db49fe276d2966
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3172190Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#77152}
parent d5625e35
...@@ -1342,24 +1342,15 @@ void JSDate::JSDatePrint(std::ostream& os) { ...@@ -1342,24 +1342,15 @@ void JSDate::JSDatePrint(std::ostream& os) {
JSObjectPrintBody(os, *this); JSObjectPrintBody(os, *this);
} }
void JSProxy::JSProxyPrint(std::ostream& os) {
PrintHeader(os, "JSProxy");
os << "\n - target: ";
target().ShortPrint(os);
os << "\n - handler: ";
handler().ShortPrint(os);
os << "\n";
}
void JSSet::JSSetPrint(std::ostream& os) { void JSSet::JSSetPrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSSet"); JSObjectPrintHeader(os, *this, "JSSet");
os << " - table: " << Brief(table()); os << "\n - table: " << Brief(table());
JSObjectPrintBody(os, *this); JSObjectPrintBody(os, *this);
} }
void JSMap::JSMapPrint(std::ostream& os) { void JSMap::JSMapPrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSMap"); JSObjectPrintHeader(os, *this, "JSMap");
os << " - table: " << Brief(table()); os << "\n - table: " << Brief(table());
JSObjectPrintBody(os, *this); JSObjectPrintBody(os, *this);
} }
...@@ -1379,18 +1370,6 @@ void JSMapIterator::JSMapIteratorPrint(std::ostream& os) { ...@@ -1379,18 +1370,6 @@ void JSMapIterator::JSMapIteratorPrint(std::ostream& os) {
JSCollectionIteratorPrint(os, "JSMapIterator"); JSCollectionIteratorPrint(os, "JSMapIterator");
} }
void WeakCell::WeakCellPrint(std::ostream& os) {
PrintHeader(os, "WeakCell");
os << "\n - finalization_registry: " << Brief(finalization_registry());
os << "\n - target: " << Brief(target());
os << "\n - holdings: " << Brief(holdings());
os << "\n - prev: " << Brief(prev());
os << "\n - next: " << Brief(next());
os << "\n - unregister_token: " << Brief(unregister_token());
os << "\n - key_list_prev: " << Brief(key_list_prev());
os << "\n - key_list_next: " << Brief(key_list_next());
}
void JSWeakRef::JSWeakRefPrint(std::ostream& os) { void JSWeakRef::JSWeakRefPrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSWeakRef"); JSObjectPrintHeader(os, *this, "JSWeakRef");
os << "\n - target: " << Brief(target()); os << "\n - target: " << Brief(target());
...@@ -1680,67 +1659,6 @@ void Foreign::ForeignPrint(std::ostream& os) { ...@@ -1680,67 +1659,6 @@ void Foreign::ForeignPrint(std::ostream& os) {
os << "\n"; os << "\n";
} }
void CallbackTask::CallbackTaskPrint(std::ostream& os) {
PrintHeader(os, "CallbackTask");
os << "\n - callback: " << Brief(callback());
os << "\n - data: " << Brief(data());
os << "\n";
}
void CallableTask::CallableTaskPrint(std::ostream& os) {
PrintHeader(os, "CallableTask");
os << "\n - context: " << Brief(context());
os << "\n - callable: " << Brief(callable());
os << "\n";
}
void PromiseFulfillReactionJobTask::PromiseFulfillReactionJobTaskPrint(
std::ostream& os) {
PrintHeader(os, "PromiseFulfillReactionJobTask");
os << "\n - argument: " << Brief(argument());
os << "\n - context: " << Brief(context());
os << "\n - handler: " << Brief(handler());
os << "\n - promise_or_capability: " << Brief(promise_or_capability());
os << "\n";
}
void PromiseRejectReactionJobTask::PromiseRejectReactionJobTaskPrint(
std::ostream& os) {
PrintHeader(os, "PromiseRejectReactionJobTask");
os << "\n - argument: " << Brief(argument());
os << "\n - context: " << Brief(context());
os << "\n - handler: " << Brief(handler());
os << "\n - promise_or_capability: " << Brief(promise_or_capability());
os << "\n";
}
void PromiseResolveThenableJobTask::PromiseResolveThenableJobTaskPrint(
std::ostream& os) {
PrintHeader(os, "PromiseResolveThenableJobTask");
os << "\n - context: " << Brief(context());
os << "\n - promise_to_resolve: " << Brief(promise_to_resolve());
os << "\n - then: " << Brief(then());
os << "\n - thenable: " << Brief(thenable());
os << "\n";
}
void PromiseCapability::PromiseCapabilityPrint(std::ostream& os) {
PrintHeader(os, "PromiseCapability");
os << "\n - promise: " << Brief(promise());
os << "\n - resolve: " << Brief(resolve());
os << "\n - reject: " << Brief(reject());
os << "\n";
}
void PromiseReaction::PromiseReactionPrint(std::ostream& os) {
PrintHeader(os, "PromiseReaction");
os << "\n - next: " << Brief(next());
os << "\n - reject_handler: " << Brief(reject_handler());
os << "\n - fulfill_handler: " << Brief(fulfill_handler());
os << "\n - promise_or_capability: " << Brief(promise_or_capability());
os << "\n";
}
void AsyncGeneratorRequest::AsyncGeneratorRequestPrint(std::ostream& os) { void AsyncGeneratorRequest::AsyncGeneratorRequestPrint(std::ostream& os) {
PrintHeader(os, "AsyncGeneratorRequest"); PrintHeader(os, "AsyncGeneratorRequest");
const char* mode = "Invalid!"; const char* mode = "Invalid!";
...@@ -1761,19 +1679,6 @@ void AsyncGeneratorRequest::AsyncGeneratorRequestPrint(std::ostream& os) { ...@@ -1761,19 +1679,6 @@ void AsyncGeneratorRequest::AsyncGeneratorRequestPrint(std::ostream& os) {
os << "\n"; os << "\n";
} }
void SourceTextModuleInfoEntry::SourceTextModuleInfoEntryPrint(
std::ostream& os) {
PrintHeader(os, "SourceTextModuleInfoEntry");
os << "\n - export_name: " << Brief(export_name());
os << "\n - local_name: " << Brief(local_name());
os << "\n - import_name: " << Brief(import_name());
os << "\n - module_request: " << module_request();
os << "\n - cell_index: " << cell_index();
os << "\n - beg_pos: " << beg_pos();
os << "\n - end_pos: " << end_pos();
os << "\n";
}
static void PrintModuleFields(Module module, std::ostream& os) { static void PrintModuleFields(Module module, std::ostream& os) {
os << "\n - exports: " << Brief(module.exports()); os << "\n - exports: " << Brief(module.exports());
os << "\n - status: " << module.status(); os << "\n - status: " << module.status();
...@@ -1804,14 +1709,6 @@ void SourceTextModule::SourceTextModulePrint(std::ostream& os) { ...@@ -1804,14 +1709,6 @@ void SourceTextModule::SourceTextModulePrint(std::ostream& os) {
os << "\n"; os << "\n";
} }
void SyntheticModule::SyntheticModulePrint(std::ostream& os) {
PrintHeader(os, "SyntheticModule");
PrintModuleFields(*this, os);
os << "\n - export_names: " << Brief(export_names());
os << "\n - name: " << Brief(name());
os << "\n";
}
void JSModuleNamespace::JSModuleNamespacePrint(std::ostream& os) { void JSModuleNamespace::JSModuleNamespacePrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSModuleNamespace"); JSObjectPrintHeader(os, *this, "JSModuleNamespace");
os << "\n - module: " << Brief(module()); os << "\n - module: " << Brief(module());
...@@ -1828,13 +1725,6 @@ void PrototypeInfo::PrototypeInfoPrint(std::ostream& os) { ...@@ -1828,13 +1725,6 @@ void PrototypeInfo::PrototypeInfoPrint(std::ostream& os) {
os << "\n"; os << "\n";
} }
void ClassPositions::ClassPositionsPrint(std::ostream& os) {
PrintHeader(os, "ClassPositions");
os << "\n - start position: " << start();
os << "\n - end position: " << end();
os << "\n";
}
void ArrayBoilerplateDescription::ArrayBoilerplateDescriptionPrint( void ArrayBoilerplateDescription::ArrayBoilerplateDescriptionPrint(
std::ostream& os) { std::ostream& os) {
PrintHeader(os, "ArrayBoilerplateDescription"); PrintHeader(os, "ArrayBoilerplateDescription");
...@@ -1843,15 +1733,6 @@ void ArrayBoilerplateDescription::ArrayBoilerplateDescriptionPrint( ...@@ -1843,15 +1733,6 @@ void ArrayBoilerplateDescription::ArrayBoilerplateDescriptionPrint(
os << "\n"; os << "\n";
} }
void RegExpBoilerplateDescription::RegExpBoilerplateDescriptionPrint(
std::ostream& os) {
PrintHeader(os, "RegExpBoilerplateDescription");
os << "\n - data: " << Brief(data());
os << "\n - source: " << Brief(source());
os << "\n - flags: " << flags();
os << "\n";
}
#if V8_ENABLE_WEBASSEMBLY #if V8_ENABLE_WEBASSEMBLY
void AsmWasmData::AsmWasmDataPrint(std::ostream& os) { void AsmWasmData::AsmWasmDataPrint(std::ostream& os) {
PrintHeader(os, "AsmWasmData"); PrintHeader(os, "AsmWasmData");
...@@ -1955,12 +1836,6 @@ void WasmArray::WasmArrayPrint(std::ostream& os) { ...@@ -1955,12 +1836,6 @@ void WasmArray::WasmArrayPrint(std::ostream& os) {
os << "\n"; os << "\n";
} }
void WasmExceptionTag::WasmExceptionTagPrint(std::ostream& os) {
PrintHeader(os, "WasmExceptionTag");
os << "\n - index: " << index();
os << "\n";
}
void WasmInstanceObject::WasmInstanceObjectPrint(std::ostream& os) { void WasmInstanceObject::WasmInstanceObjectPrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "WasmInstanceObject"); JSObjectPrintHeader(os, *this, "WasmInstanceObject");
os << "\n - module_object: " << Brief(module_object()); os << "\n - module_object: " << Brief(module_object());
...@@ -2052,15 +1927,6 @@ void WasmModuleObject::WasmModuleObjectPrint(std::ostream& os) { ...@@ -2052,15 +1927,6 @@ void WasmModuleObject::WasmModuleObjectPrint(std::ostream& os) {
os << "\n"; os << "\n";
} }
void WasmTableObject::WasmTableObjectPrint(std::ostream& os) {
PrintHeader(os, "WasmTableObject");
os << "\n - elements: " << Brief(elements());
os << "\n - maximum_length: " << Brief(maximum_length());
os << "\n - dispatch_tables: " << Brief(dispatch_tables());
os << "\n - raw_type: " << raw_type();
os << "\n";
}
void WasmGlobalObject::WasmGlobalObjectPrint(std::ostream& os) { void WasmGlobalObject::WasmGlobalObjectPrint(std::ostream& os) {
PrintHeader(os, "WasmGlobalObject"); PrintHeader(os, "WasmGlobalObject");
if (type().is_reference()) { if (type().is_reference()) {
...@@ -2076,21 +1942,6 @@ void WasmGlobalObject::WasmGlobalObjectPrint(std::ostream& os) { ...@@ -2076,21 +1942,6 @@ void WasmGlobalObject::WasmGlobalObjectPrint(std::ostream& os) {
os << "\n"; os << "\n";
} }
void WasmMemoryObject::WasmMemoryObjectPrint(std::ostream& os) {
PrintHeader(os, "WasmMemoryObject");
os << "\n - array_buffer: " << Brief(array_buffer());
os << "\n - maximum_pages: " << maximum_pages();
os << "\n - instances: " << Brief(instances());
os << "\n";
}
void WasmTagObject::WasmTagObjectPrint(std::ostream& os) {
PrintHeader(os, "WasmTagObject");
os << "\n - serialized_signature: " << Brief(serialized_signature());
os << "\n - tag: " << Brief(tag());
os << "\n";
}
void WasmIndirectFunctionTable::WasmIndirectFunctionTablePrint( void WasmIndirectFunctionTable::WasmIndirectFunctionTablePrint(
std::ostream& os) { std::ostream& os) {
PrintHeader(os, "WasmIndirectFunctionTable"); PrintHeader(os, "WasmIndirectFunctionTable");
...@@ -2148,13 +1999,6 @@ void StoreHandler::StoreHandlerPrint(std::ostream& os) { ...@@ -2148,13 +1999,6 @@ void StoreHandler::StoreHandlerPrint(std::ostream& os) {
os << "\n"; os << "\n";
} }
void AccessorPair::AccessorPairPrint(std::ostream& os) {
PrintHeader(os, "AccessorPair");
os << "\n - getter: " << Brief(getter());
os << "\n - setter: " << Brief(setter());
os << "\n";
}
void CallHandlerInfo::CallHandlerInfoPrint(std::ostream& os) { void CallHandlerInfo::CallHandlerInfoPrint(std::ostream& os) {
PrintHeader(os, "CallHandlerInfo"); PrintHeader(os, "CallHandlerInfo");
os << "\n - callback: " << Brief(callback()); os << "\n - callback: " << Brief(callback());
...@@ -2438,18 +2282,6 @@ void ScopeInfo::ScopeInfoPrint(std::ostream& os) { ...@@ -2438,18 +2282,6 @@ void ScopeInfo::ScopeInfoPrint(std::ostream& os) {
os << "\n"; os << "\n";
} }
void StackFrameInfo::StackFrameInfoPrint(std::ostream& os) {
PrintHeader(os, "StackFrameInfo");
os << "\n - receiver_or_instance: " << Brief(receiver_or_instance());
os << "\n - function: " << Brief(function());
os << "\n - code_object: " << Brief(TorqueGeneratedClass::code_object());
os << "\n - code_offset_or_source_position: "
<< code_offset_or_source_position();
os << "\n - flags: " << flags();
os << "\n - parameters: " << Brief(parameters());
os << "\n";
}
void PreparseData::PreparseDataPrint(std::ostream& os) { void PreparseData::PreparseDataPrint(std::ostream& os) {
PrintHeader(os, "PreparseData"); PrintHeader(os, "PreparseData");
os << "\n - data_length: " << data_length(); os << "\n - data_length: " << data_length();
...@@ -2466,13 +2298,6 @@ void PreparseData::PreparseDataPrint(std::ostream& os) { ...@@ -2466,13 +2298,6 @@ void PreparseData::PreparseDataPrint(std::ostream& os) {
os << "\n"; os << "\n";
} }
void InterpreterData::InterpreterDataPrint(std::ostream& os) {
PrintHeader(os, "InterpreterData");
os << "\n - bytecode_array: " << Brief(bytecode_array());
os << "\n - interpreter_trampoline: " << Brief(interpreter_trampoline());
os << "\n";
}
template <HeapObjectReferenceType kRefType, typename StorageType> template <HeapObjectReferenceType kRefType, typename StorageType>
void TaggedImpl<kRefType, StorageType>::Print() { void TaggedImpl<kRefType, StorageType>::Print() {
StdoutStream os; StdoutStream os;
......
...@@ -16,7 +16,6 @@ bitfield struct InterceptorInfoFlags extends uint31 { ...@@ -16,7 +16,6 @@ bitfield struct InterceptorInfoFlags extends uint31 {
has_no_side_effect: bool: 1 bit; has_no_side_effect: bool: 1 bit;
} }
@generatePrint
extern class InterceptorInfo extends Struct { extern class InterceptorInfo extends Struct {
getter: NonNullForeign|Zero|Undefined; getter: NonNullForeign|Zero|Undefined;
setter: NonNullForeign|Zero|Undefined; setter: NonNullForeign|Zero|Undefined;
...@@ -29,7 +28,6 @@ extern class InterceptorInfo extends Struct { ...@@ -29,7 +28,6 @@ extern class InterceptorInfo extends Struct {
flags: SmiTagged<InterceptorInfoFlags>; flags: SmiTagged<InterceptorInfoFlags>;
} }
@generatePrint
extern class AccessCheckInfo extends Struct { extern class AccessCheckInfo extends Struct {
callback: Foreign|Zero|Undefined; callback: Foreign|Zero|Undefined;
named_interceptor: InterceptorInfo|Zero|Undefined; named_interceptor: InterceptorInfo|Zero|Undefined;
...@@ -50,7 +48,6 @@ bitfield struct AccessorInfoFlags extends uint31 { ...@@ -50,7 +48,6 @@ bitfield struct AccessorInfoFlags extends uint31 {
initial_attributes: PropertyAttributes: 3 bit; initial_attributes: PropertyAttributes: 3 bit;
} }
@generatePrint
extern class AccessorInfo extends Struct { extern class AccessorInfo extends Struct {
name: Name; name: Name;
flags: SmiTagged<AccessorInfoFlags>; flags: SmiTagged<AccessorInfoFlags>;
......
...@@ -88,10 +88,7 @@ macro NewSloppyArgumentsElements<Iterator: type>( ...@@ -88,10 +88,7 @@ macro NewSloppyArgumentsElements<Iterator: type>(
SloppyArgumentsElements{length, context, arguments, mapped_entries: ...it}; SloppyArgumentsElements{length, context, arguments, mapped_entries: ...it};
} }
@generatePrint extern class AliasedArgumentsEntry extends Struct { aliased_context_slot: Smi; }
extern class AliasedArgumentsEntry extends Struct {
aliased_context_slot: Smi;
}
// TODO(danno): This should be a namespace {} once supported // TODO(danno): This should be a namespace {} once supported
namespace arguments { namespace arguments {
......
...@@ -2,7 +2,4 @@ ...@@ -2,7 +2,4 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
@generatePrint extern class Cell extends HeapObject { value: Object; }
extern class Cell extends HeapObject {
value: Object;
}
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
@generatePrint
extern class BreakPoint extends Struct { extern class BreakPoint extends Struct {
id: Smi; id: Smi;
condition: String; condition: String;
} }
@generatePrint
extern class BreakPointInfo extends Struct { extern class BreakPointInfo extends Struct {
// The position in the source for the break position. // The position in the source for the break position.
source_position: Smi; source_position: Smi;
...@@ -32,7 +30,6 @@ bitfield struct DebuggerHints extends uint31 { ...@@ -32,7 +30,6 @@ bitfield struct DebuggerHints extends uint31 {
debugging_id: int32: 20 bit; debugging_id: int32: 20 bit;
} }
@generatePrint
extern class DebugInfo extends Struct { extern class DebugInfo extends Struct {
shared: SharedFunctionInfo; shared: SharedFunctionInfo;
// Bit field containing various information collected for debugging. // Bit field containing various information collected for debugging.
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
@generatePrint
extern class EnumCache extends Struct { extern class EnumCache extends Struct {
keys: FixedArray; keys: FixedArray;
indices: FixedArray; indices: FixedArray;
......
...@@ -98,7 +98,6 @@ class JSProxy : public TorqueGeneratedJSProxy<JSProxy, JSReceiver> { ...@@ -98,7 +98,6 @@ class JSProxy : public TorqueGeneratedJSProxy<JSProxy, JSReceiver> {
LookupIterator* it); LookupIterator* it);
// Dispatched behavior. // Dispatched behavior.
DECL_PRINTER(JSProxy)
DECL_VERIFIER(JSProxy) DECL_VERIFIER(JSProxy)
static const int kMaxIterationLimit = 100 * 1024; static const int kMaxIterationLimit = 100 * 1024;
......
...@@ -71,7 +71,6 @@ class JSFinalizationRegistry ...@@ -71,7 +71,6 @@ class JSFinalizationRegistry
// Internal object for storing weak references in JSFinalizationRegistry. // Internal object for storing weak references in JSFinalizationRegistry.
class WeakCell : public TorqueGeneratedWeakCell<WeakCell, HeapObject> { class WeakCell : public TorqueGeneratedWeakCell<WeakCell, HeapObject> {
public: public:
DECL_PRINTER(WeakCell)
EXPORT_DECL_VERIFIER(WeakCell) EXPORT_DECL_VERIFIER(WeakCell)
class BodyDescriptor; class BodyDescriptor;
......
...@@ -80,7 +80,6 @@ class RegExpBoilerplateDescription ...@@ -80,7 +80,6 @@ class RegExpBoilerplateDescription
RegExpBoilerplateDescription, Struct> { RegExpBoilerplateDescription, Struct> {
public: public:
// Dispatched behavior. // Dispatched behavior.
DECL_PRINTER(RegExpBoilerplateDescription)
void BriefPrintDetails(std::ostream& os); void BriefPrintDetails(std::ostream& os);
private: private:
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
@generatePrint
@generateBodyDescriptor @generateBodyDescriptor
extern class MegaDomHandler extends HeapObject { extern class MegaDomHandler extends HeapObject {
accessor: MaybeObject; accessor: MaybeObject;
......
...@@ -30,9 +30,6 @@ class Microtask : public TorqueGeneratedMicrotask<Microtask, Struct> { ...@@ -30,9 +30,6 @@ class Microtask : public TorqueGeneratedMicrotask<Microtask, Struct> {
class CallbackTask class CallbackTask
: public TorqueGeneratedCallbackTask<CallbackTask, Microtask> { : public TorqueGeneratedCallbackTask<CallbackTask, Microtask> {
public: public:
// Dispatched behavior.
DECL_PRINTER(CallbackTask)
TQ_OBJECT_CONSTRUCTORS(CallbackTask) TQ_OBJECT_CONSTRUCTORS(CallbackTask)
}; };
...@@ -43,7 +40,6 @@ class CallableTask ...@@ -43,7 +40,6 @@ class CallableTask
: public TorqueGeneratedCallableTask<CallableTask, Microtask> { : public TorqueGeneratedCallableTask<CallableTask, Microtask> {
public: public:
// Dispatched behavior. // Dispatched behavior.
DECL_PRINTER(CallableTask)
DECL_VERIFIER(CallableTask) DECL_VERIFIER(CallableTask)
void BriefPrintDetails(std::ostream& os); void BriefPrintDetails(std::ostream& os);
......
...@@ -646,7 +646,8 @@ class Object : public TaggedImpl<HeapObjectReferenceType::STRONG, Address> { ...@@ -646,7 +646,8 @@ class Object : public TaggedImpl<HeapObjectReferenceType::STRONG, Address> {
bool operator()(const Object a, const Object b) const { return a < b; } bool operator()(const Object a, const Object b) const { return a < b; }
}; };
template <class T, typename std::enable_if<std::is_arithmetic<T>::value, template <class T, typename std::enable_if<std::is_arithmetic<T>::value ||
std::is_enum<T>::value,
int>::type = 0> int>::type = 0>
inline T ReadField(size_t offset) const { inline T ReadField(size_t offset) const {
// Pointer compression causes types larger than kTaggedSize to be unaligned. // Pointer compression causes types larger than kTaggedSize to be unaligned.
...@@ -663,7 +664,8 @@ class Object : public TaggedImpl<HeapObjectReferenceType::STRONG, Address> { ...@@ -663,7 +664,8 @@ class Object : public TaggedImpl<HeapObjectReferenceType::STRONG, Address> {
} }
} }
template <class T, typename std::enable_if<std::is_arithmetic<T>::value, template <class T, typename std::enable_if<std::is_arithmetic<T>::value ||
std::is_enum<T>::value,
int>::type = 0> int>::type = 0>
inline void WriteField(size_t offset, T value) const { inline void WriteField(size_t offset, T value) const {
// Pointer compression causes types larger than kTaggedSize to be unaligned. // Pointer compression causes types larger than kTaggedSize to be unaligned.
......
...@@ -39,9 +39,6 @@ class PromiseFulfillReactionJobTask ...@@ -39,9 +39,6 @@ class PromiseFulfillReactionJobTask
: public TorqueGeneratedPromiseFulfillReactionJobTask< : public TorqueGeneratedPromiseFulfillReactionJobTask<
PromiseFulfillReactionJobTask, PromiseReactionJobTask> { PromiseFulfillReactionJobTask, PromiseReactionJobTask> {
public: public:
// Dispatched behavior.
DECL_PRINTER(PromiseFulfillReactionJobTask)
STATIC_ASSERT(kSize == kSizeOfAllPromiseReactionJobTasks); STATIC_ASSERT(kSize == kSizeOfAllPromiseReactionJobTasks);
TQ_OBJECT_CONSTRUCTORS(PromiseFulfillReactionJobTask) TQ_OBJECT_CONSTRUCTORS(PromiseFulfillReactionJobTask)
...@@ -52,9 +49,6 @@ class PromiseRejectReactionJobTask ...@@ -52,9 +49,6 @@ class PromiseRejectReactionJobTask
: public TorqueGeneratedPromiseRejectReactionJobTask< : public TorqueGeneratedPromiseRejectReactionJobTask<
PromiseRejectReactionJobTask, PromiseReactionJobTask> { PromiseRejectReactionJobTask, PromiseReactionJobTask> {
public: public:
// Dispatched behavior.
DECL_PRINTER(PromiseRejectReactionJobTask)
STATIC_ASSERT(kSize == kSizeOfAllPromiseReactionJobTasks); STATIC_ASSERT(kSize == kSizeOfAllPromiseReactionJobTasks);
TQ_OBJECT_CONSTRUCTORS(PromiseRejectReactionJobTask) TQ_OBJECT_CONSTRUCTORS(PromiseRejectReactionJobTask)
...@@ -65,9 +59,6 @@ class PromiseResolveThenableJobTask ...@@ -65,9 +59,6 @@ class PromiseResolveThenableJobTask
: public TorqueGeneratedPromiseResolveThenableJobTask< : public TorqueGeneratedPromiseResolveThenableJobTask<
PromiseResolveThenableJobTask, Microtask> { PromiseResolveThenableJobTask, Microtask> {
public: public:
// Dispatched behavior.
DECL_PRINTER(PromiseResolveThenableJobTask)
TQ_OBJECT_CONSTRUCTORS(PromiseResolveThenableJobTask) TQ_OBJECT_CONSTRUCTORS(PromiseResolveThenableJobTask)
}; };
...@@ -75,9 +66,6 @@ class PromiseResolveThenableJobTask ...@@ -75,9 +66,6 @@ class PromiseResolveThenableJobTask
class PromiseCapability class PromiseCapability
: public TorqueGeneratedPromiseCapability<PromiseCapability, Struct> { : public TorqueGeneratedPromiseCapability<PromiseCapability, Struct> {
public: public:
// Dispatched behavior.
DECL_PRINTER(PromiseCapability)
TQ_OBJECT_CONSTRUCTORS(PromiseCapability) TQ_OBJECT_CONSTRUCTORS(PromiseCapability)
}; };
...@@ -103,9 +91,6 @@ class PromiseReaction ...@@ -103,9 +91,6 @@ class PromiseReaction
public: public:
enum Type { kFulfill, kReject }; enum Type { kFulfill, kReject };
// Dispatched behavior.
DECL_PRINTER(PromiseReaction)
TQ_OBJECT_CONSTRUCTORS(PromiseReaction) TQ_OBJECT_CONSTRUCTORS(PromiseReaction)
}; };
......
...@@ -16,7 +16,6 @@ bitfield struct PropertyDescriptorObjectFlags extends uint31 { ...@@ -16,7 +16,6 @@ bitfield struct PropertyDescriptorObjectFlags extends uint31 {
has_set: bool: 1 bit; has_set: bool: 1 bit;
} }
@generatePrint
extern class PropertyDescriptorObject extends Struct { extern class PropertyDescriptorObject extends Struct {
flags: SmiTagged<PropertyDescriptorObjectFlags>; flags: SmiTagged<PropertyDescriptorObjectFlags>;
value: JSAny|TheHole; value: JSAny|TheHole;
......
...@@ -146,8 +146,6 @@ class InterpreterData ...@@ -146,8 +146,6 @@ class InterpreterData
public: public:
DECL_ACCESSORS(interpreter_trampoline, Code) DECL_ACCESSORS(interpreter_trampoline, Code)
DECL_PRINTER(InterpreterData)
private: private:
DECL_ACCESSORS(raw_interpreter_trampoline, CodeT) DECL_ACCESSORS(raw_interpreter_trampoline, CodeT)
......
...@@ -283,7 +283,6 @@ class SourceTextModuleInfoEntry ...@@ -283,7 +283,6 @@ class SourceTextModuleInfoEntry
: public TorqueGeneratedSourceTextModuleInfoEntry<SourceTextModuleInfoEntry, : public TorqueGeneratedSourceTextModuleInfoEntry<SourceTextModuleInfoEntry,
Struct> { Struct> {
public: public:
DECL_PRINTER(SourceTextModuleInfoEntry)
DECL_VERIFIER(SourceTextModuleInfoEntry) DECL_VERIFIER(SourceTextModuleInfoEntry)
template <typename IsolateT> template <typename IsolateT>
......
...@@ -47,7 +47,6 @@ extern class SourceTextModule extends Module { ...@@ -47,7 +47,6 @@ extern class SourceTextModule extends Module {
flags: SmiTagged<SourceTextModuleFlags>; flags: SmiTagged<SourceTextModuleFlags>;
} }
@generatePrint
extern class ModuleRequest extends Struct { extern class ModuleRequest extends Struct {
specifier: String; specifier: String;
......
...@@ -44,7 +44,6 @@ class StackFrameInfo ...@@ -44,7 +44,6 @@ class StackFrameInfo
DECL_ACCESSORS(code_object, HeapObject) DECL_ACCESSORS(code_object, HeapObject)
// Dispatched behavior. // Dispatched behavior.
DECL_PRINTER(StackFrameInfo)
DECL_VERIFIER(StackFrameInfo) DECL_VERIFIER(StackFrameInfo)
// Used to signal that the requested field is unknown. // Used to signal that the requested field is unknown.
......
...@@ -69,9 +69,6 @@ class AccessorPair : public TorqueGeneratedAccessorPair<AccessorPair, Struct> { ...@@ -69,9 +69,6 @@ class AccessorPair : public TorqueGeneratedAccessorPair<AccessorPair, Struct> {
inline bool Equals(Object getter_value, Object setter_value); inline bool Equals(Object getter_value, Object setter_value);
// Dispatched behavior.
DECL_PRINTER(AccessorPair)
TQ_OBJECT_CONSTRUCTORS(AccessorPair) TQ_OBJECT_CONSTRUCTORS(AccessorPair)
}; };
...@@ -79,7 +76,6 @@ class ClassPositions ...@@ -79,7 +76,6 @@ class ClassPositions
: public TorqueGeneratedClassPositions<ClassPositions, Struct> { : public TorqueGeneratedClassPositions<ClassPositions, Struct> {
public: public:
// Dispatched behavior. // Dispatched behavior.
DECL_PRINTER(ClassPositions)
void BriefPrintDetails(std::ostream& os); void BriefPrintDetails(std::ostream& os);
TQ_OBJECT_CONSTRUCTORS(ClassPositions) TQ_OBJECT_CONSTRUCTORS(ClassPositions)
......
...@@ -3,11 +3,9 @@ ...@@ -3,11 +3,9 @@
// found in the LICENSE file. // found in the LICENSE file.
@abstract @abstract
@generatePrint
extern class Struct extends HeapObject { extern class Struct extends HeapObject {
} }
@generatePrint
extern class Tuple2 extends Struct { extern class Tuple2 extends Struct {
value1: Object; value1: Object;
value2: Object; value2: Object;
......
...@@ -24,7 +24,6 @@ class SyntheticModule ...@@ -24,7 +24,6 @@ class SyntheticModule
public: public:
NEVER_READ_ONLY_SPACE NEVER_READ_ONLY_SPACE
DECL_VERIFIER(SyntheticModule) DECL_VERIFIER(SyntheticModule)
DECL_PRINTER(SyntheticModule)
// Set module's exported value for the specified export_name to the specified // Set module's exported value for the specified export_name to the specified
// export_value. An error will be thrown if export_name is not one // export_value. An error will be thrown if export_name is not one
......
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
@generatePrint
extern class CachedTemplateObject extends Struct { extern class CachedTemplateObject extends Struct {
slot_id: Smi; slot_id: Smi;
template_object: JSArray; template_object: JSArray;
next: CachedTemplateObject|TheHole; next: CachedTemplateObject|TheHole;
} }
@generatePrint
extern class TemplateObjectDescription extends Struct { extern class TemplateObjectDescription extends Struct {
raw_strings: FixedArray; raw_strings: FixedArray;
cooked_strings: FixedArray; cooked_strings: FixedArray;
......
...@@ -11,7 +11,6 @@ extern class TemplateInfo extends Struct { ...@@ -11,7 +11,6 @@ extern class TemplateInfo extends Struct {
property_accessors: TemplateList|Undefined; property_accessors: TemplateList|Undefined;
} }
@generatePrint
extern class FunctionTemplateRareData extends Struct { extern class FunctionTemplateRareData extends Struct {
// See DECL_RARE_ACCESSORS in FunctionTemplateInfo. // See DECL_RARE_ACCESSORS in FunctionTemplateInfo.
prototype_template: ObjectTemplateInfo|Undefined; prototype_template: ObjectTemplateInfo|Undefined;
......
...@@ -83,7 +83,6 @@ static const char* const FIXED_ARRAY_BASE_TYPE_STRING = "FixedArrayBase"; ...@@ -83,7 +83,6 @@ static const char* const FIXED_ARRAY_BASE_TYPE_STRING = "FixedArrayBase";
static const char* const WEAK_HEAP_OBJECT = "WeakHeapObject"; static const char* const WEAK_HEAP_OBJECT = "WeakHeapObject";
static const char* const STATIC_ASSERT_MACRO_STRING = "StaticAssert"; static const char* const STATIC_ASSERT_MACRO_STRING = "StaticAssert";
static const char* const ANNOTATION_GENERATE_PRINT = "@generatePrint";
static const char* const ANNOTATION_NO_VERIFIER = "@noVerifier"; static const char* const ANNOTATION_NO_VERIFIER = "@noVerifier";
static const char* const ANNOTATION_ABSTRACT = "@abstract"; static const char* const ANNOTATION_ABSTRACT = "@abstract";
static const char* const ANNOTATION_HAS_SAME_INSTANCE_TYPE_AS_PARENT = static const char* const ANNOTATION_HAS_SAME_INSTANCE_TYPE_AS_PARENT =
...@@ -144,21 +143,20 @@ using AbstractTypeFlags = base::Flags<AbstractTypeFlag>; ...@@ -144,21 +143,20 @@ using AbstractTypeFlags = base::Flags<AbstractTypeFlag>;
enum class ClassFlag { enum class ClassFlag {
kNone = 0, kNone = 0,
kExtern = 1 << 0, kExtern = 1 << 0,
kGeneratePrint = 1 << 1, kGenerateVerify = 1 << 1,
kGenerateVerify = 1 << 2, kTransient = 1 << 2,
kTransient = 1 << 3, kAbstract = 1 << 3,
kAbstract = 1 << 4, kIsShape = 1 << 4,
kIsShape = 1 << 5, kHasSameInstanceTypeAsParent = 1 << 5,
kHasSameInstanceTypeAsParent = 1 << 6, kGenerateCppClassDefinitions = 1 << 6,
kGenerateCppClassDefinitions = 1 << 7, kCustomCppClass = 1 << 7,
kCustomCppClass = 1 << 8, kHighestInstanceTypeWithinParent = 1 << 8,
kHighestInstanceTypeWithinParent = 1 << 9, kLowestInstanceTypeWithinParent = 1 << 9,
kLowestInstanceTypeWithinParent = 1 << 10, kUndefinedLayout = 1 << 10,
kUndefinedLayout = 1 << 11, kGenerateBodyDescriptor = 1 << 11,
kGenerateBodyDescriptor = 1 << 12, kExport = 1 << 12,
kExport = 1 << 13, kDoNotGenerateCast = 1 << 13,
kDoNotGenerateCast = 1 << 14, kCustomMap = 1 << 14,
kCustomMap = 1 << 15,
}; };
using ClassFlags = base::Flags<ClassFlag>; using ClassFlags = base::Flags<ClassFlag>;
......
...@@ -4297,6 +4297,14 @@ void GenerateBoundsDCheck(std::ostream& os, const std::string& index, ...@@ -4297,6 +4297,14 @@ void GenerateBoundsDCheck(std::ostream& os, const std::string& index,
} }
os << " DCHECK_LT(" << index << ", " << length_expression << ");\n"; os << " DCHECK_LT(" << index << ", " << length_expression << ");\n";
} }
bool CanGenerateFieldAccessors(const Type* field_type) {
// float64_or_hole should be treated like float64. For now, we don't need it.
// TODO(v8:10391) Generate accessors for external pointers.
return field_type != TypeOracle::GetVoidType() &&
field_type != TypeOracle::GetFloat64OrHoleType() &&
!field_type->IsSubtypeOf(TypeOracle::GetExternalPointerType());
}
} // namespace } // namespace
// TODO(sigurds): Keep in sync with DECL_ACCESSORS and ACCESSORS macro. // TODO(sigurds): Keep in sync with DECL_ACCESSORS and ACCESSORS macro.
...@@ -4305,12 +4313,7 @@ void CppClassGenerator::GenerateFieldAccessors( ...@@ -4305,12 +4313,7 @@ void CppClassGenerator::GenerateFieldAccessors(
const Field& innermost_field = const Field& innermost_field =
struct_fields.empty() ? class_field : *struct_fields.back(); struct_fields.empty() ? class_field : *struct_fields.back();
const Type* field_type = innermost_field.name_and_type.type; const Type* field_type = innermost_field.name_and_type.type;
if (field_type == TypeOracle::GetVoidType()) return; if (!CanGenerateFieldAccessors(field_type)) return;
// float64_or_hole should be treated like float64. For now, we don't need it.
if (field_type == TypeOracle::GetFloat64OrHoleType()) {
return;
}
if (const StructType* struct_type = StructType::DynamicCast(field_type)) { if (const StructType* struct_type = StructType::DynamicCast(field_type)) {
struct_fields.resize(struct_fields.size() + 1); struct_fields.resize(struct_fields.size() + 1);
...@@ -4322,11 +4325,6 @@ void CppClassGenerator::GenerateFieldAccessors( ...@@ -4322,11 +4325,6 @@ void CppClassGenerator::GenerateFieldAccessors(
return; return;
} }
// TODO(v8:10391) Generate accessors for external pointers
if (field_type->IsSubtypeOf(TypeOracle::GetExternalPointerType())) {
return;
}
bool indexed = class_field.index && !class_field.index->optional; bool indexed = class_field.index && !class_field.index->optional;
std::string type_name = GetTypeNameForAccessor(innermost_field); std::string type_name = GetTypeNameForAccessor(innermost_field);
bool can_contain_heap_objects = CanContainHeapObjects(field_type); bool can_contain_heap_objects = CanContainHeapObjects(field_type);
...@@ -4783,43 +4781,50 @@ void GeneratePrintDefinitionsForClass(std::ostream& impl, const ClassType* type, ...@@ -4783,43 +4781,50 @@ void GeneratePrintDefinitionsForClass(std::ostream& impl, const ClassType* type,
std::map<std::string, const AggregateType*> field_names; std::map<std::string, const AggregateType*> field_names;
for (const AggregateType* aggregate_type : hierarchy) { for (const AggregateType* aggregate_type : hierarchy) {
for (const Field& f : aggregate_type->fields()) { for (const Field& f : aggregate_type->fields()) {
if (f.name_and_type.name == "map") continue; if (f.name_and_type.name == "map" || f.index.has_value() ||
if (!f.index.has_value()) { !CanGenerateFieldAccessors(f.name_and_type.type)) {
if (f.name_and_type.type->IsSubtypeOf(TypeOracle::GetSmiType()) || continue;
!f.name_and_type.type->IsSubtypeOf(TypeOracle::GetTaggedType())) { }
impl << " os << \"\\n - " << f.name_and_type.name << ": \" << "; std::string getter = f.name_and_type.name;
if (f.name_and_type.type->StructSupertype()) { if (aggregate_type != type) {
// TODO(turbofan): Print struct fields too. // We must call getters directly on the class that provided them,
impl << "\" <struct field printing still unimplemented>\";\n"; // because a subclass could have hidden them.
} else { getter = aggregate_type->name() + "::TorqueGeneratedClass::" + getter;
impl << "this->" << f.name_and_type.name; }
switch (f.read_synchronization) { if (f.name_and_type.type->IsSubtypeOf(TypeOracle::GetSmiType()) ||
case FieldSynchronization::kNone: !f.name_and_type.type->IsSubtypeOf(TypeOracle::GetTaggedType())) {
impl << "();\n"; impl << " os << \"\\n - " << f.name_and_type.name << ": \" << ";
break; if (f.name_and_type.type->StructSupertype()) {
case FieldSynchronization::kRelaxed: // TODO(turbofan): Print struct fields too.
impl << "(kRelaxedLoad);\n"; impl << "\" <struct field printing still unimplemented>\";\n";
break;
case FieldSynchronization::kAcquireRelease:
impl << "(kAcquireLoad);\n";
break;
}
}
} else { } else {
impl << " os << \"\\n - " << f.name_and_type.name << ": \" << " impl << "this->" << getter;
<< "Brief(this->" << f.name_and_type.name;
switch (f.read_synchronization) { switch (f.read_synchronization) {
case FieldSynchronization::kNone: case FieldSynchronization::kNone:
impl << "());\n"; impl << "();\n";
break; break;
case FieldSynchronization::kRelaxed: case FieldSynchronization::kRelaxed:
impl << "(kRelaxedLoad));\n"; impl << "(kRelaxedLoad);\n";
break; break;
case FieldSynchronization::kAcquireRelease: case FieldSynchronization::kAcquireRelease:
impl << "(kAcquireLoad));\n"; impl << "(kAcquireLoad);\n";
break; break;
} }
} }
} else {
impl << " os << \"\\n - " << f.name_and_type.name << ": \" << "
<< "Brief(this->" << getter;
switch (f.read_synchronization) {
case FieldSynchronization::kNone:
impl << "());\n";
break;
case FieldSynchronization::kRelaxed:
impl << "(kRelaxedLoad));\n";
break;
case FieldSynchronization::kAcquireRelease:
impl << "(kAcquireLoad));\n";
break;
}
} }
} }
} }
...@@ -4842,19 +4847,14 @@ void ImplementationVisitor::GeneratePrintDefinitions( ...@@ -4842,19 +4847,14 @@ void ImplementationVisitor::GeneratePrintDefinitions(
for (const ClassType* type : TypeOracle::GetClasses()) { for (const ClassType* type : TypeOracle::GetClasses()) {
if (!type->ShouldGeneratePrint()) continue; if (!type->ShouldGeneratePrint()) continue;
DCHECK(type->GenerateCppClassDefinitions());
if (type->GenerateCppClassDefinitions()) { const ClassType* super = type->GetSuperClass();
const ClassType* super = type->GetSuperClass(); std::string gen_name = "TorqueGenerated" + type->name();
std::string gen_name = "TorqueGenerated" + type->name(); std::string gen_name_T =
std::string gen_name_T = gen_name + "<" + type->name() + ", " + super->name() + ">";
gen_name + "<" + type->name() + ", " + super->name() + ">"; std::string template_decl = "template <>";
std::string template_decl = "template <>"; GeneratePrintDefinitionsForClass(impl, type, gen_name, gen_name_T,
GeneratePrintDefinitionsForClass(impl, type, gen_name, gen_name_T, template_decl);
template_decl);
} else {
GeneratePrintDefinitionsForClass(impl, type, type->name(), type->name(),
"");
}
} }
} }
......
...@@ -888,7 +888,7 @@ base::Optional<ParseResult> MakeClassDeclaration( ...@@ -888,7 +888,7 @@ base::Optional<ParseResult> MakeClassDeclaration(
ParseResultIterator* child_results) { ParseResultIterator* child_results) {
AnnotationSet annotations( AnnotationSet annotations(
child_results, child_results,
{ANNOTATION_GENERATE_PRINT, ANNOTATION_NO_VERIFIER, ANNOTATION_ABSTRACT, {ANNOTATION_NO_VERIFIER, ANNOTATION_ABSTRACT,
ANNOTATION_HAS_SAME_INSTANCE_TYPE_AS_PARENT, ANNOTATION_HAS_SAME_INSTANCE_TYPE_AS_PARENT,
ANNOTATION_DO_NOT_GENERATE_CPP_CLASS, ANNOTATION_CUSTOM_CPP_CLASS, ANNOTATION_DO_NOT_GENERATE_CPP_CLASS, ANNOTATION_CUSTOM_CPP_CLASS,
ANNOTATION_CUSTOM_MAP, ANNOTATION_GENERATE_BODY_DESCRIPTOR, ANNOTATION_CUSTOM_MAP, ANNOTATION_GENERATE_BODY_DESCRIPTOR,
...@@ -898,8 +898,6 @@ base::Optional<ParseResult> MakeClassDeclaration( ...@@ -898,8 +898,6 @@ base::Optional<ParseResult> MakeClassDeclaration(
{ANNOTATION_RESERVE_BITS_IN_INSTANCE_TYPE, {ANNOTATION_RESERVE_BITS_IN_INSTANCE_TYPE,
ANNOTATION_INSTANCE_TYPE_VALUE}); ANNOTATION_INSTANCE_TYPE_VALUE});
ClassFlags flags = ClassFlag::kNone; ClassFlags flags = ClassFlag::kNone;
bool generate_print = annotations.Contains(ANNOTATION_GENERATE_PRINT);
if (generate_print) flags |= ClassFlag::kGeneratePrint;
bool generate_verify = !annotations.Contains(ANNOTATION_NO_VERIFIER); bool generate_verify = !annotations.Contains(ANNOTATION_NO_VERIFIER);
if (generate_verify) flags |= ClassFlag::kGenerateVerify; if (generate_verify) flags |= ClassFlag::kGenerateVerify;
if (annotations.Contains(ANNOTATION_ABSTRACT)) { if (annotations.Contains(ANNOTATION_ABSTRACT)) {
......
...@@ -319,7 +319,7 @@ const ClassType* TypeVisitor::ComputeType( ...@@ -319,7 +319,7 @@ const ClassType* TypeVisitor::ComputeType(
Error("non-external classes must have defined layouts"); Error("non-external classes must have defined layouts");
} }
} }
flags = flags | ClassFlag::kGeneratePrint | ClassFlag::kGenerateVerify; flags = flags | ClassFlag::kGenerateVerify;
} }
if (!(flags & ClassFlag::kExtern) && if (!(flags & ClassFlag::kExtern) &&
(flags & ClassFlag::kHasSameInstanceTypeAsParent)) { (flags & ClassFlag::kHasSameInstanceTypeAsParent)) {
......
...@@ -670,8 +670,8 @@ class ClassType final : public AggregateType { ...@@ -670,8 +670,8 @@ class ClassType final : public AggregateType {
std::string GetGeneratedTNodeTypeNameImpl() const override; std::string GetGeneratedTNodeTypeNameImpl() const override;
bool IsExtern() const { return flags_ & ClassFlag::kExtern; } bool IsExtern() const { return flags_ & ClassFlag::kExtern; }
bool ShouldGeneratePrint() const { bool ShouldGeneratePrint() const {
return !IsExtern() || return !IsExtern() || (GenerateCppClassDefinitions() && !IsAbstract() &&
((flags_ & ClassFlag::kGeneratePrint) && !HasUndefinedLayout()); !HasUndefinedLayout());
} }
bool ShouldGenerateVerify() const { bool ShouldGenerateVerify() const {
return !IsExtern() || ((flags_ & ClassFlag::kGenerateVerify) && return !IsExtern() || ((flags_ & ClassFlag::kGenerateVerify) &&
......
...@@ -182,9 +182,6 @@ class WasmModuleObject ...@@ -182,9 +182,6 @@ class WasmModuleObject
class WasmTableObject class WasmTableObject
: public TorqueGeneratedWasmTableObject<WasmTableObject, JSObject> { : public TorqueGeneratedWasmTableObject<WasmTableObject, JSObject> {
public: public:
// Dispatched behavior.
DECL_PRINTER(WasmTableObject)
inline wasm::ValueType type(); inline wasm::ValueType type();
V8_EXPORT_PRIVATE static int Grow(Isolate* isolate, V8_EXPORT_PRIVATE static int Grow(Isolate* isolate,
...@@ -267,9 +264,6 @@ class WasmMemoryObject ...@@ -267,9 +264,6 @@ class WasmMemoryObject
public: public:
DECL_OPTIONAL_ACCESSORS(instances, WeakArrayList) DECL_OPTIONAL_ACCESSORS(instances, WeakArrayList)
// Dispatched behavior.
DECL_PRINTER(WasmMemoryObject)
// Add an instance to the internal (weak) list. // Add an instance to the internal (weak) list.
V8_EXPORT_PRIVATE static void AddInstance(Isolate* isolate, V8_EXPORT_PRIVATE static void AddInstance(Isolate* isolate,
Handle<WasmMemoryObject> memory, Handle<WasmMemoryObject> memory,
...@@ -554,9 +548,6 @@ class V8_EXPORT_PRIVATE WasmInstanceObject : public JSObject { ...@@ -554,9 +548,6 @@ class V8_EXPORT_PRIVATE WasmInstanceObject : public JSObject {
class WasmTagObject class WasmTagObject
: public TorqueGeneratedWasmTagObject<WasmTagObject, JSObject> { : public TorqueGeneratedWasmTagObject<WasmTagObject, JSObject> {
public: public:
// Dispatched behavior.
DECL_PRINTER(WasmTagObject)
// Checks whether the given {sig} has the same parameter types as the // Checks whether the given {sig} has the same parameter types as the
// serialized signature stored within this tag object. // serialized signature stored within this tag object.
bool MatchesSignature(const wasm::FunctionSig* sig); bool MatchesSignature(const wasm::FunctionSig* sig);
...@@ -841,8 +832,6 @@ class WasmExceptionTag ...@@ -841,8 +832,6 @@ class WasmExceptionTag
V8_EXPORT_PRIVATE static Handle<WasmExceptionTag> New(Isolate* isolate, V8_EXPORT_PRIVATE static Handle<WasmExceptionTag> New(Isolate* isolate,
int index); int index);
DECL_PRINTER(WasmExceptionTag)
TQ_OBJECT_CONSTRUCTORS(WasmExceptionTag) TQ_OBJECT_CONSTRUCTORS(WasmExceptionTag)
}; };
......
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