Commit f6f31d15 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[torque] Rename ...from-dsl... to ...tq...

This CL introduces the new suffix '-tq' for Torque generated files,
and replaces the infix 'FromDSL' in type names with a prefix
'TorqueGenerated'.

Change-Id: I1e90460cc0c666da6cf5017e8b3cb7c39c6ac668
Bug: v8:7793
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1609798
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61490}
parent 8dc7f249
......@@ -1046,16 +1046,16 @@ action("run_torque") {
sources = torque_files
outputs = [
"$target_gen_dir/torque-generated/builtin-definitions-from-dsl.h",
"$target_gen_dir/torque-generated/class-definitions-from-dsl.h",
"$target_gen_dir/torque-generated/class-verifiers-from-dsl.cc",
"$target_gen_dir/torque-generated/class-verifiers-from-dsl.h",
"$target_gen_dir/torque-generated/objects-printer-from-dsl.cc",
"$target_gen_dir/torque-generated/builtin-definitions-tq.h",
"$target_gen_dir/torque-generated/field-offsets-tq.h",
"$target_gen_dir/torque-generated/class-verifiers-tq.cc",
"$target_gen_dir/torque-generated/class-verifiers-tq.h",
"$target_gen_dir/torque-generated/objects-printer-tq.cc",
]
foreach(namespace, torque_namespaces) {
outputs += [
"$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.cc",
"$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.h",
"$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.cc",
"$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.h",
]
}
......@@ -1095,8 +1095,8 @@ v8_source_set("torque_generated_initializers") {
sources = []
foreach(namespace, torque_namespaces) {
sources += [
"$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.cc",
"$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.h",
"$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.cc",
"$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.h",
]
}
......@@ -1116,9 +1116,9 @@ v8_source_set("torque_generated_definitions") {
]
sources = [
"$target_gen_dir/torque-generated/class-verifiers-from-dsl.cc",
"$target_gen_dir/torque-generated/class-verifiers-from-dsl.h",
"$target_gen_dir/torque-generated/objects-printer-from-dsl.cc",
"$target_gen_dir/torque-generated/class-verifiers-tq.cc",
"$target_gen_dir/torque-generated/class-verifiers-tq.h",
"$target_gen_dir/torque-generated/objects-printer-tq.cc",
]
configs = [ ":internal_config" ]
......
......@@ -112,7 +112,7 @@ Node* ArgumentsBuiltinsAssembler::EmitFastNewRestParameter(Node* context,
ParameterMode mode = OptimalParameterMode();
Node* zero = IntPtrOrSmiConstant(0, mode);
ArgumentsBuiltinsFromDSLAssembler::ArgumentsInfo info =
TorqueGeneratedArgumentsBuiltinsAssembler::ArgumentsInfo info =
GetArgumentsFrameAndCount(CAST(context),
UncheckedCast<JSFunction>(function));
......@@ -167,7 +167,7 @@ Node* ArgumentsBuiltinsAssembler::EmitFastNewStrictArguments(Node* context,
ParameterMode mode = OptimalParameterMode();
Node* zero = IntPtrOrSmiConstant(0, mode);
ArgumentsBuiltinsFromDSLAssembler::ArgumentsInfo info =
TorqueGeneratedArgumentsBuiltinsAssembler::ArgumentsInfo info =
GetArgumentsFrameAndCount(CAST(context),
UncheckedCast<JSFunction>(function));
......@@ -216,7 +216,7 @@ Node* ArgumentsBuiltinsAssembler::EmitFastNewSloppyArguments(Node* context,
Label done(this, &result), empty(this), no_parameters(this),
runtime(this, Label::kDeferred);
ArgumentsBuiltinsFromDSLAssembler::ArgumentsInfo info =
TorqueGeneratedArgumentsBuiltinsAssembler::ArgumentsInfo info =
GetArgumentsFrameAndCount(CAST(context),
UncheckedCast<JSFunction>(function));
......
......@@ -6,7 +6,7 @@
#define V8_BUILTINS_BUILTINS_ARGUMENTS_GEN_H_
#include "src/code-stub-assembler.h"
#include "torque-generated/builtins-arguments-from-dsl-gen.h"
#include "torque-generated/builtins-arguments-gen-tq.h"
namespace v8 {
namespace internal {
......@@ -15,11 +15,13 @@ typedef compiler::Node Node;
typedef compiler::CodeAssemblerState CodeAssemblerState;
typedef compiler::CodeAssemblerLabel CodeAssemblerLabel;
class ArgumentsBuiltinsAssembler : public CodeStubAssembler,
public ArgumentsBuiltinsFromDSLAssembler {
class ArgumentsBuiltinsAssembler
: public CodeStubAssembler,
public TorqueGeneratedArgumentsBuiltinsAssembler {
public:
explicit ArgumentsBuiltinsAssembler(CodeAssemblerState* state)
: CodeStubAssembler(state), ArgumentsBuiltinsFromDSLAssembler(state) {}
: CodeStubAssembler(state),
TorqueGeneratedArgumentsBuiltinsAssembler(state) {}
Node* EmitFastNewStrictArguments(Node* context, Node* function);
Node* EmitFastNewSloppyArguments(Node* context, Node* function);
......
......@@ -15,13 +15,13 @@
#include "src/objects/allocation-site-inl.h"
#include "src/objects/arguments-inl.h"
#include "src/objects/property-cell.h"
#include "torque-generated/builtins-typed-array-createtypedarray-from-dsl-gen.h"
#include "torque-generated/builtins-typed-array-createtypedarray-gen-tq.h"
namespace v8 {
namespace internal {
using Node = compiler::Node;
using IteratorRecord = IteratorBuiltinsFromDSLAssembler::IteratorRecord;
using IteratorRecord = TorqueGeneratedIteratorBuiltinsAssembler::IteratorRecord;
ArrayBuiltinsAssembler::ArrayBuiltinsAssembler(
compiler::CodeAssemblerState* state)
......@@ -37,7 +37,8 @@ ArrayBuiltinsAssembler::ArrayBuiltinsAssembler(
TNode<Smi> length = CAST(len_);
const char* method_name = "%TypedArray%.prototype.map";
TypedArrayCreatetypedarrayBuiltinsFromDSLAssembler typedarray_asm(state());
TorqueGeneratedTypedArrayCreatetypedarrayBuiltinsAssembler typedarray_asm(
state());
TNode<JSTypedArray> a = typedarray_asm.TypedArraySpeciesCreateByLength(
context(), method_name, original_array, length);
// In the Spec and our current implementation, the length check is already
......
......@@ -13,8 +13,8 @@
#include "src/objects/hash-table-inl.h"
#include "src/objects/js-collection.h"
#include "src/objects/ordered-hash-table.h"
#include "torque-generated/builtins-base-from-dsl-gen.h"
#include "torque-generated/builtins-collections-from-dsl-gen.h"
#include "torque-generated/builtins-base-gen-tq.h"
#include "torque-generated/builtins-collections-gen-tq.h"
namespace v8 {
namespace internal {
......@@ -25,11 +25,13 @@ using TNode = compiler::TNode<T>;
template <class T>
using TVariable = compiler::TypedCodeAssemblerVariable<T>;
class BaseCollectionsAssembler : public CodeStubAssembler,
public CollectionsBuiltinsFromDSLAssembler {
class BaseCollectionsAssembler
: public CodeStubAssembler,
public TorqueGeneratedCollectionsBuiltinsAssembler {
public:
explicit BaseCollectionsAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state), CollectionsBuiltinsFromDSLAssembler(state) {}
: CodeStubAssembler(state),
TorqueGeneratedCollectionsBuiltinsAssembler(state) {}
virtual ~BaseCollectionsAssembler() = default;
......@@ -158,7 +160,7 @@ void BaseCollectionsAssembler::AddConstructorEntry(
var_exception);
CSA_ASSERT(this, Word32BinaryNot(IsTheHole(key_value)));
if (variant == kMap || variant == kWeakMap) {
BaseBuiltinsFromDSLAssembler::KeyValuePair pair =
TorqueGeneratedBaseBuiltinsAssembler::KeyValuePair pair =
if_may_have_side_effects != nullptr
? LoadKeyValuePairNoSideEffects(context, key_value,
if_may_have_side_effects)
......
......@@ -8,7 +8,7 @@
#include "builtins-generated/bytecodes-builtins-list.h"
// include generated header
#include "torque-generated/builtin-definitions-from-dsl.h"
#include "torque-generated/builtin-definitions-tq.h"
namespace v8 {
namespace internal {
......@@ -1339,10 +1339,10 @@ namespace internal {
CPP(StringPrototypeToUpperCase)
#endif // V8_INTL_SUPPORT
#define BUILTIN_LIST(CPP, API, TFJ, TFC, TFS, TFH, BCH, ASM) \
BUILTIN_LIST_BASE(CPP, API, TFJ, TFC, TFS, TFH, ASM) \
BUILTIN_LIST_FROM_DSL(CPP, API, TFJ, TFC, TFS, TFH, ASM) \
BUILTIN_LIST_INTL(CPP, TFJ, TFS) \
#define BUILTIN_LIST(CPP, API, TFJ, TFC, TFS, TFH, BCH, ASM) \
BUILTIN_LIST_BASE(CPP, API, TFJ, TFC, TFS, TFH, ASM) \
BUILTIN_LIST_FROM_TORQUE(CPP, API, TFJ, TFC, TFS, TFH, ASM) \
BUILTIN_LIST_INTL(CPP, TFJ, TFS) \
BUILTIN_LIST_BYTECODE_HANDLERS(BCH)
// The exception thrown in the following builtins are caught
......
......@@ -11,12 +11,12 @@
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/heap/factory-inl.h"
#include "torque-generated/builtins-base-from-dsl-gen.h"
#include "torque-generated/builtins-base-gen-tq.h"
namespace v8 {
namespace internal {
typedef IteratorBuiltinsFromDSLAssembler::IteratorRecord IteratorRecord;
typedef TorqueGeneratedIteratorBuiltinsAssembler::IteratorRecord IteratorRecord;
using compiler::Node;
......
......@@ -6,19 +6,21 @@
#define V8_BUILTINS_BUILTINS_ITERATOR_GEN_H_
#include "src/code-stub-assembler.h"
#include "torque-generated/builtins-base-from-dsl-gen.h"
#include "torque-generated/builtins-iterator-from-dsl-gen.h"
#include "torque-generated/builtins-base-gen-tq.h"
#include "torque-generated/builtins-iterator-gen-tq.h"
namespace v8 {
namespace internal {
using compiler::Node;
class IteratorBuiltinsAssembler : public CodeStubAssembler,
public IteratorBuiltinsFromDSLAssembler {
class IteratorBuiltinsAssembler
: public CodeStubAssembler,
public TorqueGeneratedIteratorBuiltinsAssembler {
public:
explicit IteratorBuiltinsAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state), IteratorBuiltinsFromDSLAssembler(state) {}
: CodeStubAssembler(state),
TorqueGeneratedIteratorBuiltinsAssembler(state) {}
// Returns object[Symbol.iterator].
TNode<Object> GetIteratorMethod(Node* context, Node* object);
......
......@@ -7,8 +7,8 @@
#include "src/code-stub-assembler.h"
#include "src/objects/promise.h"
#include "torque-generated/builtins-base-from-dsl-gen.h"
#include "torque-generated/builtins-iterator-from-dsl-gen.h"
#include "torque-generated/builtins-base-gen-tq.h"
#include "torque-generated/builtins-iterator-gen-tq.h"
namespace v8 {
namespace internal {
......@@ -140,7 +140,7 @@ class V8_EXPORT_PRIVATE PromiseBuiltinsAssembler : public CodeStubAssembler {
Node* PerformPromiseAll(
Node* context, Node* constructor, Node* capability,
const IteratorBuiltinsFromDSLAssembler::IteratorRecord& record,
const TorqueGeneratedIteratorBuiltinsAssembler::IteratorRecord& record,
const PromiseAllResolvingElementFunction& create_resolve_element_function,
const PromiseAllResolvingElementFunction& create_reject_element_function,
Label* if_exception, Variable* var_exception);
......
......@@ -7,7 +7,7 @@
#include "src/code-stub-assembler.h"
#include "src/objects/js-proxy.h"
#include "torque-generated/builtins-proxy-from-dsl-gen.h"
#include "torque-generated/builtins-proxy-gen-tq.h"
namespace v8 {
namespace internal {
......
......@@ -10,7 +10,7 @@
#include "src/builtins/growable-fixed-array-gen.h"
#include "src/handles-inl.h"
#include "src/heap/factory-inl.h"
#include "torque-generated/builtins-typed-array-createtypedarray-from-dsl-gen.h"
#include "torque-generated/builtins-typed-array-createtypedarray-gen-tq.h"
namespace v8 {
namespace internal {
......@@ -269,7 +269,7 @@ TNode<IntPtrT> TypedArrayBuiltinsAssembler::GetTypedArrayElementSize(
return element_size.value();
}
TypedArrayBuiltinsFromDSLAssembler::TypedArrayElementsInfo
TorqueGeneratedTypedArrayBuiltinsAssembler::TypedArrayElementsInfo
TypedArrayBuiltinsAssembler::GetTypedArrayElementsInfo(
TNode<JSTypedArray> typed_array) {
TNode<Int32T> elements_kind = LoadElementsKind(typed_array);
......@@ -287,7 +287,7 @@ TypedArrayBuiltinsAssembler::GetTypedArrayElementsInfo(
var_map = HeapConstant(map);
});
return TypedArrayBuiltinsFromDSLAssembler::TypedArrayElementsInfo{
return TorqueGeneratedTypedArrayBuiltinsAssembler::TypedArrayElementsInfo{
var_size_log2.value(), var_map.value(), elements_kind};
}
......
......@@ -6,7 +6,7 @@
#define V8_BUILTINS_BUILTINS_TYPED_ARRAY_GEN_H_
#include "src/code-stub-assembler.h"
#include "torque-generated/builtins-typed-array-from-dsl-gen.h"
#include "torque-generated/builtins-typed-array-gen-tq.h"
namespace v8 {
namespace internal {
......@@ -14,7 +14,7 @@ namespace internal {
class TypedArrayBuiltinsAssembler : public CodeStubAssembler {
public:
using ElementsInfo =
TypedArrayBuiltinsFromDSLAssembler::TypedArrayElementsInfo;
TorqueGeneratedTypedArrayBuiltinsAssembler::TypedArrayElementsInfo;
explicit TypedArrayBuiltinsAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}
......
......@@ -29,7 +29,8 @@ template <class T>
using SloppyTNode = compiler::SloppyTNode<T>;
CodeStubAssembler::CodeStubAssembler(compiler::CodeAssemblerState* state)
: compiler::CodeAssembler(state), BaseBuiltinsFromDSLAssembler(state) {
: compiler::CodeAssembler(state),
TorqueGeneratedBaseBuiltinsAssembler(state) {
if (DEBUG_BOOL && FLAG_csa_trap_on_node != nullptr) {
HandleBreakOnNode();
}
......@@ -13645,12 +13646,14 @@ Node* CodeStubAssembler::CheckEnumCache(Node* receiver, Label* if_empty,
}
TNode<Object> CodeStubAssembler::GetArgumentValue(
BaseBuiltinsFromDSLAssembler::Arguments args, TNode<IntPtrT> index) {
TorqueGeneratedBaseBuiltinsAssembler::Arguments args,
TNode<IntPtrT> index) {
return CodeStubArguments(this, args).GetOptionalArgumentValue(index);
}
BaseBuiltinsFromDSLAssembler::Arguments CodeStubAssembler::GetFrameArguments(
TNode<RawPtrT> frame, TNode<IntPtrT> argc) {
TorqueGeneratedBaseBuiltinsAssembler::Arguments
CodeStubAssembler::GetFrameArguments(TNode<RawPtrT> frame,
TNode<IntPtrT> argc) {
return CodeStubArguments(this, argc, frame, INTPTR_PARAMETERS)
.GetTorqueArguments();
}
......
......@@ -20,7 +20,7 @@
#include "src/objects/smi.h"
#include "src/roots.h"
#include "torque-generated/builtins-base-from-dsl-gen.h"
#include "torque-generated/builtins-base-gen-tq.h"
namespace v8 {
namespace internal {
......@@ -205,7 +205,7 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
// from a compiler directory OWNER).
class V8_EXPORT_PRIVATE CodeStubAssembler
: public compiler::CodeAssembler,
public BaseBuiltinsFromDSLAssembler {
public TorqueGeneratedBaseBuiltinsAssembler {
public:
using Node = compiler::Node;
template <class T>
......@@ -3278,10 +3278,11 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
Label* if_fast, Label* if_slow);
Node* CheckEnumCache(Node* receiver, Label* if_empty, Label* if_runtime);
TNode<Object> GetArgumentValue(BaseBuiltinsFromDSLAssembler::Arguments args,
TNode<IntPtrT> index);
TNode<Object> GetArgumentValue(
TorqueGeneratedBaseBuiltinsAssembler::Arguments args,
TNode<IntPtrT> index);
BaseBuiltinsFromDSLAssembler::Arguments GetFrameArguments(
TorqueGeneratedBaseBuiltinsAssembler::Arguments GetFrameArguments(
TNode<RawPtrT> frame, TNode<IntPtrT> argc);
// Support for printf-style debugging
......@@ -3586,8 +3587,9 @@ class V8_EXPORT_PRIVATE CodeStubArguments {
// Used by Torque to construct arguments based on a Torque-defined
// struct of values.
CodeStubArguments(CodeStubAssembler* assembler,
BaseBuiltinsFromDSLAssembler::Arguments torque_arguments)
CodeStubArguments(
CodeStubAssembler* assembler,
TorqueGeneratedBaseBuiltinsAssembler::Arguments torque_arguments)
: assembler_(assembler),
argc_mode_(CodeStubAssembler::INTPTR_PARAMETERS),
receiver_mode_(ReceiverMode::kHasReceiver),
......@@ -3624,9 +3626,9 @@ class V8_EXPORT_PRIVATE CodeStubArguments {
return argc_;
}
BaseBuiltinsFromDSLAssembler::Arguments GetTorqueArguments() const {
TorqueGeneratedBaseBuiltinsAssembler::Arguments GetTorqueArguments() const {
DCHECK_EQ(argc_mode_, CodeStubAssembler::INTPTR_PARAMETERS);
return BaseBuiltinsFromDSLAssembler::Arguments{
return TorqueGeneratedBaseBuiltinsAssembler::Arguments{
assembler_->UncheckedCast<RawPtrT>(fp_), base_,
assembler_->UncheckedCast<IntPtrT>(argc_)};
}
......
......@@ -7,7 +7,7 @@
#include "src/function-kind.h"
#include "src/objects/fixed-array.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
#include "src/objects/fixed-array.h"
#include "src/objects/js-objects.h"
#include "src/objects/struct.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -6,7 +6,7 @@
#define V8_OBJECTS_CELL_H_
#include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -8,7 +8,7 @@
#include "src/globals.h"
#include "src/maybe-handles.h"
#include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -8,7 +8,7 @@
#include "src/maybe-handles.h"
#include "src/objects/instance-type.h"
#include "src/objects/smi.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -6,7 +6,7 @@
#define V8_OBJECTS_FOREIGN_H_
#include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -6,7 +6,7 @@
#define V8_OBJECTS_FREE_SPACE_H_
#include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -8,7 +8,7 @@
#include "src/objects/allocation-site.h"
#include "src/objects/fixed-array.h"
#include "src/objects/js-objects.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -15,7 +15,7 @@
#include "src/isolate.h"
#include "src/objects/intl-objects.h"
#include "src/objects/managed.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
#include "unicode/uversion.h"
// Has to be the last include (doesn't have include guards):
......
......@@ -8,7 +8,7 @@
#include "src/objects.h"
#include "src/objects/embedder-data-slot.h"
#include "src/objects/property-array.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -6,7 +6,7 @@
#define V8_OBJECTS_JS_PROXY_H_
#include "src/objects/js-objects.h"
#include "torque-generated/builtin-definitions-from-dsl.h"
#include "torque-generated/builtin-definitions-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -7,7 +7,7 @@
#include "src/objects.h"
#include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -6,7 +6,7 @@
#define V8_OBJECTS_ODDBALL_H_
#include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -6,7 +6,7 @@
#define V8_OBJECTS_PROPERTY_ARRAY_H_
#include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -6,7 +6,7 @@
#define V8_OBJECTS_PROPERTY_CELL_H_
#include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -14,7 +14,7 @@
#include "src/objects/smi.h"
#include "src/objects/struct.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -7,7 +7,7 @@
#include "src/objects.h"
#include "src/objects/heap-object.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "torque-generated/field-offsets-tq.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
......
......@@ -179,7 +179,7 @@ class Namespace : public Scope {
: Scope(Declarable::kNamespace), name_(name) {}
const std::string& name() const { return name_; }
std::string ExternalName() const {
return CamelifyString(name()) + "BuiltinsFromDSLAssembler";
return "TorqueGenerated" + CamelifyString(name()) + "BuiltinsAssembler";
}
bool IsDefaultNamespace() const;
bool IsTestNamespace() const;
......
......@@ -58,7 +58,7 @@ void ImplementationVisitor::BeginNamespaceFile(Namespace* nspace) {
for (Namespace* n : GlobalContext::Get().GetNamespaces()) {
source << "#include \"torque-generated/builtins-" +
DashifyString(n->name()) + "-from-dsl-gen.h\"\n";
DashifyString(n->name()) + "-gen-tq.h\"\n";
}
source << "\n";
......@@ -70,7 +70,7 @@ void ImplementationVisitor::BeginNamespaceFile(Namespace* nspace) {
transform(upper_name.begin(), upper_name.end(), upper_name.begin(),
::toupper);
std::string headerDefine =
std::string("V8_TORQUE_") + upper_name + "_FROM_DSL_BASE_H__";
"V8_GEN_TORQUE_GENERATED_" + upper_name + "_NAMESPACE_TQ_H_";
header << "#ifndef " << headerDefine << "\n";
header << "#define " << headerDefine << "\n\n";
header << "#include \"src/compiler/code-assembler.h\"\n";
......@@ -78,7 +78,7 @@ void ImplementationVisitor::BeginNamespaceFile(Namespace* nspace) {
header << "#include \"src/code-stub-assembler.h\"\n";
}
header << "#include \"src/utils.h\"\n";
header << "#include \"torque-generated/class-definitions-from-dsl.h\"\n";
header << "#include \"torque-generated/field-offsets-tq.h\"\n";
header << "\n";
header << "namespace v8 {\n"
......@@ -103,7 +103,7 @@ void ImplementationVisitor::EndNamespaceFile(Namespace* nspace) {
transform(upper_name.begin(), upper_name.end(), upper_name.begin(),
::toupper);
std::string headerDefine =
std::string("V8_TORQUE_") + upper_name + "_FROM_DSL_BASE_H__";
"V8_GEN_TORQUE_GENERATED_" + upper_name + "_NAMESPACE_V8_H_";
source << "} // namespace internal\n"
<< "} // namespace v8\n"
......@@ -499,7 +499,7 @@ void ImplementationVisitor::Visit(Builtin* builtin) {
<< " TNode<IntPtrT> arguments_length(ChangeInt32ToIntPtr(argc));\n";
source_out() << " TNode<RawPtrT> arguments_frame = "
"UncheckedCast<RawPtrT>(LoadFramePointer());\n";
source_out() << " BaseBuiltinsFromDSLAssembler::Arguments "
source_out() << " TorqueGeneratedBaseBuiltinsAssembler::Arguments "
"torque_arguments(GetFrameArguments(arguments_frame, "
"arguments_length));\n";
source_out() << " CodeStubArguments arguments(this, torque_arguments);\n";
......@@ -1579,7 +1579,7 @@ void ImplementationVisitor::GenerateImplementation(const std::string& dir,
Namespace* nspace) {
std::string new_source(nspace->source());
std::string base_file_name =
"builtins-" + DashifyString(nspace->name()) + "-from-dsl-gen";
"builtins-" + DashifyString(nspace->name()) + "-gen-tq";
std::string source_file_name = dir + "/" + base_file_name + ".cc";
ReplaceFileContentsIfDifferent(source_file_name, new_source);
......@@ -2709,10 +2709,10 @@ void ImplementationVisitor::Visit(Declarable* declarable) {
void ImplementationVisitor::GenerateBuiltinDefinitions(std::string& file_name) {
std::stringstream new_contents_stream;
new_contents_stream
<< "#ifndef V8_BUILTINS_BUILTIN_DEFINITIONS_FROM_DSL_H_\n"
"#define V8_BUILTINS_BUILTIN_DEFINITIONS_FROM_DSL_H_\n"
<< "#ifndef V8_GEN_TORQUE_GENERATED_BUILTIN_DEFINITIONS_TQ_H_\n"
"#define V8_GEN_TORQUE_GENERATED_BUILTIN_DEFINITIONS_TQ_H_\n"
"\n"
"#define BUILTIN_LIST_FROM_DSL(CPP, API, TFJ, TFC, TFS, TFH, ASM) "
"#define BUILTIN_LIST_FROM_TORQUE(CPP, API, TFJ, TFC, TFS, TFH, ASM) "
"\\\n";
for (auto& declarable : GlobalContext::AllDeclarables()) {
Builtin* builtin = Builtin::DynamicCast(declarable.get());
......@@ -2768,7 +2768,7 @@ void ImplementationVisitor::GenerateBuiltinDefinitions(std::string& file_name) {
new_contents_stream << "\n";
new_contents_stream
<< "#endif // V8_BUILTINS_BUILTIN_DEFINITIONS_FROM_DSL_H_\n";
<< "#endif // V8_GEN_TORQUE_GENERATED_BUILTIN_DEFINITIONS_TQ_H_\n";
std::string new_contents(new_contents_stream.str());
ReplaceFileContentsIfDifferent(file_name, new_contents);
......@@ -2847,10 +2847,11 @@ void CompleteFieldSection(FieldSectionType* section,
} // namespace
void ImplementationVisitor::GenerateClassDefinitions(std::string& file_name) {
void ImplementationVisitor::GenerateClassFieldOffsets(
const std::string& output_directory) {
std::stringstream new_contents_stream;
new_contents_stream << "#ifndef V8_CLASS_BUILTIN_DEFINITIONS_FROM_DSL_H_\n"
"#define V8_CLASS_BUILTIN_DEFINITIONS_FROM_DSL_H_\n"
new_contents_stream << "#ifndef V8_GEN_TORQUE_GENERATED_FIELD_OFFSETS_TQ_H_\n"
"#define V8_GEN_TORQUE_GENERATED_FIELD_OFFSETS_TQ_H_\n"
"\n\n";
for (auto i : GlobalContext::GetClasses()) {
......@@ -2908,10 +2909,12 @@ void ImplementationVisitor::GenerateClassDefinitions(std::string& file_name) {
}
new_contents_stream
<< "\n#endif // V8_CLASS_BUILTIN_DEFINITIONS_FROM_DSL_H_\n";
<< "\n#endif // V8_GEN_TORQUE_GENERATED_FIELD_OFFSETS_TQ_H_\n";
const std::string output_header_path =
output_directory + "/field-offsets-tq.h";
std::string new_contents(new_contents_stream.str());
ReplaceFileContentsIfDifferent(file_name, new_contents);
ReplaceFileContentsIfDifferent(output_header_path, new_contents);
}
void ImplementationVisitor::GeneratePrintDefinitions(std::string& file_name) {
......@@ -3030,11 +3033,11 @@ void GenerateClassFieldVerifier(const std::string& class_name,
void ImplementationVisitor::GenerateClassVerifiers(
const std::string& output_directory) {
const char* file_name = "class-verifiers-from-dsl";
const char* file_name = "class-verifiers-tq";
std::stringstream h_contents;
std::stringstream cc_contents;
h_contents << "#ifndef V8_CLASS_VERIFIERS_FROM_DSL_H_\n"
"#define V8_CLASS_VERIFIERS_FROM_DSL_H_\n"
h_contents << "#ifndef V8_GEN_TORQUE_GENERATED_CLASS_VERIFIERS_TQ_H_\n"
"#define V8_GEN_TORQUE_GENERATED_CLASS_VERIFIERS_TQ_H_\n"
"\n";
const char* enabled_check = "\n#ifdef VERIFY_HEAP\n";
......@@ -3066,7 +3069,7 @@ void ImplementationVisitor::GenerateClassVerifiers(
h_contents << "class " << type->name() << ";\n";
}
const char* verifier_class = "ClassVerifiersFromDSL";
const char* verifier_class = "TorqueGeneratedClassVerifiers";
h_contents << "class " << verifier_class << " {\n";
h_contents << " public:\n";
......@@ -3129,7 +3132,7 @@ void ImplementationVisitor::GenerateClassVerifiers(
h_contents << end_enabled_check;
cc_contents << end_enabled_check;
h_contents << "\n#endif // V8_CLASS_VERIFIERS_FROM_DSL_H_\n";
h_contents << "\n#endif // V8_GEN_TORQUE_GENERATED_CLASS_VERIFIERS_TQ_H_\n";
ReplaceFileContentsIfDifferent(output_directory + "/" + file_name + ".h",
h_contents.str());
......
......@@ -276,7 +276,7 @@ bool IsCompatibleSignature(const Signature& sig, const TypeVector& types,
class ImplementationVisitor {
public:
void GenerateBuiltinDefinitions(std::string& file_name);
void GenerateClassDefinitions(std::string& file_name);
void GenerateClassFieldOffsets(const std::string& output_directory);
void GeneratePrintDefinitions(std::string& file_name);
void GenerateClassVerifiers(const std::string& output_directory);
......
......@@ -77,14 +77,13 @@ void CompileCurrentAst(TorqueCompilerOptions options) {
std::string output_directory = options.output_directory;
if (output_directory.length() != 0) {
std::string output_header_path = output_directory;
output_header_path += "/builtin-definitions-from-dsl.h";
output_header_path += "/builtin-definitions-tq.h";
implementation_visitor.GenerateBuiltinDefinitions(output_header_path);
output_header_path = output_directory + "/class-definitions-from-dsl.h";
implementation_visitor.GenerateClassDefinitions(output_header_path);
implementation_visitor.GenerateClassFieldOffsets(output_directory);
std::string output_source_path =
output_directory + "/objects-printer-from-dsl.cc";
output_directory + "/objects-printer-tq.cc";
implementation_visitor.GeneratePrintDefinitions(output_source_path);
implementation_visitor.GenerateClassVerifiers(output_directory);
......
......@@ -19,7 +19,7 @@
#include "src/objects/promise-inl.h"
#include "test/cctest/compiler/code-assembler-tester.h"
#include "test/cctest/compiler/function-tester.h"
#include "torque-generated/builtins-test-from-dsl-gen.h"
#include "torque-generated/builtins-test-gen-tq.h"
namespace v8 {
namespace internal {
......@@ -31,10 +31,10 @@ typedef CodeAssemblerLabel Label;
typedef CodeAssemblerVariable Variable;
class TestTorqueAssembler : public CodeStubAssembler,
public TestBuiltinsFromDSLAssembler {
public TorqueGeneratedTestBuiltinsAssembler {
public:
explicit TestTorqueAssembler(CodeAssemblerState* state)
: CodeStubAssembler(state), TestBuiltinsFromDSLAssembler(state) {}
: CodeStubAssembler(state), TorqueGeneratedTestBuiltinsAssembler(state) {}
};
} // namespace
......
......@@ -21,7 +21,7 @@ BASE_PATH = os.path.dirname(os.path.dirname(GCMOLE_PATH))
assert len(sys.argv) == 2
if not os.path.isfile("out/Release/gen/torque-generated/builtin-definitions-from-dsl.h"):
if not os.path.isfile("out/Release/gen/torque-generated/builtin-definitions-tq.h"):
print("Expected generated headers in out/Release/gen.")
print("Either build v8 in out/Release or change gcmole.lua:115")
sys.exit(-1)
......
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