Files
sdk/runtime/vm/constants_kbc.cc
T
Alexander Markov f46670e00c [vm,dyn_modules] Support instantiated tear-offs of generic instance methods in the interpreter
TEST=ci (co19/Language/Expressions/Property_Extraction/Generic_Method_Instantiation/generic_method_A02_t03)

Change-Id: I9b4862cdbaf6977230e1cce9f5f82c729464425f
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443638
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-08-06 06:09:29 -07:00

90 lines
3.0 KiB
C++

// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/constants_kbc.h"
namespace dart {
static const intptr_t kInstructionSize0 = 1;
static const intptr_t kInstructionSizeA = 2;
static const intptr_t kInstructionSizeD = 2;
static const intptr_t kInstructionSizeWideD = 5;
static const intptr_t kInstructionSizeX = 2;
static const intptr_t kInstructionSizeWideX = 5;
static const intptr_t kInstructionSizeT = 2;
static const intptr_t kInstructionSizeWideT = 4;
static const intptr_t kInstructionSizeA_E = 3;
static const intptr_t kInstructionSizeWideA_E = 6;
static const intptr_t kInstructionSizeA_Y = 3;
static const intptr_t kInstructionSizeWideA_Y = 6;
static const intptr_t kInstructionSizeD_F = 3;
static const intptr_t kInstructionSizeWideD_F = 6;
static const intptr_t kInstructionSizeA_B_C = 4;
const intptr_t KernelBytecode::kInstructionSize[] = {
#define SIZE_ORDN(encoding) kInstructionSize##encoding
#define SIZE_WIDE(encoding) kInstructionSizeWide##encoding
#define SIZE_RESV(encoding) SIZE_ORDN(encoding)
#define SIZE(name, encoding, kind, op1, op2, op3) SIZE_##kind(encoding),
KERNEL_BYTECODES_LIST(SIZE)
#undef SIZE_ORDN
#undef SIZE_WIDE
#undef SIZE_RESV
#undef SIZE
};
static const KBCInstr kVMInternal_ImplicitConstructorClosureInstructions[] = {
KernelBytecode::kVMInternal_ImplicitConstructorClosure,
0,
0,
KernelBytecode::kPush,
0,
KernelBytecode::kReturnTOS,
};
static const KBCInstr
kVMInternal_ImplicitConstructorClosure_WideInstructions[] = {
KernelBytecode::kTrap,
};
static const KBCInstr kVMInternal_ImplicitInstanceClosureInstructions[] = {
KernelBytecode::kVMInternal_ImplicitInstanceClosure,
0,
0,
KernelBytecode::kReturnTOS,
};
static const KBCInstr kVMInternal_ImplicitInstanceClosure_WideInstructions[] = {
KernelBytecode::kTrap,
};
#define DECLARE_INSTRUCTIONS(name, fmt, kind, fmta, fmtb, fmtc) \
static const KBCInstr k##name##Instructions[] = { \
KernelBytecode::k##name, \
KernelBytecode::kReturnTOS, \
};
INTERNAL_KERNEL_BYTECODES_WITH_DEFAULT_CODE(DECLARE_INSTRUCTIONS)
#undef DECLARE_INSTRUCTIONS
void KernelBytecode::GetVMInternalBytecodeInstructions(
Opcode opcode,
const KBCInstr** instructions,
intptr_t* instructions_size) {
switch (opcode) {
#define CASE(name, fmt, kind, fmta, fmtb, fmtc) \
case k##name: \
*instructions = k##name##Instructions; \
*instructions_size = sizeof(k##name##Instructions); \
return;
INTERNAL_KERNEL_BYTECODES_LIST(CASE)
#undef CASE
default:
UNREACHABLE();
}
}
} // namespace dart