[vm] DBC is obsolete. Remove dead code.

Change-Id: Ica33af158cca53c8e951e4b2582de83660e8a60d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121851
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Samir Jindel 2019-10-27 18:18:29 +00:00 committed by commit-bot@chromium.org
parent a9fb6b8812
commit c885bdde1d
171 changed files with 193 additions and 15372 deletions

View file

@ -65,9 +65,6 @@ String hash(Pointer<Data> data, int length, Pointer<EVP_MD> hashAlgorithm) {
// * Architecture: x64
// * 23000 - 52000000 us (without optimizations)
// * 23000 - 30000 us (with optimizations)
// * Architecture: SimDBC64
// * 23000 - 5500000 us (without optimizations)
// * 23000 - 30000 us (with optimizations)
const int L = 1000; // Length of data in bytes.
final hashAlgorithm = EVP_sha512();

View file

@ -605,8 +605,6 @@ Pointer<Uint8> doCall20PointerUint8(
// * CPU: Intel(R) Xeon(R) Gold 6154
// * Architecture: x64
// * 200 - 1100 us
// * Architecture: SimDBC64
// * 2800 - 110000 us
const N = 1000;
class Uint8x01 extends BenchmarkBase {

View file

@ -203,9 +203,6 @@ int doLoadInt64Mint(Pointer<Int64> pointer, int length) {
// * Architecture: x64
// * 48000 - 125000 us (without optimizations)
// * 14 - ??? us (expected with optimizations, on par with typed data)
// * Architecture: SimDBC64
// * 52000 - 130000 us (without optimizations)
// * 300 - ??? us (expected with optimizations, on par with typed data)
const N = 1000;
class PointerInt8 extends BenchmarkBase {

View file

@ -210,7 +210,7 @@ analyzer/test/src/task/strong/front_end_inference_test: Slow
# Timeout. These tests do not run efficiently on our simulator or low-end
# devices.
[ $runtime == vm && ($arch == armv6 || $arch == simarm || $arch == simarm64 || $arch == simarmv6 || $arch == simdbc64) ]
[ $runtime == vm && ($arch == armv6 || $arch == simarm || $arch == simarm64 || $arch == simarmv6) ]
*: Skip
[ $arch != x64 || $compiler != none || $mode != release || $runtime != vm ]

View file

@ -567,8 +567,6 @@ class Architecture extends NamedEnum {
static const simarm = Architecture._('simarm');
static const simarmv6 = Architecture._('simarmv6');
static const simarm64 = Architecture._('simarm64');
static const simdbc = Architecture._('simdbc');
static const simdbc64 = Architecture._('simdbc64');
static final List<String> names = _all.keys.toList();
@ -582,8 +580,6 @@ class Architecture extends NamedEnum {
simarm,
simarmv6,
simarm64,
simdbc,
simdbc64
], key: (architecture) => (architecture as Architecture).name);
static Architecture find(String name) {

View file

@ -24,16 +24,6 @@ io/socket_close_test: Pass, Timeout # Issue 28502: timeout.
no_allow_absolute_addresses_test: SkipByDesign # Not supported.
link_natives_lazily_test: SkipByDesign # Not supported.
[ $arch == simdbc || $arch == simdbc64 ]
full_coverage_test: Skip # TODO(vegorov) SIMDBC interpreter doesn't support coverage yet.
link_natives_lazily_test: SkipByDesign # SIMDBC interpreter doesn't support lazy linking of natives.
no_lazy_dispatchers_test: SkipByDesign # SIMDBC interpreter doesn't support --no_lazy_dispatchers
[ $arch == simdbc64 && $mode == debug && $checked ]
io/web_socket_test: Pass, RuntimeError # Issue 26814.
[ $system == windows ]
verbose_gc_to_bmu_test: Skip
io/process_sync_test: Pass, Timeout # Issue 24596

View file

@ -47,11 +47,10 @@ cc/CorelibIsolateStartup: Skip # OOM crash can bring down the OS.
dart/data_uri_spawn_test: Skip # TODO(zra): package:unittest is not in the image.
cc/Read: Fail # TODO(zra): Investigate, ../../dart/runtime/bin/file_test.cc: 34: error: expected: !file->WriteByte(1)
# Profiler is completely disabled in SIMDBC builds.
# On the simluator stack traces produced by the Profiler do not match
# up with the real Dart stack trace and hence we don't get correct
# symbol names.
[ $arch == simarm || $arch == simarmv6 || $arch == simarm64 || $arch == simdbc || $arch == simdbc64 ]
[ $arch == simarm || $arch == simarmv6 || $arch == simarm64 ]
cc/Service_Profile: Skip
cc/Profiler_AllocationSampleTest: Skip
cc/Profiler_ArrayAllocation: Skip
@ -166,20 +165,6 @@ dart/data_uri_spawn_test: SkipByDesign # Isolate.spawnUri
[ $runtime == vm && $mode == product ]
cc/DartAPI_IsolateSetCheckedMode: Fail,OK # Checked mode disabled in product mode.
[ $arch == simdbc || $arch == simdbc64 ]
cc/RegExp_ExternalOneByteString: Skip # TODO(vegorov) These tests don't seem to work if FLAG_interpret_irregexp is switched on by default because they attempt to call regexp functions directly instead of going through JSSyntaxRegExp_ExecuteMatch.
cc/RegExp_ExternalTwoByteString: Skip # TODO(vegorov) These tests don't seem to work if FLAG_interpret_irregexp is switched on by default because they attempt to call regexp functions directly instead of going through JSSyntaxRegExp_ExecuteMatch.
cc/RegExp_OneByteString: Skip # TODO(vegorov) These tests don't seem to work if FLAG_interpret_irregexp is switched on by default because they attempt to call regexp functions directly instead of going through JSSyntaxRegExp_ExecuteMatch.
cc/RegExp_TwoByteString: Skip # TODO(vegorov) These tests don't seem to work if FLAG_interpret_irregexp is switched on by default because they attempt to call regexp functions directly instead of going through JSSyntaxRegExp_ExecuteMatch.
cc/GuardFieldConstructor2Test: Skip # TODO(vegorov) Field guards are disabled for SIMDBC
cc/GuardFieldConstructorTest: Skip # TODO(vegorov) Field guards are disabled for SIMDBC
cc/GuardFieldFinalListTest: Skip # TODO(vegorov) Field guards are disabled for SIMDBC
cc/GuardFieldFinalVariableLengthListTest: Skip # TODO(vegorov) Field guards are disabled for SIMDBC
cc/GuardFieldSimpleTest: Skip # TODO(vegorov) Field guards are disabled for SIMDBC
cc/RegenerateAllocStubs: Skip # This test is meaningless for DBC as allocation stubs are not used.
[ $hot_reload || $hot_reload_rollback ]
dart/spawn_shutdown_test: Skip # We can shutdown an isolate before it reloads.
dart/spawn_infinite_loop_test: Skip # We can shutdown an isolate before it reloads.

View file

@ -85,8 +85,7 @@ abstract class CompilerConfiguration {
case Compiler.dartk:
case Compiler.dartkb:
if (configuration.architecture == Architecture.simdbc64 ||
configuration.architecture == Architecture.simarm ||
if (configuration.architecture == Architecture.simarm ||
configuration.architecture == Architecture.simarm64 ||
configuration.system == System.android) {
return VMKernelCompilerConfiguration(configuration);

View file

@ -142,8 +142,7 @@ Allowed values are:
all
ia32, x64
arm, armv6, arm64,
simarm, simarmv6, simarm64,
simdbc, simdbc64, arm_x64''',
simarm, simarmv6, simarm64, arm_x64''',
abbr: 'a',
values: ['all']..addAll(Architecture.names),
defaultsTo: Architecture.x64.name,
@ -687,7 +686,7 @@ compiler.''',
// Expand architectures.
var architectures = data["arch"] as String;
if (architectures == "all") {
architectures = "ia32,x64,simarm,simarm64,simdbc64";
architectures = "ia32,x64,simarm,simarm64";
}
for (var architectureName in architectures.split(",")) {

View file

@ -234,8 +234,6 @@ class DartVmRuntimeConfiguration extends RuntimeConfiguration {
case Architecture.simarmv6:
case Architecture.armv6:
case Architecture.simarm64:
case Architecture.simdbc:
case Architecture.simdbc64:
multiplier *= 4;
break;
}

View file

@ -534,7 +534,7 @@ const Map<Opcode, Format> BytecodeFormats = const {
Encoding.k0, const [Operand.none, Operand.none, Operand.none]),
};
// Should match constant in runtime/vm/stack_frame_dbc.h.
// Should match constant in runtime/vm/stack_frame_kbc.h.
const int kParamEndSlotFromFp = 4;
enum SpecialIndex {

View file

@ -1926,9 +1926,6 @@ class BytecodeGenerator extends RecursiveVisitor<Null> {
// CheckStack must see a properly initialized context when stress-testing
// stack trace collection.
// Also, simdbc doesn't support arguments descriptor SpecialDbcRegister as
// a source location for deopt info, so CheckStack should be generated
// after the code which uses arguments descriptor.
asm.emitCheckStack(0);
if (locals.hasFunctionTypeArgsVar && isClosure) {

View file

@ -54,7 +54,7 @@ var tests = <IsolateTest>[
var vmArgs = [
'--profiler=true',
'--profile-vm=false', // So this also works with DBC and KBC.
'--profile-vm=false', // So this also works with KBC.
];
main([args = const <String>[]]) async =>

View file

@ -106,9 +106,6 @@ config("dart_arch_config") {
defines += [ "TARGET_ARCH_X64" ]
} else if (dart_target_arch == "ia32" || dart_target_arch == "x86") {
defines += [ "TARGET_ARCH_IA32" ]
} else if (dart_target_arch == "dbc") {
defines += [ "TARGET_ARCH_DBC" ]
defines += [ "USING_SIMULATOR" ]
} else {
print("Invalid dart_target_arch: $dart_target_arch")
assert(false)

View file

@ -564,7 +564,7 @@ DART_EXPORT void Regress37069(uint64_t a,
Dart_ExecuteInternalCommand("gc-now", nullptr);
}
#if !defined(HOST_OS_WINDOWS) && !defined(TARGET_ARCH_DBC)
#if !defined(HOST_OS_WINDOWS)
DART_EXPORT void* UnprotectCodeOtherThread(void* isolate,
std::condition_variable* var,
std::mutex* mut) {

View file

@ -81,12 +81,4 @@ catch block entry. See `ExceptionHandlerFinder::{GetCatchEntryMovesFromDeopt, Ex
Constructing `CatchEntryMoves` dynamically from deoptimization instructions
allows to avoid unnecessary duplication of the metadata and save memory: as
deoptimization environments contain all information necessary for constructing
correct stack state.
IMPORTANT: There is a subtle difference between DBC and other architectures with
respect to catch block entry state. On normal architectures `Parameter(i)` at
catch entry would be associated with the same stack space that would be used to
store variable with index `i`. On DBC however at catch entry `Parameter(i)`
would be allocated to a separate scratch space at the very top of the register
space. See `FlowGraphAllocator::ProcessInitialDefinition` and
`FlowGraphCompiler::CatchEntryRegForVariable`.
correct stack state.

View file

@ -3465,7 +3465,7 @@ DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_SortClasses();
* permissions; the data piece may be loaded as read-only.
*
* - Requires the VM to have not been started with --precompilation.
* - Not supported when targeting IA32 or DBC.
* - Not supported when targeting IA32.
* - The VM writing the snapshot and the VM reading the snapshot must be the
* same version, must be built in the same DEBUG/RELEASE/PRODUCT mode, must
* be targeting the same architecture, and must both be in checked mode or

View file

@ -2,8 +2,6 @@
// 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 "lib/ffi.h"
#include "include/dart_api.h"
#include "platform/globals.h"
#include "vm/bootstrap_natives.h"
@ -421,10 +419,7 @@ DEFINE_NATIVE_ENTRY(Ffi_asExternalTypedData, 0, 2) {
}
DEFINE_NATIVE_ENTRY(Ffi_nativeCallbackFunction, 1, 2) {
#if defined(TARGET_ARCH_DBC)
Exceptions::ThrowUnsupportedError(
"FFI callbacks are not yet supported on DBC.");
#elif defined(DART_PRECOMPILED_RUNTIME) || defined(DART_PRECOMPILER)
#if defined(DART_PRECOMPILED_RUNTIME) || defined(DART_PRECOMPILER)
// Calls to this function are removed by the flow-graph builder in AOT.
// See StreamingFlowGraphBuilder::BuildFfiNativeCallbackFunction().
UNREACHABLE();
@ -495,7 +490,7 @@ DEFINE_NATIVE_ENTRY(Ffi_pointerFromFunction, 1, 1) {
thread->SetFfiCallbackCode(function.FfiCallbackId(), code);
uword entry_point = code.EntryPoint();
#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(TARGET_ARCH_DBC)
#if !defined(DART_PRECOMPILED_RUNTIME)
if (NativeCallbackTrampolines::Enabled()) {
entry_point = isolate->native_callback_trampolines()->TrampolineForId(
function.FfiCallbackId());
@ -505,121 +500,4 @@ DEFINE_NATIVE_ENTRY(Ffi_pointerFromFunction, 1, 1) {
return Pointer::New(type_arg, entry_point);
}
#if defined(TARGET_ARCH_DBC)
void FfiMarshalledArguments::SetFunctionAddress(uint64_t value) const {
data_[kOffsetFunctionAddress] = value;
}
static intptr_t ArgumentHostRegisterIndex(host::Register reg) {
for (intptr_t i = 0; i < host::CallingConventions::kNumArgRegs; i++) {
if (host::CallingConventions::ArgumentRegisters[i] == reg) {
return i;
}
}
UNREACHABLE();
}
void FfiMarshalledArguments::SetRegister(host::Register reg,
uint64_t value) const {
const intptr_t reg_index = ArgumentHostRegisterIndex(reg);
ASSERT(host::CallingConventions::ArgumentRegisters[reg_index] == reg);
const intptr_t index = kOffsetRegisters + reg_index;
data_[index] = value;
}
void FfiMarshalledArguments::SetFpuRegister(host::FpuRegister reg,
uint64_t value) const {
const intptr_t fpu_index = static_cast<intptr_t>(reg);
ASSERT(host::CallingConventions::FpuArgumentRegisters[fpu_index] == reg);
const intptr_t index = kOffsetFpuRegisters + fpu_index;
data_[index] = value;
}
void FfiMarshalledArguments::SetNumStackSlots(intptr_t num_args) const {
data_[kOffsetNumStackSlots] = num_args;
}
void FfiMarshalledArguments::SetAlignmentMask(uint64_t alignment_mask) const {
data_[kOffsetAlignmentMask] = alignment_mask;
}
intptr_t FfiMarshalledArguments::GetNumStackSlots() const {
return data_[kOffsetNumStackSlots];
}
void FfiMarshalledArguments::SetStackSlotValue(intptr_t index,
uint64_t value) const {
ASSERT(0 <= index && index < GetNumStackSlots());
data_[kOffsetStackSlotValues + index] = value;
}
uint64_t* FfiMarshalledArguments::New(
const compiler::ffi::FfiSignatureDescriptor& signature,
const uint64_t* arg_values) {
const intptr_t num_stack_slots = signature.num_stack_slots();
const uint64_t alignment_mask = ~(OS::ActivationFrameAlignment() - 1);
const intptr_t size =
FfiMarshalledArguments::kOffsetStackSlotValues + num_stack_slots;
uint64_t* data = Thread::Current()->GetFfiMarshalledArguments(size);
const auto& descr = FfiMarshalledArguments(data);
descr.SetFunctionAddress(arg_values[compiler::ffi::kFunctionAddressRegister]);
const intptr_t num_args = signature.length();
descr.SetNumStackSlots(num_stack_slots);
descr.SetAlignmentMask(alignment_mask);
for (int i = 0; i < num_args; i++) {
uint64_t arg_value = arg_values[compiler::ffi::kFirstArgumentRegister + i];
HostLocation loc = signature.LocationAt(i);
// TODO(36809): For 32 bit, support pair locations.
if (loc.IsRegister()) {
descr.SetRegister(loc.reg(), arg_value);
} else if (loc.IsFpuRegister()) {
descr.SetFpuRegister(loc.fpu_reg(), arg_value);
} else {
ASSERT(loc.IsStackSlot() || loc.IsDoubleStackSlot());
ASSERT(loc.stack_index() < num_stack_slots);
descr.SetStackSlotValue(loc.stack_index(), arg_value);
}
}
return data;
}
#if defined(DEBUG)
void FfiMarshalledArguments::Print() const {
OS::PrintErr("FfiMarshalledArguments data_ 0x%" Pp "\n",
reinterpret_cast<intptr_t>(data_));
OS::PrintErr(" 00 0x%016" Px64 " (function address, int result)\n",
data_[0]);
for (intptr_t i = 0; i < host::CallingConventions::kNumArgRegs; i++) {
const intptr_t index = kOffsetRegisters + i;
const char* result_str = i == 0 ? ", float result" : "";
OS::PrintErr(" %02" Pd " 0x%016" Px64 " (%s%s)\n", index, data_[index],
RegisterNames::RegisterName(
host::CallingConventions::ArgumentRegisters[i]),
result_str);
}
for (intptr_t i = 0; i < host::CallingConventions::kNumFpuArgRegs; i++) {
const intptr_t index = kOffsetFpuRegisters + i;
OS::PrintErr(" %02" Pd " 0x%016" Px64 " (%s)\n", index, data_[index],
RegisterNames::FpuRegisterName(
host::CallingConventions::FpuArgumentRegisters[i]));
}
const intptr_t alignment_mask = data_[kOffsetAlignmentMask];
OS::PrintErr(" %02" Pd " 0x%" Pp " (stack alignment mask)\n",
kOffsetAlignmentMask, alignment_mask);
const intptr_t num_stack_slots = data_[kOffsetNumStackSlots];
OS::PrintErr(" %02" Pd " 0x%" Pp " (number of stack slots)\n",
kOffsetNumStackSlots, num_stack_slots);
for (intptr_t i = 0; i < num_stack_slots; i++) {
const intptr_t index = kOffsetStackSlotValues + i;
OS::PrintErr(" %02" Pd " 0x%016" Px64 " (stack slot %" Pd ")\n", index,
data_[index], i);
}
}
#endif // defined(DEBUG)
#endif // defined(TARGET_ARCH_DBC)
} // namespace dart

View file

@ -1,76 +0,0 @@
// Copyright (c) 2019, 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.
#ifndef RUNTIME_LIB_FFI_H_
#define RUNTIME_LIB_FFI_H_
#if defined(TARGET_ARCH_DBC)
#include <platform/globals.h>
#include "vm/class_id.h"
#include "vm/compiler/backend/locations.h"
#include "vm/compiler/ffi.h"
#include "vm/object.h"
#include "vm/raw_object.h"
namespace dart {
// This structure contains all data required for an ffi call.
// It consists of the function address, all calling convention argument
// register values, argument fpu register values, number of stack arguments,
// and stack argument values. The generic DBC trampoline reads its arguments
// from this structure.
//
// Moreover, the DBC trampoline also stores the integer and floating point
// result registers in the first two slots when returning.
class FfiMarshalledArguments : public ValueObject {
public:
explicit FfiMarshalledArguments(uint64_t* data) : data_(data) {}
// Copies ffi trampoline arguments (including target address) from stack into
// a signature agnostic data structure (FfiMarshalledArguments) using the
// signature and the stack address of the first argument. (Note that this
// only works on DBC as the stack grows upwards in DBC.)
static uint64_t* New(const compiler::ffi::FfiSignatureDescriptor& signature,
const uint64_t* arg_values);
uint64_t IntResult() const { return data_[kOffsetIntResult]; }
uint64_t DoubleResult() const { return data_[kOffsetDoubleResult]; }
#if defined(DEBUG)
void Print() const;
#endif
private:
void SetFunctionAddress(uint64_t value) const;
void SetRegister(::dart::host::Register reg, uint64_t value) const;
void SetFpuRegister(::dart::host::FpuRegister reg, uint64_t value) const;
void SetAlignmentMask(uint64_t kOffsetAlignmentMask) const;
void SetNumStackSlots(intptr_t num_args) const;
intptr_t GetNumStackSlots() const;
void SetStackSlotValue(intptr_t index, uint64_t value) const;
// TODO(36809): Replace this with uword. On 32 bit architecture,
// this should be 32 bits, as the DBC stack itself is 32 bits.
uint64_t* data_;
static const intptr_t kOffsetFunctionAddress = 0;
static const intptr_t kOffsetRegisters = 1;
static const intptr_t kOffsetFpuRegisters =
kOffsetRegisters + ::dart::host::CallingConventions::kNumArgRegs;
static const intptr_t kOffsetAlignmentMask =
kOffsetFpuRegisters + ::dart::host::CallingConventions::kNumFpuArgRegs;
static const intptr_t kOffsetNumStackSlots = kOffsetAlignmentMask + 1;
static const intptr_t kOffsetStackSlotValues = kOffsetNumStackSlots + 1;
static const intptr_t kOffsetIntResult = 0;
static const intptr_t kOffsetDoubleResult = 1;
};
} // namespace dart
#endif // defined(TARGET_ARCH_DBC)
#endif // RUNTIME_LIB_FFI_H_

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
// VMOptions=--verbose_debug
// This test is mostly interesting for DBC, which needs to patch two bytecodes
// This test was mostly interesting for DBC, which needed to patch two bytecodes
// to create a breakpoint for fast Smi ops.
import 'package:observatory/service_io.dart';

View file

@ -55,7 +55,7 @@ var tests = <VMTest>[
var vmArgs = [
'--profiler=true',
'--profile-vm=false', // So this also works with DBC and KBC.
'--profile-vm=false', // So this also works with KBC.
];
main(args) async =>

View file

@ -55,7 +55,7 @@ var tests = <IsolateTest>[
var vmArgs = [
'--profiler=true',
'--profile-vm=false', // So this also works with DBC and KBC.
'--profile-vm=false', // So this also works with KBC.
];
main(args) async =>

View file

@ -895,7 +895,7 @@ var tests = <IsolateTest>[
}
}
if (!use_field_guards) {
return; // skip the test if guards are not enabled(like on simdbc64)
return; // skip the test if guards are not enabled
}
// Call eval to get a class id.

View file

@ -46,21 +46,6 @@ async_scope_test: Pass, Slow
[ $arch == simarm || $arch == simarm64 ]
*: Pass, Slow
[ $arch == simdbc || $arch == simdbc64 ]
async_single_step_exception_test: RuntimeError # Issue 29218
get_cpu_profile_timeline_rpc_test: SkipByDesign
implicit_getter_setter_test: RuntimeError # Field guards unimplemented.
next_through_catch_test: RuntimeError # Debugging StringConcatenation doesn't work the same on simdbc as on other platforms (bug #28975).
next_through_simple_async_test: RuntimeError # Debugging StringConcatenation doesn't work the same on simdbc as on other platforms (bug #28975).
next_through_simple_linear_2_test: RuntimeError # Debugging StringConcatenation doesn't work the same on simdbc as on other platforms (bug #28975).
step_through_function_test: RuntimeError # Debugging StringConcatenation doesn't work the same on simdbc as on other platforms (bug #28975).
step_through_getter_test: RuntimeError # Debugging StringConcatenation doesn't work the same on simdbc as on other platforms (bug #28975).
[ $arch == simdbc || $arch == simdbc64 || $mode == debug ]
break_on_default_constructor_test: Pass, Slow
debugger_location_second_test: Pass, Slow
debugger_location_test: Pass, Slow
# All tests use dart:io
[ $compiler == dart2js || $browser ]
*: SkipByDesign

View file

@ -53,16 +53,9 @@ eval_regression_flutter20255_test: SkipSlow # Timeout
get_vm_timeline_rpc_test: Pass, Slow
rewind_optimized_out_test: SkipSlow # Timeout
[ $arch != simarm && $arch != simarm64 && $arch != simdbc && $compiler == dartk ]
[ $arch != simarm && $arch != simarm64 && $compiler == dartk ]
complex_reload_test: RuntimeError
[ $arch == simdbc64 && $compiler == dartk ]
eval_test: RuntimeError, Timeout # Issue #34736
evaluate_in_frame_rpc_test: RuntimeError, Timeout # Issue #34736
[ $arch == simdbc64 && $compiler == dartk && $mode == debug ]
eval_test: Pass, Slow
[ $compiler == dartkb && ($builder_tag == bytecode_interpreter || $builder_tag == bytecode_mixed) ]
*: Skip # There are still timeouts in the interpreter and mixed modes which cause infra timeouts.
@ -122,7 +115,7 @@ step_through_setter_test: Skip # Issues 32137 and 32138.
step_through_switch_test: Skip # Times out. Issue 32137.
step_through_switch_with_continue_test: Skip # Times out. Issue 32137.
[ ($arch == simarm || $arch == simarm64 || $arch == simdbc64) && ($compiler == dartk || $compiler == dartkb) ]
[ ($arch == simarm || $arch == simarm64) && ($compiler == dartk || $compiler == dartkb) ]
add_breakpoint_rpc_kernel_test: RuntimeError # Issue #34736
async_generator_breakpoint_test: SkipByDesign # No incremental compiler available.
bad_reload_test: Skip # Times out on sim architectures, also RuntimeError.

View file

@ -299,8 +299,7 @@ typedef simd128_value_t fpu_register_t;
#endif
#if !defined(TARGET_ARCH_ARM) && !defined(TARGET_ARCH_X64) && \
!defined(TARGET_ARCH_IA32) && !defined(TARGET_ARCH_ARM64) && \
!defined(TARGET_ARCH_DBC)
!defined(TARGET_ARCH_IA32) && !defined(TARGET_ARCH_ARM64)
// No target architecture specified pick the one matching the host architecture.
#if defined(HOST_ARCH_ARM)
#define TARGET_ARCH_ARM 1
@ -319,12 +318,6 @@ typedef simd128_value_t fpu_register_t;
#define TARGET_ARCH_IS_32_BIT 1
#elif defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64)
#define TARGET_ARCH_IS_64_BIT 1
#elif defined(TARGET_ARCH_DBC)
#if defined(ARCH_IS_32_BIT)
#define TARGET_ARCH_IS_32_BIT 1
#else
#define TARGET_ARCH_IS_64_BIT 1
#endif
#else
#error Automatic target architecture detection failed.
#endif
@ -363,9 +356,6 @@ typedef simd128_value_t fpu_register_t;
#define USING_SIMULATOR 1
#endif
#elif defined(TARGET_ARCH_DBC)
#define USING_SIMULATOR 1
#else
#error Unknown architecture.
#endif

View file

@ -28,7 +28,7 @@ declare_args() {
dart_runtime_mode = "develop"
# Explicitly set the target architecture to use a simulator.
# Available options are: arm, arm64, x64, ia32, and dbc.
# Available options are: arm, arm64, x64, ia32.
dart_target_arch = target_cpu
# The optimization level to use for debug builds. Defaults to 0 for builds with

View file

@ -82,7 +82,7 @@ dart/disassemble_determinism_test: Slow # Times out on slower bots.
[ $arch == ia32 && $mode == debug && $system == windows ]
dart/transferable_test: Skip # This is performance test and somehow debug win ia32 bot's performance is unpredictable
[ $arch != simarm && $arch != simarm64 && $arch != simdbc64 && $hot_reload && ($compiler == dartk || $compiler == dartkb) ]
[ $arch != simarm && $arch != simarm64 && $hot_reload && ($compiler == dartk || $compiler == dartkb) ]
dart/data_uri_import_test/base64: Crash
dart/data_uri_import_test/nocharset: Crash
dart/data_uri_import_test/nomime: Crash
@ -122,7 +122,7 @@ dart/spawn_shutdown_test: SkipSlow
[ $mode == debug && $system == windows ]
dart/spawn_shutdown_test: Skip # Flaky crashes unable to start thread; likely low memory on the bot.
# Enabling of dartk for sim{arm,arm64,dbc64} revelaed these test failures, which
# Enabling of dartk for sim{arm,arm64} revelaed these test failures, which
# are to be triaged. Isolate tests are skipped on purpose due to the usage of
# batch mode.
[ $mode == debug && ($arch == simarm || $arch == simarm64) && ($compiler == dartk || $compiler == dartkb) ]
@ -169,13 +169,8 @@ cc/IsolateReload_LibraryLookup: Fail, Crash
[ $checked && ($compiler == dartk || $compiler == dartkb) ]
dart/redirection_type_shuffling_test/00: Pass # Works in --checked mode but not in --strong mode.
[ ($arch == simarm || $arch == simarm64 || $arch == simdbc || $arch == simdbc64) && ($compiler == dartk || $compiler == dartkb) ]
[ ($arch == simarm || $arch == simarm64) && ($compiler == dartk || $compiler == dartkb) ]
dart/appjit*: SkipSlow # DFE too slow
# Enabling of dartk for sim{arm,arm64,dbc64} revelaed these test failures, which
# are to be triaged. Isolate tests are skipped on purpose due to the usage of
# batch mode.
[ ($arch == simarm || $arch == simarm64 || $arch == simdbc64) && ($compiler == dartk || $compiler == dartkb) ]
dart/data_uri_spawn_test: Skip # Please triage.
dart/snapshot_version_test: RuntimeError # Please triage.
@ -186,17 +181,16 @@ dart/kernel_determinism_test: SkipSlow
[ $arch == arm || $arch == arm64 || $builder_tag == crossword || $builder_tag == crossword_ast || $compiler != dartkp ]
dart/v8_snapshot_profile_writer_test: SkipByDesign # Only relevant for AOT. Doesn't work in cross-compilation (has to run on the host).
[ $arch == arm || $arch == ia32 || $arch == simarm || $arch == simdbc || $arch == simdbc64 ]
[ $arch == arm || $arch == ia32 || $arch == simarm ]
cc/GenKernelKernelCombined: SkipByDesign # No interpreter support.
cc/GenKernelKernelLoadKernel: SkipByDesign # No interpreter support.
cc/GenKernelKernelMaxRSS: SkipByDesign # No interpreter support.
cc/GenKernelKernelReadAllBytecode: SkipByDesign # No interpreter support.
# Profiler is completely disabled in SIMDBC builds.
# On the simluator stack traces produced by the Profiler do not match
# up with the real Dart stack trace and hence we don't get correct
# symbol names.
[ $arch == simarm || $arch == simarm64 || $arch == simarmv6 || $arch == simdbc || $arch == simdbc64 ]
[ $arch == simarm || $arch == simarm64 || $arch == simarmv6 ]
cc/LargeMap: SkipByDesign
cc/Profiler_AllocationSampleTest: SkipByDesign
cc/Profiler_ArrayAllocation: SkipByDesign
@ -224,20 +218,8 @@ cc/Profiler_TrivialRecordAllocation: SkipByDesign
cc/Profiler_TypedArrayAllocation: SkipByDesign
cc/Service_Profile: SkipByDesign
[ $arch == simdbc || $arch == simdbc64 ]
cc/GuardFieldConstructor2Test: Skip # TODO(vegorov) Field guards are disabled for SIMDBC
cc/GuardFieldConstructorTest: Skip # TODO(vegorov) Field guards are disabled for SIMDBC
cc/GuardFieldFinalListTest: Skip # TODO(vegorov) Field guards are disabled for SIMDBC
cc/GuardFieldFinalVariableLengthListTest: Skip # TODO(vegorov) Field guards are disabled for SIMDBC
cc/GuardFieldSimpleTest: Skip # TODO(vegorov) Field guards are disabled for SIMDBC
cc/RegExp_ExternalOneByteString: Skip # TODO(vegorov) These tests don't seem to work if FLAG_interpret_irregexp is switched on by default because they attempt to call regexp functions directly instead of going through JSSyntaxRegExp_ExecuteMatch.
cc/RegExp_ExternalTwoByteString: Skip # TODO(vegorov) These tests don't seem to work if FLAG_interpret_irregexp is switched on by default because they attempt to call regexp functions directly instead of going through JSSyntaxRegExp_ExecuteMatch.
cc/RegExp_OneByteString: Skip # TODO(vegorov) These tests don't seem to work if FLAG_interpret_irregexp is switched on by default because they attempt to call regexp functions directly instead of going through JSSyntaxRegExp_ExecuteMatch.
cc/RegExp_TwoByteString: Skip # TODO(vegorov) These tests don't seem to work if FLAG_interpret_irregexp is switched on by default because they attempt to call regexp functions directly instead of going through JSSyntaxRegExp_ExecuteMatch.
cc/RegenerateAllocStubs: SkipByDesign # This test is meaningless for DBC as allocation stubs are not used.
[ $arch == simdbc || $arch == simdbc64 || $compiler == dartkb ]
dart/generic_field_invocation_test: SkipByDesign # DBC and KBC interpreters do not support --no_lazy_dispatchers
[ $compiler == dartkb ]
dart/generic_field_invocation_test: SkipByDesign # KBC interpreters do not support --no_lazy_dispatchers
[ $builder_tag == bytecode_interpreter || $builder_tag == bytecode_mixed || $builder_tag == optimization_counter_threshold || $hot_reload || $hot_reload_rollback || $arch != arm && $arch != simarm && $arch != x64 || $compiler != dartk && $compiler != dartkb && $compiler != dartkp ]
dart/entrypoints/*: SkipByDesign # These tests are for compiler optimizations and very sensible to when functions are optimized, so they are disabled on hotreload, optcounter and bytecode interpreter bots.
@ -267,7 +249,7 @@ dart/use_bare_instructions_flag_test: SkipByDesign # This test is for VM AOT onl
# as that would involve running CFE (the front end) in simulator mode
# to compile the URI file specified in spawnURI code.
# These Isolate tests that use spawnURI are hence skipped on purpose.
[ $runtime == dart_precompiled || $runtime == vm && ($arch == simarm || $arch == simarm64 || $arch == simdbc64) ]
[ $runtime == dart_precompiled || $runtime == vm && ($arch == simarm || $arch == simarm64) ]
dart/data_uri_spawn_test: SkipByDesign # Isolate.spawnUri
dart/issue32950_test: SkipByDesign # uses spawnUri.

View file

@ -80,23 +80,19 @@ final Set<String> excludedFiles = Set<String>.from([
'runtime/platform/utils_win.h',
'runtime/vm/compiler/assembler/assembler_arm64.h',
'runtime/vm/compiler/assembler/assembler_arm.h',
'runtime/vm/compiler/assembler/assembler_dbc.h',
'runtime/vm/compiler/assembler/assembler_ia32.h',
'runtime/vm/compiler/assembler/assembler_x64.h',
'runtime/vm/compiler/runtime_offsets_extracted.h',
'runtime/vm/constants_arm64.h',
'runtime/vm/constants_arm.h',
'runtime/vm/constants_dbc.h',
'runtime/vm/constants_ia32.h',
'runtime/vm/constants_x64.h',
'runtime/vm/cpu_arm64.h',
'runtime/vm/cpu_arm.h',
'runtime/vm/cpu_dbc.h',
'runtime/vm/cpu_ia32.h',
'runtime/vm/cpu_x64.h',
'runtime/vm/instructions_arm64.h',
'runtime/vm/instructions_arm.h',
'runtime/vm/instructions_dbc.h',
'runtime/vm/instructions_ia32.h',
'runtime/vm/instructions_x64.h',
'runtime/vm/os_thread_android.h',
@ -107,10 +103,8 @@ final Set<String> excludedFiles = Set<String>.from([
'runtime/vm/regexp_assembler_bytecode_inl.h',
'runtime/vm/simulator_arm64.h',
'runtime/vm/simulator_arm.h',
'runtime/vm/simulator_dbc.h',
'runtime/vm/stack_frame_arm64.h',
'runtime/vm/stack_frame_arm.h',
'runtime/vm/stack_frame_dbc.h',
'runtime/vm/stack_frame_ia32.h',
'runtime/vm/stack_frame_x64.h',

View file

@ -27,8 +27,7 @@
namespace dart {
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32) && \
!defined(TARGET_ARCH_DBC)
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
static void RelocateCodeObjects(
bool is_vm,
@ -59,8 +58,7 @@ class RawCodeKeyValueTrait {
typedef DirectChainedHashMap<RawCodeKeyValueTrait> RawCodeSet;
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32) && \
// !defined(TARGET_ARCH_DBC)
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32) \
static RawObject* AllocateUninitialized(PageSpace* old_space, intptr_t size) {
ASSERT(Utils::IsAligned(size, kObjectAlignment));
@ -1723,7 +1721,6 @@ class ObjectPoolSerializationCluster : public SerializationCluster {
RawObjectPool::Entry& entry = pool->ptr()->data()[j];
switch (ObjectPool::TypeBits::decode(entry_bits[j])) {
case ObjectPool::EntryType::kTaggedObject: {
#if !defined(TARGET_ARCH_DBC)
if ((entry.raw_obj_ == StubCode::CallNoScopeNative().raw()) ||
(entry.raw_obj_ == StubCode::CallAutoScopeNative().raw())) {
// Natives can run while precompiling, becoming linked and
@ -1732,7 +1729,6 @@ class ObjectPoolSerializationCluster : public SerializationCluster {
s->WriteElementRef(StubCode::CallBootstrapNative().raw(), j);
break;
}
#endif
s->WriteElementRef(entry.raw_obj_, j);
break;
}
@ -1815,14 +1811,6 @@ class ObjectPoolDeserializationCluster : public DeserializationCluster {
entry.raw_value_ = static_cast<intptr_t>(new_entry);
break;
}
#if defined(TARGET_ARCH_DBC)
case ObjectPool::EntryType::kNativeFunctionWrapper: {
// Read nothing. Initialize with the lazy link entry.
uword new_entry = NativeEntry::BootstrapNativeCallWrapperEntry();
entry.raw_value_ = static_cast<intptr_t>(new_entry);
break;
}
#endif
default:
UNREACHABLE();
}
@ -4733,8 +4721,7 @@ void Serializer::Serialize() {
}
intptr_t code_order_length = 0;
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32) && \
!defined(TARGET_ARCH_DBC)
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
if (kind_ == Snapshot::kFullAOT) {
auto code_objects =
static_cast<CodeSerializationCluster*>(clusters_by_cid_[kCodeCid])
@ -4769,8 +4756,7 @@ void Serializer::Serialize() {
(*code_objects)[i] = code_order[i];
}
}
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32) && \
// !defined(TARGET_ARCH_DBC)
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
intptr_t num_clusters = 0;
for (intptr_t cid = 1; cid < num_cids_; cid++) {

View file

@ -76,8 +76,7 @@ class CompressedStackMapsIterator : public ValueObject {
// returns false.
bool Find(uint32_t pc_offset) {
// We should never have an entry with a PC offset of 0 inside an
// non-empty CSM, so fail. (On DBC, a pc_offset of 0 can be provided
// to Find() if there's no stack map information for a given Code object.)
// non-empty CSM, so fail.
if (pc_offset == 0) return false;
do {
if (current_pc_offset_ >= pc_offset) break;

View file

@ -18,7 +18,7 @@ DEFINE_FLAG(bool, dual_map_code, true, "Dual map jitted code, RW and RX");
DEFINE_FLAG(bool, dual_map_code, false, "Dual map jitted code, RW and RX");
#endif // defined(DUAL_MAPPING_SUPPORTED)
#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_DBC)
#if defined(TARGET_ARCH_IA32)
WritableInstructionsScope::WritableInstructionsScope(uword address,
intptr_t size)
: address_(address), size_(size) {
@ -34,7 +34,7 @@ WritableInstructionsScope::~WritableInstructionsScope() {
VirtualMemory::kReadExecute);
}
}
#endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_DBC)
#endif // defined(TARGET_ARCH_IA32)
bool MatchesPattern(uword end, const int16_t* pattern, intptr_t size) {
// When breaking within generated code in GDB, it may overwrite individual

View file

@ -19,7 +19,7 @@ class RawCode;
class RawFunction;
class RawObject;
#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_DBC)
#if defined(TARGET_ARCH_IA32)
// Stack-allocated class to create a scope where the specified region
// [address, address + size] has write access enabled. This is used
// when patching generated code. Access is reset to read-execute in
@ -34,7 +34,7 @@ class WritableInstructionsScope : public ValueObject {
const uword address_;
const intptr_t size_;
};
#endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_DBC)
#endif // defined(TARGET_ARCH_IA32)
class CodePatcher : public AllStatic {
public:
@ -83,27 +83,14 @@ class CodePatcher : public AllStatic {
static RawCode* GetSwitchableCallTargetAt(uword return_address,
const Code& caller_code);
#if defined(TARGET_ARCH_DBC)
static NativeFunctionWrapper GetNativeCallAt(uword return_address,
const Code& caller_code,
NativeFunction* target);
#else
static RawCode* GetNativeCallAt(uword return_address,
const Code& caller_code,
NativeFunction* target);
#endif
#if defined(TARGET_ARCH_DBC)
static void PatchNativeCallAt(uword return_address,
const Code& caller_code,
NativeFunction target,
NativeFunctionWrapper trampoline);
#else
static void PatchNativeCallAt(uword return_address,
const Code& caller_code,
NativeFunction target,
const Code& trampoline);
#endif
static intptr_t GetSubtypeTestCachePoolIndex(uword return_address);
};

View file

@ -1,114 +0,0 @@
// Copyright (c) 2016, 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/globals.h" // Needed here to get TARGET_ARCH_DBC.
#if defined(TARGET_ARCH_DBC)
#include "vm/code_patcher.h"
#include "vm/compiler/backend/flow_graph_compiler.h"
#include "vm/instructions.h"
#include "vm/object.h"
namespace dart {
RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address,
const Code& code) {
ASSERT(code.ContainsInstructionAt(return_address));
CallPattern call(return_address, code);
return call.TargetCode();
}
void CodePatcher::PatchStaticCallAt(uword return_address,
const Code& code,
const Code& new_target) {
ASSERT(code.ContainsInstructionAt(return_address));
CallPattern call(return_address, code);
call.SetTargetCode(new_target);
}
void CodePatcher::InsertDeoptimizationCallAt(uword start) {
CallPattern::InsertDeoptCallAt(start);
}
RawCode* CodePatcher::GetInstanceCallAt(uword return_address,
const Code& caller_code,
Object* cache) {
ASSERT(caller_code.ContainsInstructionAt(return_address));
CallPattern call(return_address, caller_code);
if (cache != NULL) {
*cache = call.Data();
}
return call.TargetCode();
}
void CodePatcher::PatchInstanceCallAt(uword return_address,
const Code& caller_code,
const Object& data,
const Code& target) {
ASSERT(caller_code.ContainsInstructionAt(return_address));
CallPattern call(return_address, caller_code);
call.SetData(data);
call.SetTargetCode(target);
}
RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(uword return_address,
const Code& caller_code,
ICData* ic_data_result) {
ASSERT(caller_code.ContainsInstructionAt(return_address));
CallPattern static_call(return_address, caller_code);
ICData& ic_data = ICData::Handle();
ic_data ^= static_call.Data();
if (ic_data_result != NULL) {
*ic_data_result = ic_data.raw();
}
return ic_data.GetTargetAt(0);
}
void CodePatcher::PatchSwitchableCallAt(uword return_address,
const Code& caller_code,
const Object& data,
const Code& target) {
ASSERT(caller_code.ContainsInstructionAt(return_address));
SwitchableCallPattern call(return_address, caller_code);
call.SetData(data);
call.SetTarget(target);
}
RawCode* CodePatcher::GetSwitchableCallTargetAt(uword return_address,
const Code& caller_code) {
ASSERT(caller_code.ContainsInstructionAt(return_address));
SwitchableCallPattern call(return_address, caller_code);
return call.target();
}
RawObject* CodePatcher::GetSwitchableCallDataAt(uword return_address,
const Code& caller_code) {
ASSERT(caller_code.ContainsInstructionAt(return_address));
SwitchableCallPattern call(return_address, caller_code);
return call.data();
}
void CodePatcher::PatchNativeCallAt(uword return_address,
const Code& code,
NativeFunction target,
NativeFunctionWrapper trampoline) {
ASSERT(code.ContainsInstructionAt(return_address));
NativeCallPattern call(return_address, code);
call.set_target(trampoline);
call.set_native_function(target);
}
NativeFunctionWrapper CodePatcher::GetNativeCallAt(uword return_address,
const Code& caller_code,
NativeFunction* target) {
ASSERT(caller_code.ContainsInstructionAt(return_address));
NativeCallPattern call(return_address, caller_code);
*target = call.native_function();
return call.target();
}
} // namespace dart
#endif // defined TARGET_ARCH_DBC

View file

@ -601,7 +601,6 @@ bool AotCallSpecializer::TryOptimizeIntegerOperation(TemplateDartCall<0>* instr,
return false;
}
#ifndef TARGET_ARCH_DBC
if (FlowGraphCompiler::SupportsUnboxedInt64()) {
if (op_kind == Token::kNEGATE || op_kind == Token::kBIT_NOT) {
left_value = PrepareStaticOpInput(left_value, kMintCid, instr);
@ -609,7 +608,6 @@ bool AotCallSpecializer::TryOptimizeIntegerOperation(TemplateDartCall<0>* instr,
op_kind, left_value, DeoptId::kNone, Instruction::kNotSpeculative);
}
}
#endif
}
if (replacement != nullptr && !replacement->ComputeCanDeoptimize()) {

View file

@ -100,8 +100,7 @@ DEFINE_FLAG(bool,
Precompiler* Precompiler::singleton_ = nullptr;
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
!defined(TARGET_ARCH_IA32)
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
class PrecompileParsedFunctionHelper : public ValueObject {
public:
@ -2055,7 +2054,7 @@ void Precompiler::BindStaticCalls() {
void Precompiler::DedupUnlinkedCalls() {
ASSERT(!I->compilation_allowed());
#if !defined(TARGET_ARCH_DBC)
class UnlinkedCallDeduper {
public:
explicit UnlinkedCallDeduper(Zone* zone)
@ -2139,7 +2138,6 @@ void Precompiler::DedupUnlinkedCalls() {
visitor.Visit(current);
}
}
#endif
}
void Precompiler::Obfuscate() {
@ -2962,8 +2960,7 @@ const char** Obfuscator::SerializeMap(Thread* thread) {
return result;
}
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
// !defined(TARGET_ARCH_IA32)
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
} // namespace dart

View file

@ -346,8 +346,7 @@ class FunctionsTraits {
typedef UnorderedHashSet<FunctionsTraits> UniqueFunctionsSet;
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
!defined(TARGET_ARCH_IA32)
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
// ObfuscationMap maps Strings to Strings.
class ObfuscationMapTraits {
public:
@ -553,8 +552,7 @@ class Obfuscator {
static void Deobfuscate(Thread* thread, const GrowableObjectArray& pieces) {}
};
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
// !defined(TARGET_ARCH_IA32)
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
} // namespace dart

View file

@ -12,8 +12,6 @@
namespace dart {
namespace compiler {
#if !defined(TARGET_ARCH_DBC)
void AsmIntrinsifier::String_identityHash(Assembler* assembler,
Label* normal_ir_body) {
String_getHashCode(assembler, normal_ir_body);
@ -36,8 +34,6 @@ void AsmIntrinsifier::RegExp_ExecuteMatchSticky(Assembler* assembler,
/*sticky=*/true);
}
#endif // !defined(TARGET_ARCH_DBC)
} // namespace compiler
} // namespace dart

View file

@ -42,11 +42,6 @@ class AsmIntrinsifier : public AllStatic {
static void enum_name(Assembler* assembler, Label* normal_ir_body);
ALL_INTRINSICS_LIST(DECLARE_FUNCTION)
// On DBC all intrinsics are handled the same way.
#if defined(TARGET_ARCH_DBC)
GRAPH_INTRINSICS_LIST(DECLARE_FUNCTION)
#endif // defined(TARGET_ARCH_DBC)
#undef DECLARE_FUNCTION
static void IntrinsifyRegExpExecuteMatch(Assembler* assembler,

View file

@ -1,36 +0,0 @@
// Copyright (c) 2016, 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/globals.h" // Needed here to get TARGET_ARCH_DBC.
#if defined(TARGET_ARCH_DBC)
#define SHOULD_NOT_INCLUDE_RUNTIME
#include "vm/class_id.h"
#include "vm/compiler/asm_intrinsifier.h"
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/intrinsifier.h"
namespace dart {
namespace compiler {
DECLARE_FLAG(bool, interpret_irregexp);
#define DEFINE_FUNCTION(class_name, test_function_name, enum_name, fp) \
void AsmIntrinsifier::enum_name(Assembler* assembler, \
Label* normal_ir_body) { \
if (Simulator::IsSupportedIntrinsic(Simulator::k##enum_name##Intrinsic)) { \
assembler->Intrinsic(Simulator::k##enum_name##Intrinsic); \
} \
assembler->Bind(normal_ir_body); \
}
ALL_INTRINSICS_LIST(DEFINE_FUNCTION)
GRAPH_INTRINSICS_LIST(DEFINE_FUNCTION)
#undef DEFINE_FUNCTION
} // namespace compiler
} // namespace dart
#endif // defined TARGET_ARCH_DBC

View file

@ -244,12 +244,10 @@ bool AssemblerBase::EmittingComments() {
return FLAG_code_comments || FLAG_disassemble || FLAG_disassemble_optimized;
}
#if !defined(TARGET_ARCH_DBC)
void Assembler::Stop(const char* message) {
Comment("Stop: %s", message);
Breakpoint();
}
#endif
intptr_t ObjIndexPair::Hashcode(Key key) {
if (key.type() != ObjectPoolBuilderEntry::kTaggedObject) {

View file

@ -380,8 +380,6 @@ class AssemblerBase : public StackResource {
#include "vm/compiler/assembler/assembler_arm.h"
#elif defined(TARGET_ARCH_ARM64)
#include "vm/compiler/assembler/assembler_arm64.h"
#elif defined(TARGET_ARCH_DBC)
#include "vm/compiler/assembler/assembler_dbc.h"
#else
#error Unknown architecture.
#endif

View file

@ -1,127 +0,0 @@
// Copyright (c) 2016, 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/globals.h" // NOLINT
#if defined(TARGET_ARCH_DBC)
#define SHOULD_NOT_INCLUDE_RUNTIME
#include "vm/compiler/assembler/assembler.h"
#include "vm/cpu.h"
#include "vm/longjump.h"
#include "vm/simulator.h"
namespace dart {
DECLARE_FLAG(bool, check_code_pointer);
DECLARE_FLAG(bool, inline_alloc);
namespace compiler {
void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) {
const uword end = data + length;
while (data < end) {
*reinterpret_cast<int32_t*>(data) = SimulatorBytecode::kTrap;
data += sizeof(int32_t);
}
}
#define DEFINE_EMIT(Name, Signature, Fmt0, Fmt1, Fmt2) \
void Assembler::Name(PARAMS_##Signature) { \
Emit(SimulatorBytecode::FENCODE_##Signature( \
SimulatorBytecode::k##Name ENCODE_##Signature)); \
}
#define PARAMS_0
#define PARAMS_A_D uintptr_t ra, uintptr_t rd
#define PARAMS_D uintptr_t rd
#define PARAMS_A_B_C uintptr_t ra, uintptr_t rb, uintptr_t rc
#define PARAMS_A_B_Y uintptr_t ra, uintptr_t rb, intptr_t ry
#define PARAMS_A uintptr_t ra
#define PARAMS_T intptr_t x
#define PARAMS_A_X uintptr_t ra, intptr_t x
#define PARAMS_X intptr_t x
#define ENCODE_0
#define ENCODE_A_D , ra, rd
#define ENCODE_D , 0, rd
#define ENCODE_A_B_C , ra, rb, rc
#define ENCODE_A_B_Y , ra, rb, ry
#define ENCODE_A , ra, 0
#define ENCODE_T , x
#define ENCODE_A_X , ra, x
#define ENCODE_X , 0, x
#define FENCODE_0 Encode
#define FENCODE_A_D Encode
#define FENCODE_D Encode
#define FENCODE_A_B_C Encode
#define FENCODE_A_B_Y Encode
#define FENCODE_A Encode
#define FENCODE_T EncodeSigned
#define FENCODE_A_X EncodeSigned
#define FENCODE_X EncodeSigned
BYTECODES_LIST(DEFINE_EMIT)
#undef DEFINE_EMIT
void Assembler::Emit(int32_t value) {
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
buffer_.Emit<int32_t>(value);
}
static int32_t EncodeJump(int32_t relative_pc) {
return SimulatorBytecode::kJump | (relative_pc << 8);
}
static int32_t OffsetToPC(int32_t offset) {
return offset >> 2;
}
void Assembler::Jump(Label* label) {
if (label->IsBound()) {
Emit(EncodeJump(OffsetToPC(label->Position() - buffer_.Size())));
} else {
const intptr_t position = buffer_.Size();
Emit(label->position_);
label->LinkTo(position);
}
}
void Assembler::Bind(Label* label) {
ASSERT(!label->IsBound());
ASSERT(!label->IsBound());
intptr_t bound_pc = buffer_.Size();
while (label->IsLinked()) {
const int32_t position = label->Position();
const int32_t next_position = buffer_.Load<int32_t>(position);
buffer_.Store<int32_t>(position,
EncodeJump(OffsetToPC(bound_pc - position)));
label->position_ = next_position;
}
label->BindTo(bound_pc);
}
void Assembler::Stop(const char* message) {
// TODO(vegorov) support passing a message to the bytecode.
Emit(SimulatorBytecode::kTrap);
}
void Assembler::PushConstant(const Object& obj) {
PushConstant(AddConstant(obj));
}
void Assembler::LoadConstant(uintptr_t ra, const Object& obj) {
LoadConstant(ra, AddConstant(obj));
}
intptr_t Assembler::AddConstant(const Object& obj) {
return object_pool_builder().FindObject(
NewZoneHandle(ThreadState::Current()->zone(), obj));
}
} // namespace compiler
} // namespace dart
#endif // defined TARGET_ARCH_DBC

View file

@ -1,106 +0,0 @@
// Copyright (c) 2016, 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.
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_DBC_H_
#define RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_DBC_H_
#ifndef RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_H_
#error Do not include assembler_dbc.h directly; use assembler.h instead.
#endif
#include "platform/assert.h"
#include "platform/utils.h"
#include "vm/constants_dbc.h"
#include "vm/cpu.h"
#include "vm/hash_map.h"
#include "vm/simulator.h"
namespace dart {
namespace compiler {
// Dummy declaration to make things compile.
class Address : public ValueObject {
private:
Address();
};
class Assembler : public AssemblerBase {
public:
explicit Assembler(ObjectPoolBuilder* object_pool_builder,
bool use_far_branches = false)
: AssemblerBase(object_pool_builder) {}
~Assembler() {}
void Bind(Label* label);
void Jump(Label* label);
// Misc. functionality
intptr_t prologue_offset() const { return 0; }
void MonomorphicCheckedEntryJIT() {}
void MonomorphicCheckedEntryAOT() {}
// Debugging and bringup support.
void Breakpoint() override { Stop("Breakpoint!"); }
void Stop(const char* message) override;
static void InitializeMemoryWithBreakpoints(uword data, intptr_t length);
static uword GetBreakInstructionFiller() { return SimulatorBytecode::kTrap; }
static bool IsSafe(const Object& value) { return true; }
static bool IsSafeSmi(const Object& value) { return false; }
enum CanBeSmi {
kValueIsNotSmi,
kValueCanBeSmi,
};
// Bytecodes.
#define DECLARE_EMIT(Name, Signature, Fmt0, Fmt1, Fmt2) \
void Name(PARAMS_##Signature);
#define PARAMS_0
#define PARAMS_A_D uintptr_t ra, uintptr_t rd
#define PARAMS_D uintptr_t rd
#define PARAMS_A_B_C uintptr_t ra, uintptr_t rb, uintptr_t rc
#define PARAMS_A_B_Y uintptr_t ra, uintptr_t rb, intptr_t ry
#define PARAMS_A uintptr_t ra
#define PARAMS_X intptr_t x
#define PARAMS_T intptr_t x
#define PARAMS_A_X uintptr_t ra, intptr_t x
BYTECODES_LIST(DECLARE_EMIT)
#undef PARAMS_0
#undef PARAMS_A_D
#undef PARAMS_D
#undef PARAMS_A_B_C
#undef PARAMS_A_B_Y
#undef PARAMS_A
#undef PARAMS_X
#undef PARAMS_T
#undef PARAMS_A_X
#undef DECLARE_EMIT
void Emit(int32_t value);
void PushConstant(const Object& obj);
void LoadConstant(uintptr_t ra, const Object& obj);
intptr_t AddConstant(const Object& obj);
void Nop(intptr_t d) { Nop(0, d); }
private:
DISALLOW_ALLOCATION();
DISALLOW_COPY_AND_ASSIGN(Assembler);
};
} // namespace compiler
} // namespace dart
#endif // RUNTIME_VM_COMPILER_ASSEMBLER_ASSEMBLER_DBC_H_

File diff suppressed because it is too large Load diff

View file

@ -1,243 +0,0 @@
// Copyright (c) 2016, 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/compiler/assembler/disassembler.h"
#include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC.
#if defined(TARGET_ARCH_DBC)
#include "platform/assert.h"
#include "vm/constants_dbc.h"
#include "vm/cpu.h"
#include "vm/instructions.h"
namespace dart {
static const char* kOpcodeNames[] = {
#define BYTECODE_NAME(name, encoding, op1, op2, op3) #name,
BYTECODES_LIST(BYTECODE_NAME)
#undef BYTECODE_NAME
};
static const size_t kOpcodeCount =
sizeof(kOpcodeNames) / sizeof(kOpcodeNames[0]);
typedef void (*BytecodeFormatter)(char* buffer,
intptr_t size,
uword pc,
uint32_t bc);
typedef void (*Fmt)(char** buf, intptr_t* size, uword pc, int32_t value);
template <typename ValueType>
void FormatOperand(char** buf,
intptr_t* size,
const char* fmt,
ValueType value) {
intptr_t written = Utils::SNPrint(*buf, *size, fmt, value);
if (written < *size) {
*buf += written;
*size += written;
} else {
*size = -1;
}
}
static void Fmt___(char** buf, intptr_t* size, uword pc, int32_t value) {}
static void Fmttgt(char** buf, intptr_t* size, uword pc, int32_t value) {
FormatOperand(buf, size, "-> %" Px, pc + (value << 2));
}
static void Fmtlit(char** buf, intptr_t* size, uword pc, int32_t value) {
FormatOperand(buf, size, "k%d", value);
}
static void Fmtreg(char** buf, intptr_t* size, uword pc, int32_t value) {
FormatOperand(buf, size, "r%d", value);
}
static void Fmtxeg(char** buf, intptr_t* size, uword pc, int32_t value) {
if (value < 0) {
FormatOperand(buf, size, "FP[%d]", value);
} else {
Fmtreg(buf, size, pc, value);
}
}
static void Fmtnum(char** buf, intptr_t* size, uword pc, int32_t value) {
FormatOperand(buf, size, "#%d", value);
}
static void Apply(char** buf,
intptr_t* size,
uword pc,
Fmt fmt,
int32_t value,
const char* suffix) {
if (*size <= 0) {
return;
}
fmt(buf, size, pc, value);
if (*size > 0) {
FormatOperand(buf, size, "%s", suffix);
}
}
static void Format0(char* buf,
intptr_t size,
uword pc,
uint32_t op,
Fmt op1,
Fmt op2,
Fmt op3) {}
static void FormatT(char* buf,
intptr_t size,
uword pc,
uint32_t op,
Fmt op1,
Fmt op2,
Fmt op3) {
const int32_t x = static_cast<int32_t>(op) >> 8;
Apply(&buf, &size, pc, op1, x, "");
}
static void FormatA(char* buf,
intptr_t size,
uword pc,
uint32_t op,
Fmt op1,
Fmt op2,
Fmt op3) {
const int32_t a = (op & 0xFF00) >> 8;
Apply(&buf, &size, pc, op1, a, "");
}
static void FormatA_D(char* buf,
intptr_t size,
uword pc,
uint32_t op,
Fmt op1,
Fmt op2,
Fmt op3) {
const int32_t a = (op & 0xFF00) >> 8;
const int32_t bc = op >> 16;
Apply(&buf, &size, pc, op1, a, ", ");
Apply(&buf, &size, pc, op2, bc, "");
}
static void FormatA_X(char* buf,
intptr_t size,
uword pc,
uint32_t op,
Fmt op1,
Fmt op2,
Fmt op3) {
const int32_t a = (op & 0xFF00) >> 8;
const int32_t bc = static_cast<int32_t>(op) >> 16;
Apply(&buf, &size, pc, op1, a, ", ");
Apply(&buf, &size, pc, op2, bc, "");
}
static void FormatX(char* buf,
intptr_t size,
uword pc,
uint32_t op,
Fmt op1,
Fmt op2,
Fmt op3) {
const int32_t bc = static_cast<int32_t>(op) >> 16;
Apply(&buf, &size, pc, op1, bc, "");
}
static void FormatD(char* buf,
intptr_t size,
uword pc,
uint32_t op,
Fmt op1,
Fmt op2,
Fmt op3) {
const int32_t bc = op >> 16;
Apply(&buf, &size, pc, op1, bc, "");
}
static void FormatA_B_C(char* buf,
intptr_t size,
uword pc,
uint32_t op,
Fmt op1,
Fmt op2,
Fmt op3) {
const int32_t a = (op >> 8) & 0xFF;
const int32_t b = (op >> 16) & 0xFF;
const int32_t c = (op >> 24) & 0xFF;
Apply(&buf, &size, pc, op1, a, ", ");
Apply(&buf, &size, pc, op2, b, ", ");
Apply(&buf, &size, pc, op3, c, "");
}
static void FormatA_B_Y(char* buf,
intptr_t size,
uword pc,
uint32_t op,
Fmt op1,
Fmt op2,
Fmt op3) {
const int32_t a = (op >> 8) & 0xFF;
const int32_t b = (op >> 16) & 0xFF;
const int32_t y = static_cast<int8_t>((op >> 24) & 0xFF);
Apply(&buf, &size, pc, op1, a, ", ");
Apply(&buf, &size, pc, op2, b, ", ");
Apply(&buf, &size, pc, op3, y, "");
}
#define BYTECODE_FORMATTER(name, encoding, op1, op2, op3) \
static void Format##name(char* buf, intptr_t size, uword pc, uint32_t op) { \
Format##encoding(buf, size, pc, op, Fmt##op1, Fmt##op2, Fmt##op3); \
}
BYTECODES_LIST(BYTECODE_FORMATTER)
#undef BYTECODE_FORMATTER
static const BytecodeFormatter kFormatters[] = {
#define BYTECODE_FORMATTER(name, encoding, op1, op2, op3) &Format##name,
BYTECODES_LIST(BYTECODE_FORMATTER)
#undef BYTECODE_FORMATTER
};
void Disassembler::DecodeInstruction(char* hex_buffer,
intptr_t hex_size,
char* human_buffer,
intptr_t human_size,
int* out_instr_size,
const Code& code,
Object** object,
uword pc) {
const uint32_t instr = *reinterpret_cast<uint32_t*>(pc);
const uint8_t opcode = instr & 0xFF;
ASSERT(opcode < kOpcodeCount);
size_t name_size =
Utils::SNPrint(human_buffer, human_size, "%-10s\t", kOpcodeNames[opcode]);
human_buffer += name_size;
human_size -= name_size;
kFormatters[opcode](human_buffer, human_size, pc, instr);
Utils::SNPrint(hex_buffer, hex_size, "%08x", instr);
if (out_instr_size) {
*out_instr_size = sizeof(uint32_t);
}
*object = NULL;
if (!code.IsNull()) {
*object = &Object::Handle();
if (!DecodeLoadObjectFromPoolOrThread(pc, code, *object)) {
*object = NULL;
}
}
}
} // namespace dart
#endif // defined TARGET_ARCH_DBC

View file

@ -9,9 +9,7 @@
namespace dart {
// TODO(vegorov) this test is disabled on DBC because there is no PopRegister
// method on DBC assembler.
#if !defined(PRODUCT) && !defined(TARGET_ARCH_DBC)
#if !defined(PRODUCT)
ISOLATE_UNIT_TEST_CASE(Disassembler) {
compiler::ObjectPoolBuilder object_pool_builder;

View file

@ -1216,28 +1216,6 @@ void FlowGraph::RenameRecursive(
// Attach environment to the block entry.
AttachEnvironment(block_entry, env);
#if defined(TARGET_ARCH_DBC)
// On DBC the exception/stacktrace variables are in special registers when
// entering the catch block. The only usage of those special registers is
// within the catch block. A possible lazy-deopt at the beginning of the
// catch does not need to move those around, since the registers will be
// up-to-date when arriving in the unoptimized code and unoptimized code will
// take care of moving them to appropriate slots.
if (CatchBlockEntryInstr* catch_entry = block_entry->AsCatchBlockEntry()) {
Environment* deopt_env = catch_entry->env();
const LocalVariable* raw_exception_var = catch_entry->raw_exception_var();
const LocalVariable* raw_stacktrace_var = catch_entry->raw_stacktrace_var();
if (raw_exception_var != nullptr) {
Value* value = deopt_env->ValueAt(EnvIndex(raw_exception_var));
value->BindToEnvironment(constant_null());
}
if (raw_stacktrace_var != nullptr) {
Value* value = deopt_env->ValueAt(EnvIndex(raw_stacktrace_var));
value->BindToEnvironment(constant_null());
}
}
#endif // defined(TARGET_ARCH_DBC)
// 2. Process normal instructions.
for (ForwardInstructionIterator it(block_entry); !it.Done(); it.Advance()) {
Instruction* current = it.Current();

View file

@ -520,8 +520,6 @@ void FlowGraphCompiler::EmitSourceLine(Instruction* instr) {
line.ToCString());
}
#if !defined(TARGET_ARCH_DBC)
static bool IsPusher(Instruction* instr) {
if (auto def = instr->AsDefinition()) {
return def->HasTemp();
@ -538,14 +536,10 @@ static bool IsPopper(Instruction* instr) {
return false;
}
#endif
bool FlowGraphCompiler::IsPeephole(Instruction* instr) const {
#if !defined(TARGET_ARCH_DBC)
if (FLAG_enable_peephole && !is_optimizing()) {
return IsPusher(instr) && IsPopper(instr->next());
}
#endif
return false;
}
@ -573,7 +567,7 @@ void FlowGraphCompiler::VisitBlocks() {
continue;
}
#if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
#if defined(DEBUG)
if (!is_optimizing()) {
FrameStateClear();
}
@ -632,7 +626,7 @@ void FlowGraphCompiler::VisitBlocks() {
EndCodeSourceRange(instr->token_pos());
}
#if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
#if defined(DEBUG)
if (!is_optimizing()) {
FrameStateUpdateWith(instr);
}
@ -640,7 +634,7 @@ void FlowGraphCompiler::VisitBlocks() {
StatsEnd(instr);
}
#if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
#if defined(DEBUG)
ASSERT(is_optimizing() || FrameStateIsSafeToCall());
#endif
}
@ -860,15 +854,8 @@ void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs,
// spill_area_size but the second safepoint will truncate the bitmap and
// append the live registers to it again. The bitmap produced by both calls
// will be the same.
#if !defined(TARGET_ARCH_DBC)
ASSERT(bitmap->Length() <= (spill_area_size + saved_registers_size));
bitmap->SetLength(spill_area_size);
#else
ASSERT(slow_path_argument_count == 0);
if (bitmap->Length() <= (spill_area_size + saved_registers_size)) {
bitmap->SetLength(Utils::Maximum(bitmap->Length(), spill_area_size));
}
#endif
ASSERT(slow_path_argument_count == 0 || !using_shared_stub);
@ -1038,23 +1025,6 @@ compiler::Label* FlowGraphCompiler::AddDeoptStub(intptr_t deopt_id,
return stub->entry_label();
}
#if defined(TARGET_ARCH_DBC)
void FlowGraphCompiler::EmitDeopt(intptr_t deopt_id,
ICData::DeoptReasonId reason,
uint32_t flags) {
ASSERT(is_optimizing());
ASSERT(!intrinsic_mode());
// The pending deoptimization environment may be changed after this deopt is
// emitted, so we need to make a copy.
Environment* env_copy = pending_deoptimization_env_->DeepCopy(zone());
CompilerDeoptInfo* info =
new (zone()) CompilerDeoptInfo(deopt_id, reason, flags, env_copy);
deopt_infos_.Add(info);
assembler()->Deopt(0, /*is_eager =*/1);
info->set_pc_offset(assembler()->CodeSize());
}
#endif // defined(TARGET_ARCH_DBC)
void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) {
ASSERT(exception_handlers_list_ != NULL);
const ExceptionHandlers& handlers = ExceptionHandlers::Handle(
@ -1268,7 +1238,7 @@ bool FlowGraphCompiler::TryIntrinsifyHelper() {
}
break;
}
#if !defined(TARGET_ARCH_DBC) && !defined(TARGET_ARCH_IA32)
#if !defined(TARGET_ARCH_IA32)
case RawFunction::kMethodExtractor: {
auto& extracted_method = Function::ZoneHandle(
parsed_function().function().extracted_method_closure());
@ -1285,7 +1255,7 @@ bool FlowGraphCompiler::TryIntrinsifyHelper() {
SpecialStatsEnd(CombinedCodeStatistics::kTagIntrinsics);
return true;
}
#endif // !defined(TARGET_ARCH_DBC) && !defined(TARGET_ARCH_IA32)
#endif // !defined(TARGET_ARCH_IA32)
default:
break;
}
@ -1309,9 +1279,6 @@ bool FlowGraphCompiler::TryIntrinsifyHelper() {
return complete;
}
// DBC is very different from other architectures in how it performs instance
// and static calls because it does not use stubs.
#if !defined(TARGET_ARCH_DBC)
void FlowGraphCompiler::GenerateCallWithDeopt(TokenPosition token_pos,
intptr_t deopt_id,
const Code& stub,
@ -1470,7 +1437,6 @@ void FlowGraphCompiler::GenerateListTypeCheck(
CheckClassIds(class_id_reg, args, is_instance_lbl, &unknown);
assembler()->Bind(&unknown);
}
#endif // !defined(TARGET_ARCH_DBC)
void FlowGraphCompiler::EmitComment(Instruction* instr) {
if (!FLAG_support_il_printer || !FLAG_support_disassembler) {
@ -1484,8 +1450,6 @@ void FlowGraphCompiler::EmitComment(Instruction* instr) {
#endif
}
#if !defined(TARGET_ARCH_DBC)
// TODO(vegorov) enable edge-counters on DBC if we consider them beneficial.
bool FlowGraphCompiler::NeedsEdgeCounter(BlockEntryInstr* block) {
// Only emit an edge counter if there is not goto at the end of the block,
// except for the entry block.
@ -1504,15 +1468,11 @@ static Register AllocateFreeRegister(bool* blocked_registers) {
UNREACHABLE();
return kNoRegister;
}
#endif
void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
ASSERT(!is_optimizing());
instr->InitializeLocationSummary(zone(), false); // Not optimizing.
// No need to allocate registers based on LocationSummary on DBC as in
// unoptimized mode it's a stack based bytecode just like IR itself.
#if !defined(TARGET_ARCH_DBC)
LocationSummary* locs = instr->locs();
bool blocked_registers[kNumberOfCpuRegisters];
@ -1627,7 +1587,6 @@ void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
}
locs->set_out(0, result_location);
}
#endif // !defined(TARGET_ARCH_DBC)
}
static uword RegMaskBit(Register reg) {
@ -1744,7 +1703,6 @@ void ParallelMoveResolver::PerformMove(int index) {
compiler_->EndCodeSourceRange(TokenPosition::kParallelMove);
}
#if !defined(TARGET_ARCH_DBC)
void ParallelMoveResolver::EmitMove(int index) {
MoveOperands* const move = moves_[index];
const Location dst = move->dest();
@ -1766,7 +1724,6 @@ void ParallelMoveResolver::EmitMove(int index) {
#endif
move->Eliminate();
}
#endif
bool ParallelMoveResolver::IsScratchLocation(Location loc) {
for (int i = 0; i < moves_.length(); ++i) {
@ -2062,9 +2019,6 @@ bool FlowGraphCompiler::LookupMethodFor(int class_id,
return true;
}
#if !defined(TARGET_ARCH_DBC)
// DBC emits calls very differently from other architectures due to its
// interpreted nature.
void FlowGraphCompiler::EmitPolymorphicInstanceCall(
const CallTargets& targets,
const InstanceCallInstr& original_call,
@ -2380,12 +2334,8 @@ void FlowGraphCompiler::GenerateAssertAssignableViaTypeTestingStub(
}
#undef __
#endif
#if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
// TODO(vegorov) re-enable frame state tracking on DBC. It is
// currently disabled because it relies on LocationSummaries and
// we don't use them during unoptimized compilation on DBC.
#if defined(DEBUG)
void FlowGraphCompiler::FrameStateUpdateWith(Instruction* instr) {
ASSERT(!is_optimizing());
@ -2450,9 +2400,8 @@ void FlowGraphCompiler::FrameStateClear() {
ASSERT(!is_optimizing());
frame_state_.TruncateTo(0);
}
#endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC)
#endif // defined(DEBUG)
#if !defined(TARGET_ARCH_DBC)
#define __ compiler->assembler()->
void ThrowErrorSlowPathCode::EmitNativeCode(FlowGraphCompiler* compiler) {
@ -2506,8 +2455,6 @@ void ThrowErrorSlowPathCode::EmitNativeCode(FlowGraphCompiler* compiler) {
}
#undef __
#endif // !defined(TARGET_ARCH_DBC)
#endif // !defined(DART_PRECOMPILED_RUNTIME)
} // namespace dart

View file

@ -167,9 +167,6 @@ class CompilerDeoptInfo : public ZoneAllocated {
deopt_id_(deopt_id),
reason_(reason),
flags_(flags),
#if defined(TARGET_ARCH_DBC)
lazy_deopt_with_result_(false),
#endif
deopt_env_(deopt_env) {
ASSERT(deopt_env != NULL);
}
@ -190,18 +187,6 @@ class CompilerDeoptInfo : public ZoneAllocated {
uint32_t flags() const { return flags_; }
const Environment* deopt_env() const { return deopt_env_; }
#if defined(TARGET_ARCH_DBC)
// On DBC calls return results on the stack but not all calls have a result.
// This needs to be taken into account when constructing lazy deoptimization
// environment.
// For calls with results we add a deopt instruction that would copy top
// of the stack from optimized frame to unoptimized frame effectively
// preserving the result of the call.
// For calls with no results we don't emit such instruction - because there
// is no result pushed by the return sequence.
void mark_lazy_deopt_with_result() { lazy_deopt_with_result_ = true; }
#endif
private:
void EmitMaterializations(Environment* env, DeoptInfoBuilder* builder);
@ -212,9 +197,6 @@ class CompilerDeoptInfo : public ZoneAllocated {
const intptr_t deopt_id_;
const ICData::DeoptReasonId reason_;
const uint32_t flags_;
#if defined(TARGET_ARCH_DBC)
bool lazy_deopt_with_result_;
#endif
Environment* deopt_env_;
DISALLOW_COPY_AND_ASSIGN(CompilerDeoptInfo);
@ -522,9 +504,6 @@ class FlowGraphCompiler : public ValueObject {
const Register scratch_reg,
compiler::Label* done);
// DBC emits calls very differently from all other architectures due to its
// interpreted nature.
#if !defined(TARGET_ARCH_DBC)
void GenerateRuntimeCall(TokenPosition token_pos,
intptr_t deopt_id,
const RuntimeEntry& entry,
@ -683,7 +662,7 @@ class FlowGraphCompiler : public ValueObject {
bool NeedsEdgeCounter(BlockEntryInstr* block);
void EmitEdgeCounter(intptr_t edge_id);
#endif // !defined(TARGET_ARCH_DBC)
void RecordCatchEntryMoves(Environment* env = NULL,
intptr_t try_index = kInvalidTryIndex);
@ -754,15 +733,6 @@ class FlowGraphCompiler : public ValueObject {
ICData::DeoptReasonId reason,
uint32_t flags = 0);
#if defined(TARGET_ARCH_DBC)
void EmitDeopt(intptr_t deopt_id,
ICData::DeoptReasonId reason,
uint32_t flags = 0);
// If the cid does not fit in 16 bits, then this will cause a bailout.
uint16_t ToEmbeddableCid(intptr_t cid, Instruction* instruction);
#endif // defined(TARGET_ARCH_DBC)
CompilerDeoptInfo* AddDeoptIndexAtCall(intptr_t deopt_id);
CompilerDeoptInfo* AddSlowPathDeoptInfo(intptr_t deopt_id, Environment* env);
@ -853,19 +823,6 @@ class FlowGraphCompiler : public ValueObject {
Function* fn_return,
bool* class_is_abstract_return = NULL);
#if defined(TARGET_ARCH_DBC)
enum CallResult {
kHasResult,
kNoResult,
};
void RecordAfterCallHelper(TokenPosition token_pos,
intptr_t deopt_id,
intptr_t argument_count,
CallResult result,
LocationSummary* locs);
void RecordAfterCall(Instruction* instr, CallResult result);
#endif
// Returns new class-id bias.
//
// TODO(kustermann): We should move this code out of the [FlowGraphCompiler]!
@ -940,9 +897,6 @@ class FlowGraphCompiler : public ValueObject {
void EmitTestAndCallLoadCid(Register class_id_reg);
// DBC handles type tests differently from all other architectures due
// to its interpreted nature.
#if !defined(TARGET_ARCH_DBC)
// Type checking helper methods.
void CheckClassIds(Register class_id_reg,
const GrowableArray<intptr_t>& class_ids,
@ -1008,8 +962,6 @@ class FlowGraphCompiler : public ValueObject {
void GenerateMethodExtractorIntrinsic(const Function& extracted_method,
intptr_t type_arguments_field_offset);
#endif // !defined(TARGET_ARCH_DBC)
void GenerateGetterIntrinsic(intptr_t offset);
void GenerateSetterIntrinsic(intptr_t offset);
@ -1041,10 +993,7 @@ class FlowGraphCompiler : public ValueObject {
return compressed_stackmaps_builder_;
}
// TODO(vegorov) re-enable frame state tracking on DBC. It is
// currently disabled because it relies on LocationSummaries and
// we don't use them during unoptimized compilation on DBC.
#if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
#if defined(DEBUG)
void FrameStateUpdateWith(Instruction* instr);
void FrameStatePush(Definition* defn);
void FrameStatePop(intptr_t count);

View file

@ -1,483 +0,0 @@
// Copyright (c) 2016, 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/globals.h" // Needed here to get TARGET_ARCH_DBC.
#if defined(TARGET_ARCH_DBC)
#include "vm/compiler/backend/flow_graph_compiler.h"
#include "vm/compiler/backend/il_printer.h"
#include "vm/compiler/backend/locations.h"
#include "vm/compiler/jit/compiler.h"
#include "vm/cpu.h"
#include "vm/dart_entry.h"
#include "vm/deopt_instructions.h"
#include "vm/instructions.h"
#include "vm/object_store.h"
#include "vm/parser.h"
#include "vm/simulator.h"
#include "vm/stack_frame.h"
#include "vm/stub_code.h"
#include "vm/symbols.h"
namespace dart {
DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization.");
DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic.");
DEFINE_FLAG(bool, unbox_doubles, true, "Optimize double arithmetic.");
DECLARE_FLAG(bool, enable_simd_inline);
DECLARE_FLAG(charp, optimization_filter);
void FlowGraphCompiler::ArchSpecificInitialization() {}
FlowGraphCompiler::~FlowGraphCompiler() {
// BlockInfos are zone-allocated, so their destructors are not called.
// Verify the labels explicitly here.
for (int i = 0; i < block_info_.length(); ++i) {
ASSERT(!block_info_[i]->jump_label()->IsLinked());
}
}
bool FlowGraphCompiler::SupportsUnboxedDoubles() {
#if defined(ARCH_IS_64_BIT)
return true;
#else
// We use 64-bit wide stack slots to unbox doubles.
return false;
#endif
}
bool FlowGraphCompiler::SupportsUnboxedInt64() {
return false;
}
bool FlowGraphCompiler::SupportsUnboxedSimd128() {
return false;
}
bool FlowGraphCompiler::SupportsHardwareDivision() {
return true;
}
bool FlowGraphCompiler::CanConvertInt64ToDouble() {
return false;
}
void FlowGraphCompiler::EnterIntrinsicMode() {
ASSERT(!intrinsic_mode());
intrinsic_mode_ = true;
}
void FlowGraphCompiler::ExitIntrinsicMode() {
ASSERT(intrinsic_mode());
intrinsic_mode_ = false;
}
RawTypedData* CompilerDeoptInfo::CreateDeoptInfo(FlowGraphCompiler* compiler,
DeoptInfoBuilder* builder,
const Array& deopt_table) {
if (deopt_env_ == NULL) {
++builder->current_info_number_;
return TypedData::null();
}
intptr_t stack_height = compiler->StackSize();
AllocateIncomingParametersRecursive(deopt_env_, &stack_height);
intptr_t slot_ix = 0;
Environment* current = deopt_env_;
// Emit all kMaterializeObject instructions describing objects to be
// materialized on the deoptimization as a prefix to the deoptimization info.
EmitMaterializations(deopt_env_, builder);
// The real frame starts here.
builder->MarkFrameStart();
Zone* zone = compiler->zone();
builder->AddCallerFp(slot_ix++);
builder->AddReturnAddress(current->function(), deopt_id(), slot_ix++);
builder->AddPcMarker(Function::ZoneHandle(zone), slot_ix++);
builder->AddConstant(Function::ZoneHandle(zone), slot_ix++);
// Emit all values that are needed for materialization as a part of the
// expression stack for the bottom-most frame. This guarantees that GC
// will be able to find them during materialization.
slot_ix = builder->EmitMaterializationArguments(slot_ix);
if (lazy_deopt_with_result_) {
ASSERT(reason() == ICData::kDeoptAtCall);
builder->AddCopy(
NULL,
Location::StackSlot(
compiler::target::frame_layout.FrameSlotForVariableIndex(
-stack_height),
FPREG),
slot_ix++);
}
// For the innermost environment, set outgoing arguments and the locals.
for (intptr_t i = current->Length() - 1;
i >= current->fixed_parameter_count(); i--) {
builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
}
builder->AddCallerFp(slot_ix++);
Environment* previous = current;
current = current->outer();
while (current != NULL) {
// For any outer environment the deopt id is that of the call instruction
// which is recorded in the outer environment.
builder->AddReturnAddress(current->function(),
DeoptId::ToDeoptAfter(current->deopt_id()),
slot_ix++);
builder->AddPcMarker(previous->function(), slot_ix++);
builder->AddConstant(previous->function(), slot_ix++);
// The values of outgoing arguments can be changed from the inlined call so
// we must read them from the previous environment.
for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i),
slot_ix++);
}
// Set the locals, note that outgoing arguments are not in the environment.
for (intptr_t i = current->Length() - 1;
i >= current->fixed_parameter_count(); i--) {
builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
}
builder->AddCallerFp(slot_ix++);
// Iterate on the outer environment.
previous = current;
current = current->outer();
}
// The previous pointer is now the outermost environment.
ASSERT(previous != NULL);
// For the outermost environment, set caller PC.
builder->AddCallerPc(slot_ix++);
builder->AddPcMarker(previous->function(), slot_ix++);
builder->AddConstant(previous->function(), slot_ix++);
// For the outermost environment, set the incoming arguments.
for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++);
}
return builder->CreateDeoptInfo(deopt_table);
}
void FlowGraphCompiler::RecordAfterCallHelper(TokenPosition token_pos,
intptr_t deopt_id,
intptr_t argument_count,
CallResult result,
LocationSummary* locs) {
RecordSafepoint(locs);
// Marks either the continuation point in unoptimized code or the
// deoptimization point in optimized code, after call.
const intptr_t deopt_id_after = DeoptId::ToDeoptAfter(deopt_id);
if (is_optimizing()) {
// Return/ReturnTOS instruction drops incoming arguments so
// we have to drop outgoing arguments from the innermost environment.
// On all other architectures caller drops outgoing arguments itself
// hence the difference.
pending_deoptimization_env_->DropArguments(argument_count);
CompilerDeoptInfo* info = AddDeoptIndexAtCall(deopt_id_after);
if (result == kHasResult) {
info->mark_lazy_deopt_with_result();
}
// This descriptor is needed for exception handling in optimized code.
AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id_after, token_pos);
} else {
// Add deoptimization continuation point after the call and before the
// arguments are removed.
AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
}
}
void FlowGraphCompiler::RecordAfterCall(Instruction* instr, CallResult result) {
RecordAfterCallHelper(instr->token_pos(), instr->deopt_id(),
instr->ArgumentCount(), result, instr->locs());
}
void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler,
intptr_t stub_ix) {
UNREACHABLE();
}
#define __ assembler()->
void FlowGraphCompiler::GenerateAssertAssignable(TokenPosition token_pos,
intptr_t deopt_id,
const AbstractType& dst_type,
const String& dst_name,
LocationSummary* locs) {
SubtypeTestCache& test_cache = SubtypeTestCache::Handle();
if (!dst_type.IsVoidType() && dst_type.IsInstantiated()) {
test_cache = SubtypeTestCache::New();
} else if (!dst_type.IsInstantiated() &&
(dst_type.IsTypeParameter() || dst_type.IsType())) {
test_cache = SubtypeTestCache::New();
}
if (is_optimizing()) {
__ Push(locs->in(0).reg()); // Instance.
__ Push(locs->in(1).reg()); // Instantiator type arguments.
__ Push(locs->in(2).reg()); // Function type arguments.
}
__ PushConstant(dst_type);
__ PushConstant(dst_name);
bool may_be_smi = false;
if (!dst_type.IsVoidType() && dst_type.IsInstantiated()) {
const Class& type_class = Class::Handle(zone(), dst_type.type_class());
if (type_class.NumTypeArguments() == 0) {
const Class& smi_class = Class::Handle(zone(), Smi::Class());
may_be_smi = Class::IsSubtypeOf(smi_class, TypeArguments::Handle(zone()),
type_class, TypeArguments::Handle(zone()),
Heap::kOld);
}
}
__ AssertAssignable(may_be_smi ? 1 : 0, __ AddConstant(test_cache));
if (is_optimizing()) {
// Register allocator does not think that our first input (also used as
// output) needs to be kept alive across the call because that is how code
// is written on other platforms (where registers are always spilled across
// the call): inputs are consumed by operation and output is produced so
// neither are alive at the safepoint.
// We have to mark the slot alive manually to ensure that GC
// visits it.
locs->SetStackBit(locs->out(0).reg());
}
AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos);
const intptr_t kArgCount = 0;
RecordAfterCallHelper(token_pos, deopt_id, kArgCount,
FlowGraphCompiler::kHasResult, locs);
if (is_optimizing()) {
// Assert assignable keeps the instance on the stack as the result,
// all other arguments are popped.
ASSERT(locs->out(0).reg() == locs->in(0).reg());
__ Drop1();
}
}
void FlowGraphCompiler::EmitInstructionEpilogue(Instruction* instr) {
if (!is_optimizing()) {
Definition* defn = instr->AsDefinition();
if ((defn != NULL) && (defn->tag() != Instruction::kPushArgument) &&
(defn->tag() != Instruction::kStoreIndexed) &&
(defn->tag() != Instruction::kStoreStaticField) &&
(defn->tag() != Instruction::kStoreLocal) &&
(defn->tag() != Instruction::kStoreInstanceField) &&
(defn->tag() != Instruction::kDropTemps) && !defn->HasTemp()) {
__ Drop1();
}
}
}
void FlowGraphCompiler::GenerateGetterIntrinsic(intptr_t offset) {
__ Move(0, -(1 + compiler::target::frame_layout.param_end_from_fp));
ASSERT(offset % kWordSize == 0);
if (Utils::IsInt(8, offset / kWordSize)) {
__ LoadField(0, 0, offset / kWordSize);
} else {
__ LoadFieldExt(0, 0);
__ Nop(offset / kWordSize);
}
__ Return(0);
}
void FlowGraphCompiler::GenerateSetterIntrinsic(intptr_t offset) {
__ Move(0, -(2 + compiler::target::frame_layout.param_end_from_fp));
__ Move(1, -(1 + compiler::target::frame_layout.param_end_from_fp));
ASSERT(offset % kWordSize == 0);
if (Utils::IsInt(8, offset / kWordSize)) {
__ StoreField(0, offset / kWordSize, 1);
} else {
__ StoreFieldExt(0, 1);
__ Nop(offset / kWordSize);
}
__ LoadConstant(0, Object::Handle());
__ Return(0);
}
void FlowGraphCompiler::EmitFrameEntry() {
const Function& function = parsed_function().function();
const intptr_t num_fixed_params = function.num_fixed_parameters();
const int num_locals = parsed_function().num_stack_locals();
if (CanOptimizeFunction() && function.IsOptimizable() &&
(!is_optimizing() || may_reoptimize())) {
__ HotCheck(!is_optimizing(), GetOptimizationThreshold());
}
if (is_optimizing()) {
__ EntryOptimized(num_fixed_params,
flow_graph_.graph_entry()->spill_slot_count());
} else {
__ Entry(num_locals);
}
if (!is_optimizing()) {
if (parsed_function().has_arg_desc_var()) {
// TODO(kustermann): If dbc simulator put the args_desc_ into the
// _special_regs, we could replace these 3 with the MoveSpecial bytecode.
const intptr_t slot_index =
compiler::target::frame_layout.FrameSlotForVariable(
parsed_function().arg_desc_var());
__ LoadArgDescriptor();
__ StoreLocal(LocalVarIndex(0, slot_index));
__ Drop(1);
}
}
}
void FlowGraphCompiler::EmitPrologue() {
EmitFrameEntry();
}
void FlowGraphCompiler::CompileGraph() {
InitCompiler();
VisitBlocks();
}
uint16_t FlowGraphCompiler::ToEmbeddableCid(intptr_t cid,
Instruction* instruction) {
if (!Utils::IsUint(16, cid)) {
instruction->Unsupported(this);
UNREACHABLE();
}
return static_cast<uint16_t>(cid);
}
#undef __
#define __ compiler_->assembler()->
void ParallelMoveResolver::EmitMove(int index) {
MoveOperands* move = moves_[index];
const Location source = move->src();
const Location destination = move->dest();
if (source.IsStackSlot() && destination.IsRegister()) {
// Only allow access to the arguments (which have in the non-inverted stack
// positive indices).
ASSERT(source.base_reg() == FPREG);
ASSERT(source.stack_index() >
compiler::target::frame_layout.param_end_from_fp);
__ Move(destination.reg(), -source.stack_index());
} else if (source.IsRegister() && destination.IsRegister()) {
__ Move(destination.reg(), source.reg());
} else if (source.IsArgsDescRegister()) {
ASSERT(destination.IsRegister());
__ LoadArgDescriptorOpt(destination.reg());
} else if (source.IsExceptionRegister()) {
ASSERT(destination.IsRegister());
__ MoveSpecial(destination.reg(), Simulator::kExceptionSpecialIndex);
} else if (source.IsStackTraceRegister()) {
ASSERT(destination.IsRegister());
__ MoveSpecial(destination.reg(), Simulator::kStackTraceSpecialIndex);
} else if (source.IsConstant() && destination.IsRegister()) {
if (source.constant_instruction()->representation() == kUnboxedDouble) {
const Register result = destination.reg();
const Object& constant = source.constant();
if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) {
__ BitXor(result, result, result);
} else {
__ LoadConstant(result, constant);
__ UnboxDouble(result, result);
}
} else {
__ LoadConstant(destination.reg(), source.constant());
}
} else {
compiler_->Bailout("Unsupported move");
UNREACHABLE();
}
move->Eliminate();
}
void ParallelMoveResolver::EmitSwap(int index) {
MoveOperands* move = moves_[index];
const Location source = move->src();
const Location destination = move->dest();
ASSERT(source.IsRegister() && destination.IsRegister());
__ Swap(destination.reg(), source.reg());
// The swap of source and destination has executed a move from source to
// destination.
move->Eliminate();
// Any unperformed (including pending) move with a source of either
// this move's source or destination needs to have their source
// changed to reflect the state of affairs after the swap.
for (int i = 0; i < moves_.length(); ++i) {
const MoveOperands& other_move = *moves_[i];
if (other_move.Blocks(source)) {
moves_[i]->set_src(destination);
} else if (other_move.Blocks(destination)) {
moves_[i]->set_src(source);
}
}
}
void ParallelMoveResolver::MoveMemoryToMemory(const compiler::Address& dst,
const compiler::Address& src) {
UNREACHABLE();
}
// Do not call or implement this function. Instead, use the form below that
// uses an offset from the frame pointer instead of an Address.
void ParallelMoveResolver::Exchange(Register reg,
const compiler::Address& mem) {
UNREACHABLE();
}
// Do not call or implement this function. Instead, use the form below that
// uses offsets from the frame pointer instead of Addresses.
void ParallelMoveResolver::Exchange(const compiler::Address& mem1,
const compiler::Address& mem2) {
UNREACHABLE();
}
void ParallelMoveResolver::Exchange(Register reg,
Register base_reg,
intptr_t stack_offset) {
UNIMPLEMENTED();
}
void ParallelMoveResolver::Exchange(Register base_reg1,
intptr_t stack_offset1,
Register base_reg2,
intptr_t stack_offset2) {
UNIMPLEMENTED();
}
void ParallelMoveResolver::SpillScratch(Register reg) {
UNIMPLEMENTED();
}
void ParallelMoveResolver::RestoreScratch(Register reg) {
UNIMPLEMENTED();
}
void ParallelMoveResolver::SpillFpuScratch(FpuRegister reg) {
UNIMPLEMENTED();
}
void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
UNIMPLEMENTED();
}
#undef __
} // namespace dart
#endif // defined TARGET_ARCH_DBC

View file

@ -47,7 +47,7 @@ DEFINE_FLAG(bool,
"Generate special IC stubs for two args Smi operations");
DEFINE_FLAG(bool,
unbox_numeric_fields,
!USING_DBC,
true,
"Support unboxed double and float32x4 fields.");
class SubclassFinder {
@ -2033,12 +2033,8 @@ bool BinarySmiOpInstr::ComputeCanDeoptimize() const {
return RangeUtils::CanBeZero(right_range());
case Token::kTRUNCDIV:
#if defined(TARGET_ARCH_DBC)
return true;
#else
return RangeUtils::CanBeZero(right_range()) ||
RangeUtils::Overlaps(right_range(), -1, -1);
#endif
default:
return can_overflow();
@ -3140,10 +3136,7 @@ Definition* UnboxInt64Instr::Canonicalize(FlowGraph* flow_graph) {
return replacement;
}
// Currently we perform this only on 64-bit architectures and not on simdbc64
// (on simdbc64 the [UnboxedConstantInstr] handling is only implemented for
// doubles and causes a bailout for everthing else)
#if !defined(TARGET_ARCH_DBC)
// Currently we perform this only on 64-bit architectures.
if (compiler::target::kBitsPerWord == 64) {
ConstantInstr* c = value()->definition()->AsConstant();
if (c != NULL && (c->value().IsSmi() || c->value().IsMint())) {
@ -3156,7 +3149,6 @@ Definition* UnboxInt64Instr::Canonicalize(FlowGraph* flow_graph) {
return uc;
}
}
#endif // !defined(TARGET_ARCH_DBC)
return this;
}
@ -3877,13 +3869,9 @@ void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// TODO(kusterman): Remove duplicate between
// {TargetEntryInstr,FunctionEntryInstr}::EmitNativeCode.
if (!compiler->is_optimizing()) {
#if !defined(TARGET_ARCH_DBC)
// TODO(vegorov) re-enable edge counters on DBC if we consider them
// beneficial for the quality of the optimized bytecode.
if (compiler->NeedsEdgeCounter(this)) {
compiler->EmitEdgeCounter(preorder_number());
}
#endif
// The deoptimization descriptor points after the edge counter code for
// uniformity with ARM, where we can reuse pattern matching code that
@ -3959,13 +3947,9 @@ void FunctionEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
#endif
if (!compiler->is_optimizing()) {
#if !defined(TARGET_ARCH_DBC)
// TODO(vegorov) re-enable edge counters on DBC if we consider them
// beneficial for the quality of the optimized bytecode.
if (compiler->NeedsEdgeCounter(this)) {
compiler->EmitEdgeCounter(preorder_number());
}
#endif
// The deoptimization descriptor points after the edge counter code for
// uniformity with ARM, where we can reuse pattern matching code that
@ -4092,7 +4076,6 @@ void ParameterInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
void NativeParameterInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
#if !defined(TARGET_ARCH_DBC)
// The native entry frame has size -kExitLinkSlotFromFp. In order to access
// the top of stack from above the entry frame, we add a constant to account
// for the the two frame pointers and two return addresses of the entry frame.
@ -4103,14 +4086,10 @@ void NativeParameterInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Location src = rebase.Rebase(loc_);
NoTemporaryAllocator no_temp;
compiler->EmitMove(dst, src, &no_temp);
#else
UNREACHABLE();
#endif
}
LocationSummary* NativeParameterInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
#if !defined(TARGET_ARCH_DBC)
ASSERT(opt);
Location input = Location::Any();
if (representation() == kUnboxedInt64 && compiler::target::kWordSize < 8) {
@ -4123,9 +4102,6 @@ LocationSummary* NativeParameterInstr::MakeLocationSummary(Zone* zone,
}
return LocationSummary::Make(zone, /*num_inputs=*/0, input,
LocationSummary::kNoCall);
#else
UNREACHABLE();
#endif
}
bool ParallelMoveInstr::IsRedundant() const {
@ -4241,23 +4217,10 @@ LocationSummary* DropTempsInstr::MakeLocationSummary(Zone* zone,
}
void DropTempsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
#if defined(TARGET_ARCH_DBC)
// On DBC the action of poping the TOS value and then pushing it
// after all intermediates are poped is folded into a special
// bytecode (DropR). On other architectures this is handled by
// instruction prologue/epilogues.
ASSERT(!compiler->is_optimizing());
if ((InputCount() != 0) && HasTemp()) {
__ DropR(num_temps());
} else {
__ Drop(num_temps() + ((InputCount() != 0) ? 1 : 0));
}
#else
ASSERT(!compiler->is_optimizing());
// Assert that register assignment is correct.
ASSERT((InputCount() == 0) || (locs()->out(0).reg() == locs()->in(0).reg()));
__ Drop(num_temps());
#endif // defined(TARGET_ARCH_DBC)
}
StrictCompareInstr::StrictCompareInstr(TokenPosition token_pos,
@ -4278,8 +4241,6 @@ LocationSummary* InstanceCallInstr::MakeLocationSummary(Zone* zone,
return MakeCallSummary(zone);
}
// DBC does not use specialized inline cache stubs for smi operations.
#if !defined(TARGET_ARCH_DBC)
static RawCode* TwoArgsSmiOpInlineCacheEntry(Token::Kind kind) {
if (!FLAG_two_args_smi_icd) {
return Code::null();
@ -4295,59 +4256,6 @@ static RawCode* TwoArgsSmiOpInlineCacheEntry(Token::Kind kind) {
return Code::null();
}
}
#else
static void TryFastPathSmiOp(FlowGraphCompiler* compiler,
ICData* call_ic_data,
Token::Kind op_kind) {
if (!FLAG_two_args_smi_icd) {
return;
}
switch (op_kind) {
case Token::kADD:
if (call_ic_data->AddSmiSmiCheckForFastSmiStubs()) {
__ AddTOS();
}
break;
case Token::kSUB:
if (call_ic_data->AddSmiSmiCheckForFastSmiStubs()) {
__ SubTOS();
}
break;
case Token::kEQ:
if (call_ic_data->AddSmiSmiCheckForFastSmiStubs()) {
__ EqualTOS();
}
break;
case Token::kLT:
if (call_ic_data->AddSmiSmiCheckForFastSmiStubs()) {
__ LessThanTOS();
}
break;
case Token::kGT:
if (call_ic_data->AddSmiSmiCheckForFastSmiStubs()) {
__ GreaterThanTOS();
}
break;
case Token::kBIT_AND:
if (call_ic_data->AddSmiSmiCheckForFastSmiStubs()) {
__ BitAndTOS();
}
break;
case Token::kBIT_OR:
if (call_ic_data->AddSmiSmiCheckForFastSmiStubs()) {
__ BitOrTOS();
}
break;
case Token::kMUL:
if (call_ic_data->AddSmiSmiCheckForFastSmiStubs()) {
__ MulTOS();
}
break;
default:
break;
}
}
#endif
void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Zone* zone = compiler->zone();
@ -4369,7 +4277,6 @@ void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
call_ic_data = &ICData::ZoneHandle(zone, ic_data()->raw());
}
#if !defined(TARGET_ARCH_DBC)
if ((compiler->is_optimizing() || compiler->function().HasBytecode()) &&
HasICData()) {
ASSERT(HasICData());
@ -4404,46 +4311,6 @@ void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
*call_ic_data);
}
}
#else
ICData* original_ic_data = &ICData::ZoneHandle(call_ic_data->Original());
// Emit smi fast path instruction. If fast-path succeeds it skips the next
// instruction otherwise it falls through. Only attempt in unoptimized code
// because TryFastPathSmiOp will update original_ic_data.
if (!compiler->is_optimizing()) {
TryFastPathSmiOp(compiler, original_ic_data, token_kind());
}
const intptr_t call_ic_data_kidx = __ AddConstant(*original_ic_data);
switch (original_ic_data->NumArgsTested()) {
case 1:
if (compiler->is_optimizing()) {
__ InstanceCall1Opt(ArgumentCount(), call_ic_data_kidx);
} else {
__ InstanceCall1(ArgumentCount(), call_ic_data_kidx);
}
break;
case 2:
if (compiler->is_optimizing()) {
__ InstanceCall2Opt(ArgumentCount(), call_ic_data_kidx);
} else {
__ InstanceCall2(ArgumentCount(), call_ic_data_kidx);
}
break;
default:
UNIMPLEMENTED();
break;
}
compiler->AddCurrentDescriptor(RawPcDescriptors::kRewind, deopt_id(),
token_pos());
compiler->AddCurrentDescriptor(RawPcDescriptors::kIcCall, deopt_id(),
token_pos());
compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult);
if (compiler->is_optimizing()) {
__ PopLocal(locs()->out(0).reg());
}
#endif // !defined(TARGET_ARCH_DBC)
}
bool InstanceCallInstr::MatchesCoreName(const String& name) {
@ -4563,9 +4430,6 @@ intptr_t PolymorphicInstanceCallInstr::CallCount() const {
return targets().AggregateCallCount();
}
// DBC does not support optimizing compiler and thus doesn't emit
// PolymorphicInstanceCallInstr.
#if !defined(TARGET_ARCH_DBC)
void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ArgumentsInfo args_info(instance_call()->type_args_len(),
instance_call()->ArgumentCount(),
@ -4574,7 +4438,6 @@ void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
targets_, *instance_call(), args_info, deopt_id(),
instance_call()->token_pos(), locs(), complete(), total_call_count());
}
#endif
RawType* PolymorphicInstanceCallInstr::ComputeRuntimeType(
const CallTargets& targets) {
@ -4718,7 +4581,6 @@ void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
call_ic_data = &ICData::ZoneHandle(ic_data()->raw());
}
#if !defined(TARGET_ARCH_DBC)
ArgumentsInfo args_info(type_args_len(), ArgumentCount(), argument_names());
compiler->GenerateStaticCall(deopt_id(), token_pos(), function(), args_info,
locs(), *call_ic_data, rebind_rule_,
@ -4731,30 +4593,6 @@ void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ArgumentAt(0));
}
}
#else
const Array& arguments_descriptor = Array::Handle(
zone, (ic_data() == NULL) ? GetArgumentsDescriptor()
: ic_data()->arguments_descriptor());
const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor);
compiler->AddCurrentDescriptor(RawPcDescriptors::kRewind, deopt_id(),
token_pos());
if (compiler->is_optimizing()) {
__ PushConstant(function());
__ StaticCall(ArgumentCount(), argdesc_kidx);
compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(),
token_pos());
compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult);
__ PopLocal(locs()->out(0).reg());
} else {
const intptr_t ic_data_kidx = __ AddConstant(*call_ic_data);
__ PushConstant(ic_data_kidx);
__ IndirectStaticCall(ArgumentCount(), argdesc_kidx);
compiler->AddCurrentDescriptor(RawPcDescriptors::kUnoptStaticCall,
deopt_id(), token_pos());
compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult);
}
#endif // !defined(TARGET_ARCH_DBC)
}
intptr_t AssertAssignableInstr::statistics_tag() const {
@ -4775,15 +4613,10 @@ intptr_t AssertAssignableInstr::statistics_tag() const {
void AssertAssignableInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateAssertAssignable(token_pos(), deopt_id(), dst_type(),
dst_name(), locs());
// DBC does not use LocationSummaries in the same way as other architectures.
#if !defined(TARGET_ARCH_DBC)
ASSERT(locs()->in(0).reg() == locs()->out(0).reg());
#endif // !defined(TARGET_ARCH_DBC)
}
void AssertSubtypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
#if !defined(TARGET_ARCH_DBC)
ASSERT(sub_type().IsFinalized());
ASSERT(super_type().IsFinalized());
@ -4797,19 +4630,6 @@ void AssertSubtypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
kSubtypeCheckRuntimeEntry, 5, locs());
__ Drop(5);
#else
if (compiler->is_optimizing()) {
__ Push(locs()->in(0).reg()); // Instantiator type arguments.
__ Push(locs()->in(1).reg()); // Function type arguments.
} else {
// The 2 inputs are already on the expression stack.
}
__ PushConstant(sub_type());
__ PushConstant(super_type());
__ PushConstant(dst_name());
__ AssertSubtype();
#endif
}
LocationSummary* DeoptimizeInstr::MakeLocationSummary(Zone* zone,
@ -4818,15 +4638,9 @@ LocationSummary* DeoptimizeInstr::MakeLocationSummary(Zone* zone,
}
void DeoptimizeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
#if !defined(TARGET_ARCH_DBC)
__ Jump(compiler->AddDeoptStub(deopt_id(), deopt_reason_));
#else
compiler->EmitDeopt(deopt_id(), deopt_reason_);
#endif
}
#if !defined(TARGET_ARCH_DBC)
void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler::Label* deopt =
compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass,
@ -4924,8 +4738,6 @@ LocationSummary* CheckNullInstr::MakeLocationSummary(Zone* zone,
return locs;
}
#endif // !defined(TARGET_ARCH_DBC)
void CheckNullInstr::AddMetadataForRuntimeCall(CheckNullInstr* check_null,
FlowGraphCompiler* compiler) {
const String& function_name = check_null->function_name();
@ -4935,8 +4747,6 @@ void CheckNullInstr::AddMetadataForRuntimeCall(CheckNullInstr* check_null,
check_null->token_pos(), name_index);
}
#if !defined(TARGET_ARCH_DBC)
void UnboxInstr::EmitLoadFromBoxWithDeopt(FlowGraphCompiler* compiler) {
const intptr_t box_cid = BoxCid();
const Register box = locs()->in(0).reg();
@ -5013,8 +4823,6 @@ void UnboxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
}
#endif // !defined(TARGET_ARCH_DBC)
Environment* Environment::From(Zone* zone,
const GrowableArray<Definition*>& definitions,
intptr_t fixed_parameter_count,
@ -5158,16 +4966,13 @@ bool TestCidsInstr::AttributesEqual(Instruction* other) const {
return true;
}
#if !defined(TARGET_ARCH_DBC)
static bool BindsToSmiConstant(Value* value) {
return value->BindsToConstant() && value->BoundConstant().IsSmi();
}
#endif
bool IfThenElseInstr::Supports(ComparisonInstr* comparison,
Value* v1,
Value* v2) {
#if !defined(TARGET_ARCH_DBC)
bool is_smi_result = BindsToSmiConstant(v1) && BindsToSmiConstant(v2);
if (comparison->IsStrictCompare()) {
// Strict comparison with number checks calls a stub and is not supported
@ -5180,9 +4985,6 @@ bool IfThenElseInstr::Supports(ComparisonInstr* comparison,
return false;
}
return is_smi_result;
#else
return false;
#endif // !defined(TARGET_ARCH_DBC)
}
bool PhiInstr::IsRedundant() const {
@ -5546,8 +5348,6 @@ Representation FfiCallInstr::RequiredInputRepresentation(intptr_t idx) const {
}
}
#if !defined(TARGET_ARCH_DBC)
#define Z zone_
LocationSummary* FfiCallInstr::MakeLocationSummary(Zone* zone,
@ -5631,34 +5431,8 @@ LocationSummary* NativeReturnInstr::MakeLocationSummary(Zone* zone,
#undef Z
#else
LocationSummary* FfiCallInstr::MakeLocationSummary(Zone* zone,
bool is_optimizing) const {
LocationSummary* summary =
new (zone) LocationSummary(zone, /*num_inputs=*/InputCount(),
/*num_temps=*/0, LocationSummary::kCall);
summary->set_in(
TargetAddressIndex(),
Location::RegisterLocation(compiler::ffi::kFunctionAddressRegister));
for (intptr_t i = 0, n = NativeArgCount(); i < n; ++i) {
summary->set_in(i, arg_locations_[i]);
}
summary->set_out(0, compiler::ffi::ResultLocation(
compiler::ffi::ResultHostRepresentation(signature_)));
return summary;
}
#endif // !defined(TARGET_ARCH_DBC)
Representation FfiCallInstr::representation() const {
#if !defined(TARGET_ARCH_DBC)
return compiler::ffi::ResultRepresentation(signature_);
#else
return compiler::ffi::ResultHostRepresentation(signature_);
#endif // !defined(TARGET_ARCH_DBC)
}
// SIMD

View file

@ -529,21 +529,11 @@ FOR_EACH_ABSTRACT_INSTRUCTION(FORWARD_DECLARATION)
DECLARE_INSTRUCTION_NO_BACKEND(type) \
DECLARE_INSTRUCTION_BACKEND()
#if defined(TARGET_ARCH_DBC)
#define DECLARE_COMPARISON_METHODS \
virtual LocationSummary* MakeLocationSummary(Zone* zone, bool optimizing) \
const; \
virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, \
BranchLabels labels); \
virtual Condition GetNextInstructionCondition(FlowGraphCompiler* compiler, \
BranchLabels labels);
#else
#define DECLARE_COMPARISON_METHODS \
virtual LocationSummary* MakeLocationSummary(Zone* zone, bool optimizing) \
const; \
virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler, \
BranchLabels labels);
#endif
#define DECLARE_COMPARISON_INSTRUCTION(type) \
DECLARE_INSTRUCTION_NO_BACKEND(type) \
@ -1077,18 +1067,11 @@ class Instruction : public ZoneAllocated {
// instead.
Location::Kind RegisterKindForResult() const {
const Representation rep = representation();
#if !defined(TARGET_ARCH_DBC)
if ((rep == kUnboxedFloat) || (rep == kUnboxedDouble) ||
(rep == kUnboxedFloat32x4) || (rep == kUnboxedInt32x4) ||
(rep == kUnboxedFloat64x2)) {
return Location::kFpuRegister;
}
#else
// DBC supports only unboxed doubles and does not have distinguished FPU
// registers.
ASSERT((rep != kUnboxedFloat32x4) && (rep != kUnboxedInt32x4) &&
(rep != kUnboxedFloat64x2));
#endif
return Location::kRegister;
}
@ -2968,15 +2951,6 @@ class ComparisonInstr : public Definition {
virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
BranchLabels labels) = 0;
#if defined(TARGET_ARCH_DBC)
// On the DBC platform EmitNativeCode needs to know ahead of time what
// 'Condition' will be returned by EmitComparisonCode. This call must return
// the same result as EmitComparisonCode, but should not emit any
// instructions.
virtual Condition GetNextInstructionCondition(FlowGraphCompiler* compiler,
BranchLabels labels) = 0;
#endif
// Emits code that generates 'true' or 'false', depending on the comparison.
// This implementation will call EmitComparisonCode. If EmitComparisonCode
// does not use the labels (merely returning a condition) then EmitNativeCode
@ -6054,10 +6028,6 @@ class BoxInstr : public TemplateDefinition<1, NoThrow, Pure> {
SetInputAt(0, value);
}
#if defined(TARGET_ARCH_DBC)
void EmitAllocateBox(FlowGraphCompiler* compiler);
#endif
private:
intptr_t ValueOffset() const {
return Boxing::ValueOffset(from_representation());
@ -6798,14 +6768,6 @@ class CheckedSmiComparisonInstr : public TemplateComparison<2, Throws> {
virtual Condition EmitComparisonCode(FlowGraphCompiler* compiler,
BranchLabels labels);
#if defined(TARGET_ARCH_DBC)
virtual Condition GetNextInstructionCondition(FlowGraphCompiler* compiler,
BranchLabels labels) {
UNREACHABLE();
return INVALID_CONDITION;
}
#endif
virtual ComparisonInstr* CopyWithNewOperands(Value* left, Value* right);
private:
@ -8645,17 +8607,6 @@ class Environment : public ZoneAllocated {
// from the copy.
Environment* DeepCopy(Zone* zone, intptr_t length) const;
#if defined(TARGET_ARCH_DBC)
// Return/ReturnTOS instruction drops incoming arguments so
// we have to drop outgoing arguments from the innermost environment.
// On all other architectures caller drops outgoing arguments itself
// hence the difference.
// Note: this method can only be used at the code generation stage because
// it mutates environment in unsafe way (e.g. does not update def-use
// chains).
void DropArguments(intptr_t argc);
#endif
private:
friend class ShallowIterator;
friend class compiler::BlockBuilder; // For Environment constructor.

File diff suppressed because it is too large Load diff

View file

@ -131,8 +131,7 @@ void TestPipeline::CompileGraphAndAttachFunction() {
SpeculativeInliningPolicy speculative_policy(/*enable_blacklist=*/false);
#if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_IA32) || \
defined(TARGET_ARCH_DBC)
#if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_IA32)
const bool use_far_branches = false;
#else
const bool use_far_branches = true;

View file

@ -1032,8 +1032,7 @@ class CallSiteInliner : public ValueObject {
#endif
CalleeGraphValidator::Validate(callee_graph);
}
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
!defined(TARGET_ARCH_IA32)
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
if (FLAG_precompiled_mode) {
callee_graph->PopulateWithICData(parsed_function->function());
}
@ -1128,8 +1127,7 @@ class CallSiteInliner : public ValueObject {
// TODO(fschneider): Improve suppression of speculative inlining.
// Deopt-ids overlap between caller and callee.
if (FLAG_precompiled_mode) {
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
!defined(TARGET_ARCH_IA32)
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
AotCallSpecializer call_specializer(inliner_->precompiler_,
callee_graph,
inliner_->speculative_policy_);
@ -1140,8 +1138,7 @@ class CallSiteInliner : public ValueObject {
CompilerPass::RunInliningPipeline(CompilerPass::kAOT, &state);
#else
UNREACHABLE();
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
// !defined(TARGET_ARCH_IA32)
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
} else {
JitCallSpecializer call_specializer(callee_graph,
inliner_->speculative_policy_);

View file

@ -140,9 +140,7 @@ FlowGraphAllocator::FlowGraphAllocator(const FlowGraph& flow_graph,
// TODO(fschneider): Handle saving and restoring these registers when
// generating intrinsic code.
if (intrinsic_mode) {
#if !defined(TARGET_ARCH_DBC)
blocked_cpu_registers_[ARGS_DESC_REG] = true;
#endif
#if !defined(TARGET_ARCH_IA32)
// Need to preserve CODE_REG to be able to store the PC marker
@ -186,15 +184,6 @@ void SSALivenessAnalysis::ComputeInitialSets() {
// Initialize location summary for instruction.
current->InitializeLocationSummary(zone(), true); // opt
#if defined(TARGET_ARCH_DBC)
// TODO(vegorov) remove this once we have ported all necessary
// instructions to DBC.
if (!current->HasLocs()) {
const char* msg = "SSALivenessAnalysis::ComputeInitialSets";
NOT_IN_PRODUCT(msg = current->ToCString());
graph_entry_->parsed_function().Bailout("SSALivenessAnalysis", msg);
}
#endif
LocationSummary* locs = current->locs();
#if defined(DEBUG)
@ -453,10 +442,6 @@ void FlowGraphAllocator::BlockLocation(Location loc,
intptr_t to) {
if (loc.IsRegister()) {
BlockRegisterLocation(loc, from, to, blocked_cpu_registers_, cpu_regs_);
#if defined(TARGET_ARCH_DBC)
last_used_register_ =
Utils::Maximum(last_used_register_, loc.register_code());
#endif
} else if (loc.IsFpuRegister()) {
BlockRegisterLocation(loc, from, to, blocked_fpu_registers_, fpu_regs_);
} else {
@ -690,7 +675,7 @@ void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn,
SplitInitialDefinitionAt(range, block->lifetime_position() + 1);
ConvertAllUses(range);
// On non-DBC we'll have exception/stacktrace in a register and need to
// We have exception/stacktrace in a register and need to
// ensure this register is not available for register allocation during
// the [CatchBlockEntry] to ensure it's not overwritten.
if (loc.IsRegister()) {
@ -698,40 +683,6 @@ void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn,
block->lifetime_position() + 1);
}
return;
#if defined(TARGET_ARCH_DBC)
} else if (ParameterInstr* param = defn->AsParameter()) {
intptr_t slot_index = param->index();
AssignSafepoints(defn, range);
range->finger()->Initialize(range);
slot_index = kNumberOfCpuRegisters - 1 - slot_index;
if (slot_index < kMaxNumberOfFixedInputRegistersUsedByIL) {
// We ran out of registers for the catch block parameters.
// Bail out to unoptimized code
flow_graph_.parsed_function().Bailout("FlowGraphAllocator", "CATCH");
UNREACHABLE();
}
range->set_assigned_location(Location::RegisterLocation(slot_index));
SplitInitialDefinitionAt(range, block->lifetime_position() + 2);
ConvertAllUses(range);
BlockLocation(Location::RegisterLocation(slot_index), 0, kMaxPosition);
return;
} else if (ConstantInstr* constant = defn->AsConstant()) {
ASSERT(constant != NULL);
range->set_assigned_location(Location::Constant(constant));
range->set_spill_slot(Location::Constant(constant));
AssignSafepoints(defn, range);
range->finger()->Initialize(range);
UsePosition* use =
range->finger()->FirstRegisterBeneficialUse(block->start_pos());
if (use != NULL) {
LiveRange* tail = SplitBetween(range, block->start_pos(), use->pos());
// Parameters and constants are tagged, so allocated to CPU registers.
ASSERT(constant->representation() == kTagged);
CompleteRange(tail, Location::kRegister);
}
ConvertAllUses(range);
return;
#endif // defined(TARGET_ARCH_DBC)
}
}
@ -749,17 +700,6 @@ void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn,
slot_index = flow_graph_.num_direct_parameters() - 1 - slot_index;
}
#if defined(TARGET_ARCH_DBC)
ASSERT(param->base_reg() == FPREG);
if (slot_index >= 0) {
AssignSafepoints(defn, range);
range->finger()->Initialize(range);
range->set_assigned_location(Location::RegisterLocation(slot_index));
SplitInitialDefinitionAt(range, kNormalEntryPos);
ConvertAllUses(range);
return;
}
#endif // defined(TARGET_ARCH_DBC)
if (param->base_reg() == FPREG) {
slot_index =
compiler::target::frame_layout.FrameSlotForVariableIndex(-slot_index);
@ -774,11 +714,7 @@ void FlowGraphAllocator::ProcessInitialDefinition(Definition* defn,
SpecialParameterInstr* param = defn->AsSpecialParameter();
ASSERT(param->kind() == SpecialParameterInstr::kArgDescriptor);
Location loc;
#if defined(TARGET_ARCH_DBC)
loc = LocationArgumentsDescriptorLocation();
#else
loc = Location::RegisterLocation(ARGS_DESC_REG);
#endif // defined(TARGET_ARCH_DBC)
range->set_assigned_location(loc);
if (loc.IsRegister()) {
AssignSafepoints(defn, range);
@ -1438,9 +1374,6 @@ void FlowGraphAllocator::ProcessOneInstruction(BlockEntryInstr* block,
}
// Block all allocatable registers for calls.
// Note that on DBC registers are always essentially spilled so
// we don't need to block anything.
#if !defined(TARGET_ARCH_DBC)
if (locs->always_calls() && !locs->callee_safe_call()) {
// Expected shape of live range:
//
@ -1490,7 +1423,6 @@ void FlowGraphAllocator::ProcessOneInstruction(BlockEntryInstr* block,
}
#endif
}
#endif
if (locs->can_call()) {
safepoints_.Add(current);
@ -1971,14 +1903,6 @@ void FlowGraphAllocator::SpillAfter(LiveRange* range, intptr_t from) {
}
void FlowGraphAllocator::AllocateSpillSlotFor(LiveRange* range) {
#if defined(TARGET_ARCH_DBC)
// There is no need to support spilling on DBC because we have a lot of
// registers and registers and spill-slots have the same performance
// characteristics.
flow_graph_.parsed_function().Bailout("FlowGraphAllocator", "SPILL");
UNREACHABLE();
#endif
ASSERT(range->spill_slot().IsInvalid());
// Compute range start and end.
@ -2319,10 +2243,6 @@ bool FlowGraphAllocator::AllocateFreeRegister(LiveRange* unallocated) {
registers_[candidate]->Add(unallocated);
unallocated->set_assigned_location(MakeRegisterLocation(candidate));
#if defined(TARGET_ARCH_DBC)
last_used_register_ = Utils::Maximum(last_used_register_, candidate);
#endif
return true;
}
@ -2510,9 +2430,6 @@ void FlowGraphAllocator::AssignNonFreeRegister(LiveRange* unallocated,
registers_[reg]->Add(unallocated);
unallocated->set_assigned_location(MakeRegisterLocation(reg));
#if defined(TARGET_ARCH_DBC)
last_used_register_ = Utils::Maximum(last_used_register_, reg);
#endif
}
bool FlowGraphAllocator::EvictIntersection(LiveRange* allocated,
@ -2595,16 +2512,10 @@ void FlowGraphAllocator::ConvertAllUses(LiveRange* range) {
if (loc.IsMachineRegister()) {
for (SafepointPosition* safepoint = range->first_safepoint();
safepoint != NULL; safepoint = safepoint->next()) {
#if !defined(TARGET_ARCH_DBC)
if (!safepoint->locs()->always_calls()) {
ASSERT(safepoint->locs()->can_call());
safepoint->locs()->live_registers()->Add(loc, range->representation());
}
#else
if (range->representation() == kTagged) {
safepoint->locs()->SetStackBit(loc.reg());
}
#endif // !defined(TARGET_ARCH_DBC)
}
}
}
@ -2984,10 +2895,6 @@ void FlowGraphAllocator::AllocateRegisters() {
NumberInstructions();
#if defined(TARGET_ARCH_DBC)
last_used_register_ = -1;
#endif
BuildLiveRanges();
if (FLAG_print_ssa_liveranges) {
@ -3011,16 +2918,6 @@ void FlowGraphAllocator::AllocateRegisters() {
PrepareForAllocation(Location::kRegister, kNumberOfCpuRegisters,
unallocated_cpu_, cpu_regs_, blocked_cpu_registers_);
AllocateUnallocatedRanges();
#if defined(TARGET_ARCH_DBC)
const intptr_t last_used_cpu_register = last_used_register_;
last_used_register_ = -1;
#endif
#if defined(TARGET_ARCH_DBC)
// Spilling is unsupported on DBC.
ASSERT(spill_slots_.length() == 0);
cpu_spill_slot_count_ = 0;
#else
// GraphEntryInstr::fixed_slot_count() stack slots are reserved for catch
// entries. When allocating a spill slot, AllocateSpillSlotFor() accounts for
// these reserved slots and allocates spill slots on top of them.
@ -3028,24 +2925,13 @@ void FlowGraphAllocator::AllocateRegisters() {
// slots for catch entries in the spill area.
cpu_spill_slot_count_ = Utils::Maximum(
spill_slots_.length(), flow_graph_.graph_entry()->fixed_slot_count());
#endif
spill_slots_.Clear();
quad_spill_slots_.Clear();
untagged_spill_slots_.Clear();
PrepareForAllocation(Location::kFpuRegister, kNumberOfFpuRegisters,
unallocated_xmm_, fpu_regs_, blocked_fpu_registers_);
#if defined(TARGET_ARCH_DBC)
// For DBC all registers should have been allocated in the first pass.
ASSERT(unallocated_.is_empty());
#endif
AllocateUnallocatedRanges();
#if defined(TARGET_ARCH_DBC)
const intptr_t last_used_fpu_register = last_used_register_;
ASSERT(last_used_fpu_register == -1); // Not supported right now.
#endif
ResolveControlFlow();
GraphEntryInstr* entry = block_order_[0]->AsGraphEntry();
@ -3053,20 +2939,6 @@ void FlowGraphAllocator::AllocateRegisters() {
intptr_t double_spill_slot_count = spill_slots_.length() * kDoubleSpillFactor;
entry->set_spill_slot_count(cpu_spill_slot_count_ + double_spill_slot_count);
#if defined(TARGET_ARCH_DBC)
// Spilling is unsupported on DBC.
if (entry->spill_slot_count() != 0) {
UNREACHABLE();
}
// We store number of used DBC registers in the spill slot count to avoid
// introducing a separate field. It has roughly the same meaning:
// number of used registers determines how big of a frame to reserve for
// this function on DBC stack.
entry->set_spill_slot_count((last_used_cpu_register + 1) +
(last_used_fpu_register + 1));
#endif
if (FLAG_print_ssa_liveranges) {
const Function& function = flow_graph_.function();

View file

@ -295,10 +295,6 @@ class FlowGraphAllocator : public ValueObject {
intptr_t number_of_registers_;
#if defined(TARGET_ARCH_DBC)
intptr_t last_used_register_;
#endif
// Per register lists of allocated live ranges. Contain only those
// ranges that can be affected by future allocation decisions.
// Those live ranges that end before the start of the current live range are

View file

@ -141,12 +141,9 @@ Location LocationAnyOrConstant(Value* value) {
: Location::Any();
}
// DBC does not have an notion of 'address' in its instruction set.
#if !defined(TARGET_ARCH_DBC)
compiler::Address LocationToStackSlotAddress(Location loc) {
return compiler::Address(loc.base_reg(), loc.ToStackSlotOffset());
}
#endif
template <class Register, class FpuRegister>
intptr_t TemplateLocation<Register, FpuRegister>::ToStackSlotOffset() const {
@ -189,19 +186,6 @@ const char* TemplateLocation<Register, FpuRegister>::Name() const {
return "0";
}
UNREACHABLE();
#if TARGET_ARCH_DBC
case kSpecialDbcRegister:
switch (payload()) {
case kArgsDescriptorReg:
return "ArgDescReg";
case kExceptionReg:
return "ExceptionReg";
case kStackTraceReg:
return "StackTraceReg";
default:
UNREACHABLE();
}
#endif
default:
if (IsConstant()) {
return "C";
@ -269,27 +253,15 @@ TemplateLocation<Register, FpuRegister>::Copy() const {
}
Location LocationArgumentsDescriptorLocation() {
#ifdef TARGET_ARCH_DBC
return Location(Location::kSpecialDbcRegister, Location::kArgsDescriptorReg);
#else
return Location::RegisterLocation(ARGS_DESC_REG);
#endif
}
Location LocationExceptionLocation() {
#ifdef TARGET_ARCH_DBC
return Location(Location::kSpecialDbcRegister, Location::kExceptionReg);
#else
return Location::RegisterLocation(kExceptionObjectReg);
#endif
}
Location LocationStackTraceLocation() {
#ifdef TARGET_ARCH_DBC
return Location(Location::kSpecialDbcRegister, Location::kStackTraceReg);
#else
return Location::RegisterLocation(kStackTraceObjectReg);
#endif
}
Location LocationRemapForSlowPath(Location loc,

View file

@ -94,14 +94,6 @@ class TemplateLocation : public ValueObject {
static const uword kLocationTagMask = 0x3;
public:
#if defined(TARGET_ARCH_DBC)
enum SpecialDbcRegister{
kArgsDescriptorReg,
kExceptionReg,
kStackTraceReg,
};
#endif
// Constant payload can overlap with kind field so Kind values
// have to be chosen in a way that their last 2 bits are never
// the same as kConstantTag or kPairLocationTag.
@ -137,12 +129,6 @@ class TemplateLocation : public ValueObject {
// FpuRegister location represents a fixed fpu register. Payload contains
// its code.
kFpuRegister = 12,
#ifdef TARGET_ARCH_DBC
// We use this to signify a special `Location` where the different
// [SpecialDbcRegister]s can be found on DBC.
kSpecialDbcRegister = 15,
#endif
};
TemplateLocation() : value_(kInvalidLocation) {
@ -169,12 +155,6 @@ class TemplateLocation : public ValueObject {
COMPILE_ASSERT((kFpuRegister & kLocationTagMask) != kConstantTag);
COMPILE_ASSERT((kFpuRegister & kLocationTagMask) != kPairLocationTag);
#ifdef TARGET_ARCH_DBC
COMPILE_ASSERT((kSpecialDbcRegister & kLocationTagMask) != kConstantTag);
COMPILE_ASSERT((kSpecialDbcRegister & kLocationTagMask) !=
kPairLocationTag);
#endif
// Verify tags and tagmask.
COMPILE_ASSERT((kConstantTag & kLocationTagMask) == kConstantTag);
@ -295,22 +275,6 @@ class TemplateLocation : public ValueObject {
bool IsFpuRegister() const { return kind() == kFpuRegister; }
#ifdef TARGET_ARCH_DBC
bool IsArgsDescRegister() const {
return IsSpecialDbcRegister(kArgsDescriptorReg);
}
bool IsExceptionRegister() const {
return IsSpecialDbcRegister(kExceptionReg);
}
bool IsStackTraceRegister() const {
return IsSpecialDbcRegister(kStackTraceReg);
}
bool IsSpecialDbcRegister(SpecialDbcRegister reg) const {
return kind() == kSpecialDbcRegister && payload() == reg;
}
#endif
FpuRegister fpu_reg() const {
ASSERT(IsFpuRegister());
return static_cast<FpuRegister>(payload());
@ -493,11 +457,8 @@ Location LocationRemapForSlowPath(Location loc,
intptr_t* cpu_reg_slots,
intptr_t* fpu_reg_slots);
// DBC does not have an notion of 'address' in its instruction set.
#if !defined(TARGET_ARCH_DBC)
// Return a memory operand for stack slot locations.
compiler::Address LocationToStackSlotAddress(Location loc);
#endif
template <class Location>
class TemplatePairLocation : public ZoneAllocated {
@ -608,7 +569,6 @@ class RegisterSet : public ValueObject {
#endif
}
#if !defined(TARGET_ARCH_DBC)
void AddAllArgumentRegisters() {
// All (native) arguments are passed on the stack in IA32.
#if !defined(TARGET_ARCH_IA32)
@ -626,7 +586,6 @@ class RegisterSet : public ValueObject {
}
#endif
}
#endif
void Add(Location loc, Representation rep = kTagged) {
if (loc.IsRegister()) {
@ -785,12 +744,8 @@ class LocationSummary : public ZoneAllocated {
void set_out(intptr_t index, Location loc) {
ASSERT(index == 0);
// DBC calls are different from call on other architectures so this
// assert doesn't make sense.
#if !defined(TARGET_ARCH_DBC)
ASSERT(!always_calls() || (loc.IsMachineRegister() || loc.IsInvalid() ||
loc.IsPairLocation()));
#endif
output_location_ = loc;
}

View file

@ -430,8 +430,6 @@ void InvokeEmitter(
#include "vm/compiler/backend/locations_helpers_arm.h"
#elif defined(TARGET_ARCH_ARM64)
#elif defined(TARGET_ARCH_DBC)
#else
#error Unknown architecture.
#endif

View file

@ -9,8 +9,6 @@
namespace dart {
#if !defined(TARGET_ARCH_DBC)
#define Reg(index) (static_cast<Register>(index))
#define Fpu(index) (static_cast<FpuRegister>(index))
@ -233,6 +231,4 @@ INSTRUCTION_TEST(FixedTemp,
EXPECT_EQ(Fpu(3), Fpu(temp));
}
#endif // !defined(TARGET_ARCH_DBC)
} // namespace dart

View file

@ -368,7 +368,6 @@ ISOLATE_UNIT_TEST_CASE(NonStrictConditionUp) {
EXPECT_STREQ(expected, ComputeInduction(thread, script_chars));
}
#ifndef TARGET_ARCH_DBC
ISOLATE_UNIT_TEST_CASE(NonStrictConditionUpWrap) {
const char* script_chars =
R"(
@ -392,7 +391,6 @@ ISOLATE_UNIT_TEST_CASE(NonStrictConditionUpWrap) {
" ]\n";
EXPECT_STREQ(expected, ComputeInduction(thread, script_chars));
}
#endif
ISOLATE_UNIT_TEST_CASE(NonStrictConditionDown) {
const char* script_chars =
@ -413,7 +411,6 @@ ISOLATE_UNIT_TEST_CASE(NonStrictConditionDown) {
EXPECT_STREQ(expected, ComputeInduction(thread, script_chars));
}
#ifndef TARGET_ARCH_DBC
ISOLATE_UNIT_TEST_CASE(NonStrictConditionDownWrap) {
const char* script_chars =
R"(
@ -438,8 +435,6 @@ ISOLATE_UNIT_TEST_CASE(NonStrictConditionDownWrap) {
EXPECT_STREQ(expected, ComputeInduction(thread, script_chars));
}
#endif
ISOLATE_UNIT_TEST_CASE(NotEqualConditionUp) {
const char* script_chars =
R"(

View file

@ -13,7 +13,7 @@
namespace dart {
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC)
#if defined(DART_PRECOMPILER)
// This test asserts that we are inlining accesses to typed data interfaces
// (e.g. Uint8List) if there are no instantiated 3rd party classes.
@ -445,6 +445,6 @@ ISOLATE_UNIT_TEST_CASE(IRTest_TypedDataAOT_FunctionalIndexError) {
}
}
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC)
#endif // defined(DART_PRECOMPILER)
} // namespace dart

View file

@ -13,7 +13,6 @@ compiler_sources = [
"asm_intrinsifier.h",
"asm_intrinsifier_arm.cc",
"asm_intrinsifier_arm64.cc",
"asm_intrinsifier_dbc.cc",
"asm_intrinsifier_ia32.cc",
"asm_intrinsifier_x64.cc",
"assembler/assembler.cc",
@ -22,8 +21,6 @@ compiler_sources = [
"assembler/assembler_arm.h",
"assembler/assembler_arm64.cc",
"assembler/assembler_arm64.h",
"assembler/assembler_dbc.cc",
"assembler/assembler_dbc.h",
"assembler/assembler_ia32.cc",
"assembler/assembler_ia32.h",
"assembler/assembler_x64.cc",
@ -32,7 +29,6 @@ compiler_sources = [
"assembler/disassembler.h",
"assembler/disassembler_arm.cc",
"assembler/disassembler_arm64.cc",
"assembler/disassembler_dbc.cc",
"assembler/disassembler_kbc.cc",
"assembler/disassembler_kbc.h",
"assembler/disassembler_x86.cc",
@ -57,14 +53,12 @@ compiler_sources = [
"backend/flow_graph_compiler.h",
"backend/flow_graph_compiler_arm.cc",
"backend/flow_graph_compiler_arm64.cc",
"backend/flow_graph_compiler_dbc.cc",
"backend/flow_graph_compiler_ia32.cc",
"backend/flow_graph_compiler_x64.cc",
"backend/il.cc",
"backend/il.h",
"backend/il_arm.cc",
"backend/il_arm64.cc",
"backend/il_dbc.cc",
"backend/il_deserializer.cc",
"backend/il_deserializer.h",
"backend/il_ia32.cc",
@ -151,26 +145,13 @@ compiler_sources = [
"stub_code_compiler.h",
"stub_code_compiler_arm.cc",
"stub_code_compiler_arm64.cc",
"stub_code_compiler_dbc.cc",
"stub_code_compiler_ia32.cc",
"stub_code_compiler_x64.cc",
]
# The most common way to include assembly files in C projects is to have
# separate assembly files per architecture and operating system (for example
# boringssl).
#
# Not that this diverges from our convention to build every file on every OS
# but have ifdef guards which make the files empty on some configurations.
if (is_linux || is_mac) {
# MASM on Windows does not support c preproccesor style flags.
compiler_sources += [ "ffi_dbc_trampoline_x64_linux_mac.S" ]
}
compiler_sources_tests = [
"assembler/assembler_arm64_test.cc",
"assembler/assembler_arm_test.cc",
"assembler/assembler_dbc_test.cc",
"assembler/assembler_ia32_test.cc",
"assembler/assembler_test.cc",
"assembler/assembler_x64_test.cc",

View file

@ -137,28 +137,8 @@ static_assert(offsetof(AbiAlignmentUint64, i) == 8,
#error "Unknown platform. Please add alignment requirements for ABI."
#endif
#if defined(TARGET_ARCH_DBC)
static Abi HostAbi() {
#if defined(HOST_ARCH_X64) || defined(HOST_ARCH_ARM64)
return Abi::kWordSize64;
#elif (defined(HOST_ARCH_IA32) && /* NOLINT(whitespace/parens) */ \
(defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \
defined(HOST_OS_ANDROID))) || \
(defined(HOST_ARCH_ARM) && defined(HOST_OS_IOS))
return Abi::kWordSize32Align32;
#elif defined(HOST_ARCH_IA32) && defined(HOST_OS_WINDOWS) || \
defined(HOST_ARCH_ARM)
return Abi::kWordSize32Align64;
#else
#error "Unknown platform. Please add alignment requirements for ABI."
#endif
}
#endif // defined(TARGET_ARCH_DBC)
Abi TargetAbi() {
#if defined(TARGET_ARCH_DBC)
return HostAbi();
#elif defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64)
#if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64)
return Abi::kWordSize64;
#elif (defined(TARGET_ARCH_IA32) && /* NOLINT(whitespace/parens) */ \
(defined(TARGET_OS_LINUX) || defined(TARGET_OS_MACOS) || \
@ -260,8 +240,6 @@ Representation ResultRepresentationBase(const Function& signature) {
return rep;
}
#if !defined(TARGET_ARCH_DBC)
RawFunction* NativeCallbackFunction(const Function& c_signature,
const Function& dart_target,
const Instance& exceptional_return) {
@ -323,8 +301,6 @@ Representation ResultRepresentation(const Function& signature) {
return ResultRepresentationBase<CallingConventions>(signature);
}
#endif // !defined(TARGET_ARCH_DBC)
#if defined(USING_SIMULATOR)
ZoneGrowableArray<Representation>* ArgumentHostRepresentations(
@ -459,7 +435,6 @@ class ArgumentAllocator : public ValueObject {
intptr_t stack_height_in_slots = 0;
};
#if !defined(TARGET_ARCH_DBC)
ZoneGrowableArray<Location>*
CallbackArgumentTranslator::TranslateArgumentLocations(
const ZoneGrowableArray<Location>& arg_locs) {
@ -528,7 +503,6 @@ Location CallbackArgumentTranslator::TranslateArgument(Location arg) {
argument_slots_used_ += 8 / target::kWordSize;
return result;
}
#endif // !defined(TARGET_ARCH_DBC)
// Takes a list of argument representations, and converts it to a list of
// argument locations based on calling convention.
@ -553,33 +527,11 @@ ZoneGrowableArray<Location>* ArgumentLocationsBase(
ZoneGrowableArray<Location>* ArgumentLocations(
const ZoneGrowableArray<Representation>& arg_reps) {
#if !defined(TARGET_ARCH_DBC)
return ArgumentLocationsBase<dart::CallingConventions, Location,
dart::Register, dart::FpuRegister>(arg_reps);
#else
intptr_t next_free_register = ffi::kFirstArgumentRegister;
intptr_t num_arguments = arg_reps.length();
auto result = new ZoneGrowableArray<Location>(num_arguments);
for (intptr_t i = 0; i < num_arguments; i++) {
// TODO(dacoharkes): In 32 bits, use pair locations.
result->Add(Location::RegisterLocation(next_free_register));
next_free_register++;
}
return result;
#endif
}
#if defined(TARGET_ARCH_DBC)
ZoneGrowableArray<HostLocation>* HostArgumentLocations(
const ZoneGrowableArray<Representation>& arg_reps) {
return ArgumentLocationsBase<dart::host::CallingConventions, HostLocation,
dart::host::Register, dart::host::FpuRegister>(
arg_reps);
}
#endif
Location ResultLocation(Representation result_rep) {
#ifndef TARGET_ARCH_DBC
switch (result_rep) {
case kUnboxedFloat:
case kUnboxedDouble:
@ -604,10 +556,6 @@ Location ResultLocation(Representation result_rep) {
default:
UNREACHABLE();
}
#else
// TODO(dacoharkes): Support 64 bit result values on 32 bit DBC.
return Location::RegisterLocation(0);
#endif
}
// TODO(36607): Cache the trampolines.
@ -675,85 +623,6 @@ intptr_t NumStackSlots(const ZoneGrowableArray<Location>& locations) {
return TemplateNumStackSlots(locations);
}
#if defined(TARGET_ARCH_DBC)
static RawTypedData* typed_data_new_uintptr(intptr_t length) {
#if defined(ARCH_IS_32_BIT)
return TypedData::New(kTypedDataUint32ArrayCid, length);
#else
return TypedData::New(kTypedDataUint64ArrayCid, length);
#endif
}
static void typed_data_set_uintptr(const TypedData& typed_data,
intptr_t index,
uintptr_t value) {
#if defined(ARCH_IS_32_BIT)
typed_data.SetUint32(target::kWordSize * index, value);
#else
typed_data.SetUint64(target::kWordSize * index, value);
#endif
}
static uintptr_t typed_data_get_uintptr(const TypedData& typed_data,
intptr_t index) {
#if defined(ARCH_IS_32_BIT)
return typed_data.GetUint32(target::kWordSize * index);
#else
return typed_data.GetUint64(target::kWordSize * index);
#endif
}
// Number of host stack slots used in 'locations'.
static intptr_t HostNumStackSlots(
const ZoneGrowableArray<HostLocation>& locations) {
return TemplateNumStackSlots(locations);
}
RawTypedData* FfiSignatureDescriptor::New(
const ZoneGrowableArray<HostLocation>& arg_host_locations,
const Representation result_representation) {
const uintptr_t num_arguments = arg_host_locations.length();
const uintptr_t num_stack_slots = HostNumStackSlots(arg_host_locations);
const TypedData& result = TypedData::Handle(
typed_data_new_uintptr(kOffsetArgumentLocations + num_arguments));
typed_data_set_uintptr(result, kOffsetNumArguments, num_arguments);
typed_data_set_uintptr(result, kOffsetNumStackSlots, num_stack_slots);
typed_data_set_uintptr(result, kOffsetResultRepresentation,
result_representation);
for (uintptr_t i = 0; i < num_arguments; i++) {
typed_data_set_uintptr(result, kOffsetArgumentLocations + i,
arg_host_locations.At(i).write());
}
return result.raw();
}
intptr_t FfiSignatureDescriptor::length() const {
return typed_data_get_uintptr(typed_data_, kOffsetNumArguments);
}
intptr_t FfiSignatureDescriptor::num_stack_slots() const {
return typed_data_get_uintptr(typed_data_, kOffsetNumStackSlots);
}
HostLocation FfiSignatureDescriptor::LocationAt(intptr_t index) const {
return HostLocation::read(
typed_data_get_uintptr(typed_data_, kOffsetArgumentLocations + index));
}
Representation FfiSignatureDescriptor::ResultRepresentation() const {
uintptr_t result_int =
typed_data_get_uintptr(typed_data_, kOffsetResultRepresentation);
ASSERT(result_int < kNumRepresentations);
return static_cast<Representation>(result_int);
}
#endif // defined(TARGET_ARCH_DBC)
#endif // !defined(DART_PRECOMPILED_RUNTIME)
} // namespace ffi

View file

@ -60,8 +60,6 @@ Location ResultLocation(Representation result_rep);
RawFunction* TrampolineFunction(const Function& dart_signature,
const Function& c_signature);
#if !defined(TARGET_ARCH_DBC)
RawFunction* NativeCallbackFunction(const Function& c_signature,
const Function& dart_target,
const Instance& exceptional_return);
@ -73,19 +71,6 @@ ZoneGrowableArray<Representation>* ArgumentRepresentations(
// Unboxed representation of the result of a C signature function.
Representation ResultRepresentation(const Function& signature);
#endif // !defined(TARGET_ARCH_DBC)
#if defined(USING_SIMULATOR)
// Unboxed host representations of the arguments to a C signature function.
ZoneGrowableArray<Representation>* ArgumentHostRepresentations(
const Function& signature);
// Unboxed host representation of the result of a C signature function.
Representation ResultHostRepresentation(const Function& signature);
#endif // defined(USING_SIMULATOR)
// Location for the arguments of a C signature function.
ZoneGrowableArray<Location>* ArgumentLocations(
const ZoneGrowableArray<Representation>& arg_reps);
@ -93,44 +78,6 @@ ZoneGrowableArray<Location>* ArgumentLocations(
// Number of stack slots used in 'locations'.
intptr_t NumStackSlots(const ZoneGrowableArray<Location>& locations);
#if defined(TARGET_ARCH_DBC)
// The first argument to a ffi trampoline is the function address, the arguments
// to the call follow the function address.
const intptr_t kFunctionAddressRegister = 0;
const intptr_t kFirstArgumentRegister = 1;
// Location in host for the arguments of a C signature function.
ZoneGrowableArray<HostLocation>* HostArgumentLocations(
const ZoneGrowableArray<Representation>& arg_reps);
// A signature descriptor consists of the signature length, argument locations,
// and result representation.
class FfiSignatureDescriptor : public ValueObject {
public:
explicit FfiSignatureDescriptor(const TypedData& typed_data)
: typed_data_(typed_data) {}
static RawTypedData* New(
const ZoneGrowableArray<HostLocation>& arg_host_locations,
const Representation result_representation);
intptr_t length() const;
intptr_t num_stack_slots() const;
HostLocation LocationAt(intptr_t index) const;
Representation ResultRepresentation() const;
private:
const TypedData& typed_data_;
static const intptr_t kOffsetNumArguments = 0;
static const intptr_t kOffsetNumStackSlots = 1;
static const intptr_t kOffsetResultRepresentation = 2;
static const intptr_t kOffsetArgumentLocations = 3;
};
#else // defined(TARGET_ARCH_DBC)
// This classes translates the ABI location of arguments into the locations they
// will inhabit after entry-frame setup in the invocation of a native callback.
//
@ -155,7 +102,6 @@ class CallbackArgumentTranslator : public ValueObject {
intptr_t argument_slots_used_ = 0;
intptr_t argument_slots_required_ = 0;
};
#endif // defined(TARGET_ARCH_DBC)
} // namespace ffi

View file

@ -1,28 +0,0 @@
// Copyright (c) 2019, 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.
#ifndef RUNTIME_VM_COMPILER_FFI_DBC_TRAMPOLINE_H_
#define RUNTIME_VM_COMPILER_FFI_DBC_TRAMPOLINE_H_
#include "vm/globals.h"
namespace dart {
#if defined(HOST_ARCH_X64) && !defined(HOST_OS_WINDOWS)
// Generic Trampoline for DBC dart:ffi calls. Argument needs to be layed out as
// a FfiMarshalledArguments.
extern "C" void FfiTrampolineCall(uint64_t* ffi_marshalled_args);
#else
void FfiTrampolineCall(uint64_t* ffi_marshalled_args) {
UNREACHABLE();
}
#endif // defined(HOST_ARCH_X64) && !defined(HOST_OS_WINDOWS)
} // namespace dart
#endif // RUNTIME_VM_COMPILER_FFI_DBC_TRAMPOLINE_H_

View file

@ -1,77 +0,0 @@
#if defined(_M_X64) || defined(__x86_64__) /* HOST_ARCH_X64 */
.intel_syntax noprefix
.text
#if defined(__linux__) || defined(__FreeBSD__) /* HOST_OS_LINUX */
.globl FfiTrampolineCall
.type FfiTrampolineCall, @function
FfiTrampolineCall:
#else /* HOST_OS_MACOS */
.globl _FfiTrampolineCall
_FfiTrampolineCall:
#endif
/* Save argument in scratch register. */
push rbx /* Backup caller saved register. */
mov rbx, rdi /* Save argument in scratch register. */
/* Enter frame. */
push rbp
mov rbp, rsp
/* Reserve framespace for arguments. */
mov rax, [rbx+0x80] /* Load number of stack arguments. */
shl rax, 3 /* Multiply by size (8 bytes). */
sub rsp, rax /* Reserve num_stack_args stack slots. */
/* Stack alignment. */
and rsp, [rbx+0x78] /* Align stack with stack alignment mask. */
/* Copy stack arguments. */
cmp rax, 0x0 /* Check if number of stack arguments is 0. */
jz .done /* Skip loop if no stack arguments. */
add rsp, rax /* Unreserve stack slots so we can push arguments. */
add rbx, 0x80 /* Offset RBX to point to stack arguments */
.loop: /* Copy stack arguments loop. */
push [rbx+rax] /* Push stack argument. */
sub rax, 0x8 /* Decrement stack argument iterator. */
cmp rax, 0x0 /* Compare iterator with 0 */
jnz .loop /* Loop while iterator is not 0 */
sub rbx, 0x80 /* Restore RBX to original value. */
.done: /* End stack arguments loop. */
/* Copy registers and fpu registers. */
mov rdi, [rbx+0x8] /* kArg1Reg */
mov rsi, [rbx+0x10] /* kArg2Reg */
mov rdx, [rbx+0x18] /* kArg3Reg */
mov rcx, [rbx+0x20] /* kArg4Reg */
mov r8, [rbx+0x28] /* kArg5Reg */
mov r9, [rbx+0x30] /* kArg6Reg */
movsd xmm0, [rbx+0x38]
movsd xmm1, [rbx+0x40]
movsd xmm2, [rbx+0x48]
movsd xmm3, [rbx+0x50]
movsd xmm4, [rbx+0x58]
movsd xmm5, [rbx+0x60]
movsd xmm6, [rbx+0x68]
movsd xmm7, [rbx+0x70]
/* Do call. */
mov rax, [rbx] /* function address */
call rax /* Call the function. */
/* Copy results back. */
mov [rbx], rax /* Move integer result in kOffsetIntResult */
movsd [rbx+8], xmm0 /* Move double result in kOffsetDoubleResult */
/* leave frame */
mov rsp, rbp
pop rbp
/* Restore caller saved register. */
pop rbx
ret
#endif /* HOST_ARCH_X64 */

View file

@ -1935,9 +1935,6 @@ void BytecodeFlowGraphBuilder::BuildFfiAsFunction() {
// static tearoff
// <type args> => [NativeSignatureType]
void BytecodeFlowGraphBuilder::BuildFfiNativeCallbackFunction() {
#if defined(TARGET_ARCH_DBC)
UNREACHABLE();
#else
const TypeArguments& type_args =
TypeArguments::Cast(B->Peek(/*depth=*/2)->AsConstant()->value());
ASSERT(type_args.IsInstantiated() && type_args.Length() == 1);
@ -1959,7 +1956,6 @@ void BytecodeFlowGraphBuilder::BuildFfiNativeCallbackFunction() {
native_sig, target, exceptional_return));
code_ += B->Constant(result);
code_ += B->DropTempsPreserveTop(3);
#endif
}
void BytecodeFlowGraphBuilder::BuildDebugStepCheck() {

View file

@ -2213,14 +2213,12 @@ Fragment StreamingFlowGraphBuilder::BuildPropertySet(TokenPosition* p) {
// True if callee can skip argument type checks.
bool is_unchecked_call = inferred_type.IsSkipCheck();
#ifndef TARGET_ARCH_DBC
if (call_site_attributes.receiver_type != nullptr &&
call_site_attributes.receiver_type->HasTypeClass() &&
!Class::Handle(call_site_attributes.receiver_type->type_class())
.IsGeneric()) {
is_unchecked_call = true;
}
#endif
Fragment instructions(MakeTemp());
LocalVariable* variable = MakeTemporary();
@ -5154,9 +5152,6 @@ Fragment StreamingFlowGraphBuilder::BuildFfiAsFunctionInternal() {
}
Fragment StreamingFlowGraphBuilder::BuildFfiNativeCallbackFunction() {
#if defined(TARGET_ARCH_DBC)
UNREACHABLE();
#else
// The call-site must look like this (guaranteed by the FE which inserts it):
//
// _nativeCallbackFunction<NativeSignatureType>(target, exceptionalReturn)
@ -5209,7 +5204,6 @@ Fragment StreamingFlowGraphBuilder::BuildFfiNativeCallbackFunction() {
native_sig, target, exceptional_return));
code += Constant(result);
return code;
#endif
}
} // namespace kernel

View file

@ -676,8 +676,6 @@ bool FlowGraphBuilder::IsRecognizedMethodForFlowGraph(
const MethodRecognizer::Kind kind = MethodRecognizer::RecognizeKind(function);
switch (kind) {
// On simdbc and the bytecode interpreter we fall back to natives.
#if !defined(TARGET_ARCH_DBC)
case MethodRecognizer::kTypedData_ByteDataView_factory:
case MethodRecognizer::kTypedData_Int8ArrayView_factory:
case MethodRecognizer::kTypedData_Uint8ArrayView_factory:
@ -719,7 +717,6 @@ bool FlowGraphBuilder::IsRecognizedMethodForFlowGraph(
case MethodRecognizer::kFfiStorePointer:
case MethodRecognizer::kFfiFromAddress:
case MethodRecognizer::kFfiGetAddress:
#endif // !defined(TARGET_ARCH_DBC)
// This list must be kept in sync with BytecodeReaderHelper::NativeEntry in
// runtime/vm/compiler/frontend/bytecode_reader.cc and implemented in the
// bytecode interpreter in runtime/vm/interpreter.cc. Alternatively, these
@ -780,8 +777,6 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfRecognizedMethod(
const MethodRecognizer::Kind kind = MethodRecognizer::RecognizeKind(function);
switch (kind) {
// On simdbc we fall back to natives.
#if !defined(TARGET_ARCH_DBC)
case MethodRecognizer::kTypedData_ByteDataView_factory:
body += BuildTypedDataViewFactoryConstructor(function, kByteDataViewCid);
break;
@ -841,7 +836,6 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfRecognizedMethod(
body += BuildTypedDataViewFactoryConstructor(
function, kTypedDataFloat64x2ArrayViewCid);
break;
#endif // !defined(TARGET_ARCH_DBC)
case MethodRecognizer::kObjectEquals:
ASSERT(function.NumParameters() == 2);
body += LoadLocal(parsed_function_->RawParameterVariable(0));
@ -2638,14 +2632,12 @@ Fragment FlowGraphBuilder::FfiUnboxedExtend(Representation representation,
return Fragment(extend);
}
#if !defined(TARGET_ARCH_DBC)
Fragment FlowGraphBuilder::NativeReturn(Representation result) {
auto* instr = new (Z)
NativeReturnInstr(TokenPosition::kNoSource, Pop(), result,
compiler::ffi::ResultLocation(result), DeoptId::kNone);
return Fragment(instr);
}
#endif
Fragment FlowGraphBuilder::FfiPointerFromAddress(const Type& result_type) {
LocalVariable* address = MakeTemporary();
@ -2764,13 +2756,8 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfFfiNative(const Function& function) {
body += CheckStackOverflowInPrologue(function.token_pos());
const Function& signature = Function::ZoneHandle(Z, function.FfiCSignature());
#if !defined(TARGET_ARCH_DBC)
const auto& arg_reps = *compiler::ffi::ArgumentRepresentations(signature);
const ZoneGrowableArray<HostLocation>* arg_host_locs = nullptr;
#else
const auto& arg_reps = *compiler::ffi::ArgumentHostRepresentations(signature);
const auto* arg_host_locs = compiler::ffi::HostArgumentLocations(arg_reps);
#endif
const auto& arg_locs = *compiler::ffi::ArgumentLocations(arg_reps);
BuildArgumentTypeChecks(TypeChecksToBuild::kCheckAllTypeParameterBounds,
@ -2796,13 +2783,8 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfFfiNative(const Function& function) {
body += FfiCall(signature, arg_reps, arg_locs, arg_host_locs);
ffi_type = signature.result_type();
#if !defined(TARGET_ARCH_DBC)
const Representation from_rep =
compiler::ffi::ResultRepresentation(signature);
#else
const Representation from_rep =
compiler::ffi::ResultHostRepresentation(signature);
#endif // !defined(TARGET_ARCH_DBC)
body += FfiConvertArgumentToDart(ffi_type, from_rep);
body += Return(TokenPosition::kNoSource);
@ -2811,7 +2793,6 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfFfiNative(const Function& function) {
}
FlowGraph* FlowGraphBuilder::BuildGraphOfFfiCallback(const Function& function) {
#if !defined(TARGET_ARCH_DBC)
const Function& signature = Function::ZoneHandle(Z, function.FfiCSignature());
const auto& arg_reps = *compiler::ffi::ArgumentRepresentations(signature);
const auto& arg_locs = *compiler::ffi::ArgumentLocations(arg_reps);
@ -2893,9 +2874,6 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfFfiCallback(const Function& function) {
PrologueInfo prologue_info(-1, -1);
return new (Z) FlowGraph(*parsed_function_, graph_entry_, last_used_block_id_,
prologue_info);
#else
UNREACHABLE();
#endif
}
void FlowGraphBuilder::SetCurrentTryCatchBlock(TryCatchBlock* try_catch_block) {

View file

@ -3,8 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
// Class for intrinsifying functions.
// DBC does not use graph intrinsics.
#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(TARGET_ARCH_DBC)
#if !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/graph_intrinsifier.h"
#include "vm/compiler/backend/block_builder.h"
@ -989,4 +988,4 @@ bool GraphIntrinsifier::Build_DoubleRound(FlowGraph* flow_graph) {
} // namespace compiler
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME) && !defined(TARGET_ARCH_DBC)
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -20,8 +20,6 @@ namespace compiler {
class Assembler;
class Label;
#if !defined(TARGET_ARCH_DBC)
class GraphIntrinsifier : public AllStatic {
public:
static intptr_t ParameterSlotFromSp();
@ -36,7 +34,6 @@ class GraphIntrinsifier : public AllStatic {
#define DECLARE_FUNCTION(class_name, function_name, enum_name, fp) \
static void enum_name(Assembler* assembler, Label* normal_ir_body);
// On DBC graph intrinsics are handled in the same way as non-graph ones.
GRAPH_INTRINSICS_LIST(DECLARE_FUNCTION)
#undef DECLARE_FUNCTION
@ -49,18 +46,6 @@ class GraphIntrinsifier : public AllStatic {
#undef DECLARE_FUNCTION
};
#else // !defined(TARGET_ARCH_DBC)
class GraphIntrinsifier : public AllStatic {
public:
static bool GraphIntrinsify(const ParsedFunction& parsed_function,
FlowGraphCompiler* compiler) {
return false;
}
};
#endif // !defined(TARGET_ARCH_DBC)
} // namespace compiler
} // namespace dart

View file

@ -198,7 +198,7 @@ bool Intrinsifier::Intrinsify(const ParsedFunction& parsed_function,
}
#endif
#if !defined(PRODUCT) && !defined(TARGET_ARCH_DBC)
#if !defined(PRODUCT)
#define EMIT_BREAKPOINT() compiler->assembler()->Breakpoint()
#else
#define EMIT_BREAKPOINT()
@ -230,16 +230,6 @@ bool Intrinsifier::Intrinsify(const ParsedFunction& parsed_function,
break;
}
// On DBC all graph intrinsics are handled in the same way as non-graph
// intrinsics.
#if defined(TARGET_ARCH_DBC)
switch (function.recognized_kind()) {
GRAPH_INTRINSICS_LIST(EMIT_CASE)
default:
break;
}
#endif
#undef EMIT_BREAKPOINT
#undef EMIT_INTRINSIC

View file

@ -878,8 +878,7 @@ static RawObject* CompileFunctionHelper(CompilationPipeline* pipeline,
}
RawObject* Compiler::CompileFunction(Thread* thread, const Function& function) {
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
!defined(TARGET_ARCH_IA32)
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
if (FLAG_precompiled_mode) {
return Precompiler::CompileFunction(
/* precompiler = */ NULL, thread, thread->zone(), function);

View file

@ -24,10 +24,6 @@
#define ARCH_DEF "defined(TARGET_ARCH_IA32)"
#elif defined(TARGET_ARCH_ARM64)
#define ARCH_DEF "defined(TARGET_ARCH_ARM64)"
#elif defined(TARGET_ARCH_DBC) && defined(TARGET_ARCH_IS_32_BIT)
#define ARCH_DEF "defined(TARGET_ARCH_DBC) && defined(TARGET_ARCH_IS_32_BIT)"
#elif defined(TARGET_ARCH_DBC) && defined(TARGET_ARCH_IS_64_BIT)
#define ARCH_DEF "defined(TARGET_ARCH_DBC) && defined(TARGET_ARCH_IS_64_BIT)"
#else
#error Unknown architecture
#endif

View file

@ -12,8 +12,7 @@
namespace dart {
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
!defined(TARGET_ARCH_IA32)
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
// Only for testing.
DEFINE_FLAG(bool,
@ -512,7 +511,6 @@ intptr_t CodeRelocator::FindDestinationInText(
offset_into_target;
}
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
// !defined(TARGET_ARCH_IA32)
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
} // namespace dart

View file

@ -14,8 +14,7 @@
namespace dart {
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
!defined(TARGET_ARCH_IA32)
#if defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
// Represents a pc-relative call which has not been patched up with the final
// destination.
@ -208,8 +207,7 @@ class CodeRelocator : public StackResource {
Code& destination_;
};
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
// !defined(TARGET_ARCH_IA32)
#endif // defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_IA32)
} // namespace dart

View file

@ -208,7 +208,6 @@ uword SymbolsPredefinedAddress() {
}
#endif
#if !defined(TARGET_ARCH_DBC)
const Code& StubCodeAllocateArray() {
return dart::StubCode::AllocateArray();
}
@ -220,7 +219,6 @@ const Code& StubCodeSubtype2TestCache() {
const Code& StubCodeSubtype6TestCache() {
return dart::StubCode::Subtype6TestCache();
}
#endif // !defined(TARGET_ARCH_DBC)
#define DEFINE_ALIAS(name) \
const RuntimeEntry& k##name##RuntimeEntry(dart::k##name##RuntimeEntry);
@ -508,12 +506,10 @@ word Instructions::HeaderSize() {
return Utils::RoundUp(Instructions::UnalignedHeaderSize(), target::kWordSize);
}
#if !defined(TARGET_ARCH_DBC)
word Thread::stack_overflow_shared_stub_entry_point_offset(bool fpu_regs) {
return fpu_regs ? stack_overflow_shared_with_fpu_regs_entry_point_offset()
: stack_overflow_shared_without_fpu_regs_entry_point_offset();
}
#endif // !defined(TARGET_ARCH_DBC)
uword Thread::safepoint_state_unacquired() {
return dart::Thread::safepoint_state_unacquired();

View file

@ -189,11 +189,9 @@ typedef void (*RuntimeEntryCallInternal)(const dart::RuntimeEntry*,
Assembler*,
intptr_t);
#if !defined(TARGET_ARCH_DBC)
const Code& StubCodeAllocateArray();
const Code& StubCodeSubtype2TestCache();
const Code& StubCodeSubtype6TestCache();
#endif // !defined(TARGET_ARCH_DBC)
class RuntimeEntry : public ValueObject {
public:
@ -674,7 +672,6 @@ class Thread : public AllStatic {
static word callback_code_offset();
static word AllocateArray_entry_point_offset();
#if !defined(TARGET_ARCH_DBC)
static word write_barrier_code_offset();
static word array_write_barrier_code_offset();
static word fix_callers_target_code_offset();
@ -701,7 +698,6 @@ class Thread : public AllStatic {
static word exit_safepoint_stub_offset();
static word call_native_through_safepoint_stub_offset();
static word call_native_through_safepoint_entry_point_offset();
#endif // !defined(TARGET_ARCH_DBC)
static word no_scope_native_wrapper_entry_point_offset();
static word auto_scope_native_wrapper_entry_point_offset();

View file

@ -1456,583 +1456,4 @@ static constexpr dart::compiler::target::word Instance_InstanceSize = 8;
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 56;
#endif // defined(TARGET_ARCH_ARM64)
#if defined(TARGET_ARCH_DBC) && defined(TARGET_ARCH_IS_64_BIT)
static constexpr dart::compiler::target::word ObjectPool_elements_start_offset =
16;
static constexpr dart::compiler::target::word ObjectPool_element_size = 8;
static constexpr dart::compiler::target::word Array_kMaxElements =
576460752303423487;
static constexpr dart::compiler::target::word Array_kMaxNewSpaceElements =
32765;
static constexpr dart::compiler::target::word
Instructions_kMonomorphicEntryOffsetJIT = 0;
static constexpr dart::compiler::target::word
Instructions_kPolymorphicEntryOffsetJIT = 0;
static constexpr dart::compiler::target::word
Instructions_kMonomorphicEntryOffsetAOT = 0;
static constexpr dart::compiler::target::word
Instructions_kPolymorphicEntryOffsetAOT = 0;
static constexpr dart::compiler::target::word HeapPage_kBytesPerCardLog2 = 10;
static constexpr dart::compiler::target::word
NativeEntry_kNumCallWrapperArguments = 2;
static constexpr dart::compiler::target::word String_kMaxElements =
2305843009213693951;
static constexpr dart::compiler::target::word
SubtypeTestCache_kFunctionTypeArguments = 4;
static constexpr dart::compiler::target::word
SubtypeTestCache_kInstanceClassIdOrFunction = 1;
static constexpr dart::compiler::target::word
SubtypeTestCache_kInstanceDelayedFunctionTypeArguments = 6;
static constexpr dart::compiler::target::word
SubtypeTestCache_kInstanceParentFunctionTypeArguments = 5;
static constexpr dart::compiler::target::word
SubtypeTestCache_kInstanceTypeArguments = 2;
static constexpr dart::compiler::target::word
SubtypeTestCache_kInstantiatorTypeArguments = 3;
static constexpr dart::compiler::target::word
SubtypeTestCache_kTestEntryLength = 7;
static constexpr dart::compiler::target::word SubtypeTestCache_kTestResult = 0;
static constexpr dart::compiler::target::word
AbstractType_type_test_stub_entry_point_offset = 8;
static constexpr dart::compiler::target::word ArgumentsDescriptor_count_offset =
32;
static constexpr dart::compiler::target::word
ArgumentsDescriptor_first_named_entry_offset = 48;
static constexpr dart::compiler::target::word
ArgumentsDescriptor_named_entry_size = 16;
static constexpr dart::compiler::target::word ArgumentsDescriptor_name_offset =
0;
static constexpr dart::compiler::target::word
ArgumentsDescriptor_position_offset = 8;
static constexpr dart::compiler::target::word
ArgumentsDescriptor_positional_count_offset = 40;
static constexpr dart::compiler::target::word
ArgumentsDescriptor_type_args_len_offset = 24;
static constexpr dart::compiler::target::word Array_data_offset = 24;
static constexpr dart::compiler::target::word Array_length_offset = 16;
static constexpr dart::compiler::target::word Array_tags_offset = 0;
static constexpr dart::compiler::target::word Array_type_arguments_offset = 8;
static constexpr dart::compiler::target::word Class_declaration_type_offset =
112;
static constexpr dart::compiler::target::word Class_num_type_arguments_offset =
190;
static constexpr dart::compiler::target::word Class_super_type_offset = 88;
static constexpr dart::compiler::target::word
Class_type_arguments_field_offset_in_words_offset = 180;
static constexpr dart::compiler::target::word
ClassHeapStats_TraceAllocationMask = 1;
static constexpr dart::compiler::target::word
ClassHeapStats_allocated_since_gc_new_space_offset = 96;
static constexpr dart::compiler::target::word
ClassHeapStats_allocated_size_since_gc_new_space_offset = 104;
static constexpr dart::compiler::target::word ClassHeapStats_state_offset = 272;
static constexpr dart::compiler::target::word
ClassTable_shared_class_table_offset = 40;
static constexpr dart::compiler::target::word ClassTable_table_offset = 16;
static constexpr dart::compiler::target::word
SharedClassTable_class_heap_stats_table_offset = 0;
static constexpr dart::compiler::target::word Closure_context_offset = 40;
static constexpr dart::compiler::target::word
Closure_delayed_type_arguments_offset = 24;
static constexpr dart::compiler::target::word Closure_function_offset = 32;
static constexpr dart::compiler::target::word
Closure_function_type_arguments_offset = 16;
static constexpr dart::compiler::target::word Closure_hash_offset = 48;
static constexpr dart::compiler::target::word
Closure_instantiator_type_arguments_offset = 8;
static constexpr dart::compiler::target::word Code_object_pool_offset = 40;
static constexpr dart::compiler::target::word Code_saved_instructions_offset =
48;
static constexpr dart::compiler::target::word Code_owner_offset = 56;
static constexpr dart::compiler::target::word Context_num_variables_offset = 8;
static constexpr dart::compiler::target::word Context_parent_offset = 16;
static constexpr dart::compiler::target::word Double_value_offset = 8;
static constexpr dart::compiler::target::word
ExternalOneByteString_external_data_offset = 16;
static constexpr dart::compiler::target::word
ExternalTwoByteString_external_data_offset = 16;
static constexpr dart::compiler::target::word Float32x4_value_offset = 8;
static constexpr dart::compiler::target::word Float64x2_value_offset = 8;
static constexpr dart::compiler::target::word Field_guarded_cid_offset = 88;
static constexpr dart::compiler::target::word
Field_guarded_list_length_in_object_offset_offset = 96;
static constexpr dart::compiler::target::word Field_guarded_list_length_offset =
56;
static constexpr dart::compiler::target::word Field_is_nullable_offset = 90;
static constexpr dart::compiler::target::word Field_static_value_offset = 32;
static constexpr dart::compiler::target::word Field_kind_bits_offset = 98;
static constexpr dart::compiler::target::word Function_code_offset = 88;
static constexpr dart::compiler::target::word Function_entry_point_offset = 8;
static constexpr dart::compiler::target::word
Function_unchecked_entry_point_offset = 16;
static constexpr dart::compiler::target::word Function_usage_counter_offset =
132;
static constexpr dart::compiler::target::word GrowableObjectArray_data_offset =
24;
static constexpr dart::compiler::target::word
GrowableObjectArray_length_offset = 16;
static constexpr dart::compiler::target::word
GrowableObjectArray_type_arguments_offset = 8;
static constexpr dart::compiler::target::word HeapPage_card_table_offset = 40;
static constexpr dart::compiler::target::word ICData_NumArgsTestedMask = 3;
static constexpr dart::compiler::target::word ICData_NumArgsTestedShift = 0;
static constexpr dart::compiler::target::word
ICData_arguments_descriptor_offset = 24;
static constexpr dart::compiler::target::word ICData_entries_offset = 8;
static constexpr dart::compiler::target::word ICData_owner_offset = 40;
static constexpr dart::compiler::target::word ICData_state_bits_offset = 52;
static constexpr dart::compiler::target::word
ICData_receivers_static_type_offset = 32;
static constexpr dart::compiler::target::word Isolate_class_table_offset = 80;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 40;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 48;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 56;
static constexpr dart::compiler::target::word Isolate_object_store_offset = 72;
static constexpr dart::compiler::target::word Isolate_single_step_offset = 128;
static constexpr dart::compiler::target::word Isolate_user_tag_offset = 32;
static constexpr dart::compiler::target::word LinkedHashMap_data_offset = 32;
static constexpr dart::compiler::target::word
LinkedHashMap_deleted_keys_offset = 48;
static constexpr dart::compiler::target::word LinkedHashMap_hash_mask_offset =
24;
static constexpr dart::compiler::target::word LinkedHashMap_index_offset = 16;
static constexpr dart::compiler::target::word LinkedHashMap_used_data_offset =
40;
static constexpr dart::compiler::target::word
MarkingStackBlock_pointers_offset = 16;
static constexpr dart::compiler::target::word MarkingStackBlock_top_offset = 8;
static constexpr dart::compiler::target::word
MegamorphicCache_arguments_descriptor_offset = 32;
static constexpr dart::compiler::target::word MegamorphicCache_buckets_offset =
8;
static constexpr dart::compiler::target::word MegamorphicCache_mask_offset = 16;
static constexpr dart::compiler::target::word Mint_value_offset = 8;
static constexpr dart::compiler::target::word NativeArguments_argc_tag_offset =
8;
static constexpr dart::compiler::target::word NativeArguments_argv_offset = 16;
static constexpr dart::compiler::target::word NativeArguments_retval_offset =
24;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
128;
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 64;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
160;
static constexpr dart::compiler::target::word OneByteString_data_offset = 16;
static constexpr dart::compiler::target::word Pointer_c_memory_address_offset =
16;
static constexpr dart::compiler::target::word
SingleTargetCache_entry_point_offset = 16;
static constexpr dart::compiler::target::word
SingleTargetCache_lower_limit_offset = 24;
static constexpr dart::compiler::target::word SingleTargetCache_target_offset =
8;
static constexpr dart::compiler::target::word
SingleTargetCache_upper_limit_offset = 26;
static constexpr dart::compiler::target::word StoreBufferBlock_pointers_offset =
16;
static constexpr dart::compiler::target::word StoreBufferBlock_top_offset = 8;
static constexpr dart::compiler::target::word String_hash_offset = 4;
static constexpr dart::compiler::target::word String_length_offset = 8;
static constexpr dart::compiler::target::word SubtypeTestCache_cache_offset = 8;
static constexpr dart::compiler::target::word
Thread_AllocateArray_entry_point_offset = 304;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
896;
static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
904;
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
176;
static constexpr dart::compiler::target::word
Thread_auto_scope_native_wrapper_entry_point_offset = 224;
static constexpr dart::compiler::target::word Thread_bool_false_offset = 208;
static constexpr dart::compiler::target::word Thread_bool_true_offset = 200;
static constexpr dart::compiler::target::word Thread_dart_stream_offset = 968;
static constexpr dart::compiler::target::word Thread_double_abs_address_offset =
264;
static constexpr dart::compiler::target::word
Thread_double_negate_address_offset = 256;
static constexpr dart::compiler::target::word Thread_end_offset = 128;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
936;
static constexpr dart::compiler::target::word
Thread_float_absolute_address_offset = 288;
static constexpr dart::compiler::target::word
Thread_float_negate_address_offset = 280;
static constexpr dart::compiler::target::word Thread_float_not_address_offset =
272;
static constexpr dart::compiler::target::word
Thread_float_zerow_address_offset = 296;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
912;
static constexpr dart::compiler::target::word Thread_isolate_offset = 104;
static constexpr dart::compiler::target::word
Thread_marking_stack_block_offset = 152;
static constexpr dart::compiler::target::word
Thread_no_scope_native_wrapper_entry_point_offset = 216;
static constexpr dart::compiler::target::word Thread_object_null_offset = 192;
static constexpr dart::compiler::target::word
Thread_predefined_symbols_address_offset = 240;
static constexpr dart::compiler::target::word Thread_resume_pc_offset = 920;
static constexpr dart::compiler::target::word
Thread_saved_shadow_call_stack_offset = 928;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
944;
static constexpr dart::compiler::target::word Thread_stack_limit_offset = 72;
static constexpr dart::compiler::target::word Thread_saved_stack_limit_offset =
80;
static constexpr dart::compiler::target::word
Thread_stack_overflow_flags_offset = 88;
static constexpr dart::compiler::target::word Thread_store_buffer_block_offset =
144;
static constexpr dart::compiler::target::word
Thread_top_exit_frame_info_offset = 136;
static constexpr dart::compiler::target::word Thread_top_offset = 120;
static constexpr dart::compiler::target::word Thread_top_resource_offset = 48;
static constexpr dart::compiler::target::word
Thread_unboxed_int64_runtime_arg_offset = 184;
static constexpr dart::compiler::target::word Thread_vm_tag_offset = 168;
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
96;
static constexpr dart::compiler::target::word Thread_callback_code_offset = 952;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset =
16;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 16;
static constexpr dart::compiler::target::word Type_arguments_offset = 32;
static constexpr dart::compiler::target::word Type_hash_offset = 40;
static constexpr dart::compiler::target::word Type_signature_offset = 48;
static constexpr dart::compiler::target::word Type_type_class_id_offset = 24;
static constexpr dart::compiler::target::word Type_type_state_offset = 60;
static constexpr dart::compiler::target::word
TypeArguments_instantiations_offset = 8;
static constexpr dart::compiler::target::word TypeRef_type_offset = 24;
static constexpr dart::compiler::target::word TypedDataBase_data_field_offset =
8;
static constexpr dart::compiler::target::word TypedDataBase_length_offset = 16;
static constexpr dart::compiler::target::word TypedDataView_data_offset = 24;
static constexpr dart::compiler::target::word
TypedDataView_offset_in_bytes_offset = 32;
static constexpr dart::compiler::target::word TypedData_data_offset = 24;
static constexpr dart::compiler::target::word UserTag_tag_offset = 16;
static constexpr dart::compiler::target::word Array_elements_start_offset = 24;
static constexpr dart::compiler::target::word Array_element_size = 8;
static constexpr dart::compiler::target::word
TypeArguments_elements_start_offset = 32;
static constexpr dart::compiler::target::word TypeArguments_element_size = 8;
static constexpr dart::compiler::target::word ClassTable_elements_start_offset =
0;
static constexpr dart::compiler::target::word ClassTable_element_size = 288;
static constexpr dart::compiler::target::word Code_entry_point_offset[] = {
8, 24, 16, 32};
static constexpr dart::compiler::target::word
Code_function_entry_point_offset[] = {8, 16};
static constexpr dart::compiler::target::word Array_header_size = 24;
static constexpr dart::compiler::target::word Context_header_size = 24;
static constexpr dart::compiler::target::word Double_InstanceSize = 16;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Instructions_UnalignedHeaderSize =
16;
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Mint_InstanceSize = 16;
static constexpr dart::compiler::target::word NativeArguments_StructSize = 32;
static constexpr dart::compiler::target::word String_InstanceSize = 16;
static constexpr dart::compiler::target::word TypedData_InstanceSize = 24;
static constexpr dart::compiler::target::word Object_InstanceSize = 8;
static constexpr dart::compiler::target::word TypedDataBase_InstanceSize = 24;
static constexpr dart::compiler::target::word Closure_InstanceSize = 56;
static constexpr dart::compiler::target::word GrowableObjectArray_InstanceSize =
32;
static constexpr dart::compiler::target::word Instance_InstanceSize = 8;
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 56;
#endif // defined(TARGET_ARCH_DBC) && defined(TARGET_ARCH_IS_64_BIT)
#if defined(TARGET_ARCH_DBC) && defined(TARGET_ARCH_IS_32_BIT)
static constexpr dart::compiler::target::word ObjectPool_elements_start_offset =
8;
static constexpr dart::compiler::target::word ObjectPool_element_size = 4;
static constexpr dart::compiler::target::word Array_kMaxElements = 268435455;
static constexpr dart::compiler::target::word Array_kMaxNewSpaceElements =
65533;
static constexpr dart::compiler::target::word
Instructions_kMonomorphicEntryOffsetJIT = 0;
static constexpr dart::compiler::target::word
Instructions_kPolymorphicEntryOffsetJIT = 0;
static constexpr dart::compiler::target::word
Instructions_kMonomorphicEntryOffsetAOT = 0;
static constexpr dart::compiler::target::word
Instructions_kPolymorphicEntryOffsetAOT = 0;
static constexpr dart::compiler::target::word HeapPage_kBytesPerCardLog2 = 9;
static constexpr dart::compiler::target::word
NativeEntry_kNumCallWrapperArguments = 2;
static constexpr dart::compiler::target::word String_kMaxElements = 536870911;
static constexpr dart::compiler::target::word
SubtypeTestCache_kFunctionTypeArguments = 4;
static constexpr dart::compiler::target::word
SubtypeTestCache_kInstanceClassIdOrFunction = 1;
static constexpr dart::compiler::target::word
SubtypeTestCache_kInstanceDelayedFunctionTypeArguments = 6;
static constexpr dart::compiler::target::word
SubtypeTestCache_kInstanceParentFunctionTypeArguments = 5;
static constexpr dart::compiler::target::word
SubtypeTestCache_kInstanceTypeArguments = 2;
static constexpr dart::compiler::target::word
SubtypeTestCache_kInstantiatorTypeArguments = 3;
static constexpr dart::compiler::target::word
SubtypeTestCache_kTestEntryLength = 7;
static constexpr dart::compiler::target::word SubtypeTestCache_kTestResult = 0;
static constexpr dart::compiler::target::word
AbstractType_type_test_stub_entry_point_offset = 4;
static constexpr dart::compiler::target::word ArgumentsDescriptor_count_offset =
16;
static constexpr dart::compiler::target::word
ArgumentsDescriptor_first_named_entry_offset = 24;
static constexpr dart::compiler::target::word
ArgumentsDescriptor_named_entry_size = 8;
static constexpr dart::compiler::target::word ArgumentsDescriptor_name_offset =
0;
static constexpr dart::compiler::target::word
ArgumentsDescriptor_position_offset = 4;
static constexpr dart::compiler::target::word
ArgumentsDescriptor_positional_count_offset = 20;
static constexpr dart::compiler::target::word
ArgumentsDescriptor_type_args_len_offset = 12;
static constexpr dart::compiler::target::word Array_data_offset = 12;
static constexpr dart::compiler::target::word Array_length_offset = 8;
static constexpr dart::compiler::target::word Array_tags_offset = 0;
static constexpr dart::compiler::target::word Array_type_arguments_offset = 4;
static constexpr dart::compiler::target::word Class_declaration_type_offset =
56;
static constexpr dart::compiler::target::word Class_num_type_arguments_offset =
106;
static constexpr dart::compiler::target::word Class_super_type_offset = 44;
static constexpr dart::compiler::target::word
Class_type_arguments_field_offset_in_words_offset = 96;
static constexpr dart::compiler::target::word
ClassHeapStats_TraceAllocationMask = 1;
static constexpr dart::compiler::target::word
ClassHeapStats_allocated_since_gc_new_space_offset = 48;
static constexpr dart::compiler::target::word
ClassHeapStats_allocated_size_since_gc_new_space_offset = 52;
static constexpr dart::compiler::target::word ClassHeapStats_state_offset = 160;
static constexpr dart::compiler::target::word
ClassTable_shared_class_table_offset = 20;
static constexpr dart::compiler::target::word ClassTable_table_offset = 8;
static constexpr dart::compiler::target::word
SharedClassTable_class_heap_stats_table_offset = 0;
static constexpr dart::compiler::target::word Closure_context_offset = 20;
static constexpr dart::compiler::target::word
Closure_delayed_type_arguments_offset = 12;
static constexpr dart::compiler::target::word Closure_function_offset = 16;
static constexpr dart::compiler::target::word
Closure_function_type_arguments_offset = 8;
static constexpr dart::compiler::target::word Closure_hash_offset = 24;
static constexpr dart::compiler::target::word
Closure_instantiator_type_arguments_offset = 4;
static constexpr dart::compiler::target::word Code_object_pool_offset = 20;
static constexpr dart::compiler::target::word Code_saved_instructions_offset =
24;
static constexpr dart::compiler::target::word Code_owner_offset = 28;
static constexpr dart::compiler::target::word Context_num_variables_offset = 4;
static constexpr dart::compiler::target::word Context_parent_offset = 8;
static constexpr dart::compiler::target::word Double_value_offset = 8;
static constexpr dart::compiler::target::word
ExternalOneByteString_external_data_offset = 12;
static constexpr dart::compiler::target::word
ExternalTwoByteString_external_data_offset = 12;
static constexpr dart::compiler::target::word Float32x4_value_offset = 8;
static constexpr dart::compiler::target::word Float64x2_value_offset = 8;
static constexpr dart::compiler::target::word Field_guarded_cid_offset = 48;
static constexpr dart::compiler::target::word
Field_guarded_list_length_in_object_offset_offset = 56;
static constexpr dart::compiler::target::word Field_guarded_list_length_offset =
28;
static constexpr dart::compiler::target::word Field_is_nullable_offset = 50;
static constexpr dart::compiler::target::word Field_static_value_offset = 16;
static constexpr dart::compiler::target::word Field_kind_bits_offset = 58;
static constexpr dart::compiler::target::word Function_code_offset = 44;
static constexpr dart::compiler::target::word Function_entry_point_offset = 4;
static constexpr dart::compiler::target::word
Function_unchecked_entry_point_offset = 8;
static constexpr dart::compiler::target::word Function_usage_counter_offset =
76;
static constexpr dart::compiler::target::word GrowableObjectArray_data_offset =
12;
static constexpr dart::compiler::target::word
GrowableObjectArray_length_offset = 8;
static constexpr dart::compiler::target::word
GrowableObjectArray_type_arguments_offset = 4;
static constexpr dart::compiler::target::word HeapPage_card_table_offset = 20;
static constexpr dart::compiler::target::word ICData_NumArgsTestedMask = 3;
static constexpr dart::compiler::target::word ICData_NumArgsTestedShift = 0;
static constexpr dart::compiler::target::word
ICData_arguments_descriptor_offset = 12;
static constexpr dart::compiler::target::word ICData_entries_offset = 4;
static constexpr dart::compiler::target::word ICData_owner_offset = 20;
static constexpr dart::compiler::target::word ICData_state_bits_offset = 28;
static constexpr dart::compiler::target::word
ICData_receivers_static_type_offset = 16;
static constexpr dart::compiler::target::word Isolate_class_table_offset = 40;
static constexpr dart::compiler::target::word Isolate_current_tag_offset = 20;
static constexpr dart::compiler::target::word Isolate_default_tag_offset = 24;
static constexpr dart::compiler::target::word Isolate_ic_miss_code_offset = 28;
static constexpr dart::compiler::target::word Isolate_object_store_offset = 36;
static constexpr dart::compiler::target::word Isolate_single_step_offset = 64;
static constexpr dart::compiler::target::word Isolate_user_tag_offset = 16;
static constexpr dart::compiler::target::word LinkedHashMap_data_offset = 16;
static constexpr dart::compiler::target::word
LinkedHashMap_deleted_keys_offset = 24;
static constexpr dart::compiler::target::word LinkedHashMap_hash_mask_offset =
12;
static constexpr dart::compiler::target::word LinkedHashMap_index_offset = 8;
static constexpr dart::compiler::target::word LinkedHashMap_used_data_offset =
20;
static constexpr dart::compiler::target::word
MarkingStackBlock_pointers_offset = 8;
static constexpr dart::compiler::target::word MarkingStackBlock_top_offset = 4;
static constexpr dart::compiler::target::word
MegamorphicCache_arguments_descriptor_offset = 16;
static constexpr dart::compiler::target::word MegamorphicCache_buckets_offset =
4;
static constexpr dart::compiler::target::word MegamorphicCache_mask_offset = 8;
static constexpr dart::compiler::target::word Mint_value_offset = 8;
static constexpr dart::compiler::target::word NativeArguments_argc_tag_offset =
4;
static constexpr dart::compiler::target::word NativeArguments_argv_offset = 8;
static constexpr dart::compiler::target::word NativeArguments_retval_offset =
12;
static constexpr dart::compiler::target::word NativeArguments_thread_offset = 0;
static constexpr dart::compiler::target::word ObjectStore_double_type_offset =
64;
static constexpr dart::compiler::target::word ObjectStore_int_type_offset = 32;
static constexpr dart::compiler::target::word ObjectStore_string_type_offset =
80;
static constexpr dart::compiler::target::word OneByteString_data_offset = 12;
static constexpr dart::compiler::target::word Pointer_c_memory_address_offset =
8;
static constexpr dart::compiler::target::word
SingleTargetCache_entry_point_offset = 8;
static constexpr dart::compiler::target::word
SingleTargetCache_lower_limit_offset = 12;
static constexpr dart::compiler::target::word SingleTargetCache_target_offset =
4;
static constexpr dart::compiler::target::word
SingleTargetCache_upper_limit_offset = 14;
static constexpr dart::compiler::target::word StoreBufferBlock_pointers_offset =
8;
static constexpr dart::compiler::target::word StoreBufferBlock_top_offset = 4;
static constexpr dart::compiler::target::word String_hash_offset = 8;
static constexpr dart::compiler::target::word String_length_offset = 4;
static constexpr dart::compiler::target::word SubtypeTestCache_cache_offset = 4;
static constexpr dart::compiler::target::word
Thread_AllocateArray_entry_point_offset = 160;
static constexpr dart::compiler::target::word Thread_active_exception_offset =
456;
static constexpr dart::compiler::target::word Thread_active_stacktrace_offset =
460;
static constexpr dart::compiler::target::word Thread_async_stack_trace_offset =
88;
static constexpr dart::compiler::target::word
Thread_auto_scope_native_wrapper_entry_point_offset = 120;
static constexpr dart::compiler::target::word Thread_bool_false_offset = 112;
static constexpr dart::compiler::target::word Thread_bool_true_offset = 108;
static constexpr dart::compiler::target::word Thread_dart_stream_offset = 492;
static constexpr dart::compiler::target::word Thread_double_abs_address_offset =
140;
static constexpr dart::compiler::target::word
Thread_double_negate_address_offset = 136;
static constexpr dart::compiler::target::word Thread_end_offset = 64;
static constexpr dart::compiler::target::word Thread_execution_state_offset =
476;
static constexpr dart::compiler::target::word
Thread_float_absolute_address_offset = 152;
static constexpr dart::compiler::target::word
Thread_float_negate_address_offset = 148;
static constexpr dart::compiler::target::word Thread_float_not_address_offset =
144;
static constexpr dart::compiler::target::word
Thread_float_zerow_address_offset = 156;
static constexpr dart::compiler::target::word Thread_global_object_pool_offset =
464;
static constexpr dart::compiler::target::word Thread_isolate_offset = 52;
static constexpr dart::compiler::target::word
Thread_marking_stack_block_offset = 76;
static constexpr dart::compiler::target::word
Thread_no_scope_native_wrapper_entry_point_offset = 116;
static constexpr dart::compiler::target::word Thread_object_null_offset = 104;
static constexpr dart::compiler::target::word
Thread_predefined_symbols_address_offset = 128;
static constexpr dart::compiler::target::word Thread_resume_pc_offset = 468;
static constexpr dart::compiler::target::word
Thread_saved_shadow_call_stack_offset = 472;
static constexpr dart::compiler::target::word Thread_safepoint_state_offset =
480;
static constexpr dart::compiler::target::word Thread_stack_limit_offset = 36;
static constexpr dart::compiler::target::word Thread_saved_stack_limit_offset =
40;
static constexpr dart::compiler::target::word
Thread_stack_overflow_flags_offset = 44;
static constexpr dart::compiler::target::word Thread_store_buffer_block_offset =
72;
static constexpr dart::compiler::target::word
Thread_top_exit_frame_info_offset = 68;
static constexpr dart::compiler::target::word Thread_top_offset = 60;
static constexpr dart::compiler::target::word Thread_top_resource_offset = 24;
static constexpr dart::compiler::target::word
Thread_unboxed_int64_runtime_arg_offset = 96;
static constexpr dart::compiler::target::word Thread_vm_tag_offset = 84;
static constexpr dart::compiler::target::word Thread_write_barrier_mask_offset =
48;
static constexpr dart::compiler::target::word Thread_callback_code_offset = 484;
static constexpr dart::compiler::target::word TimelineStream_enabled_offset = 8;
static constexpr dart::compiler::target::word TwoByteString_data_offset = 12;
static constexpr dart::compiler::target::word Type_arguments_offset = 16;
static constexpr dart::compiler::target::word Type_hash_offset = 20;
static constexpr dart::compiler::target::word Type_signature_offset = 24;
static constexpr dart::compiler::target::word Type_type_class_id_offset = 12;
static constexpr dart::compiler::target::word Type_type_state_offset = 32;
static constexpr dart::compiler::target::word
TypeArguments_instantiations_offset = 4;
static constexpr dart::compiler::target::word TypeRef_type_offset = 12;
static constexpr dart::compiler::target::word TypedDataBase_data_field_offset =
4;
static constexpr dart::compiler::target::word TypedDataBase_length_offset = 8;
static constexpr dart::compiler::target::word TypedDataView_data_offset = 12;
static constexpr dart::compiler::target::word
TypedDataView_offset_in_bytes_offset = 16;
static constexpr dart::compiler::target::word TypedData_data_offset = 12;
static constexpr dart::compiler::target::word UserTag_tag_offset = 8;
static constexpr dart::compiler::target::word Array_elements_start_offset = 12;
static constexpr dart::compiler::target::word Array_element_size = 4;
static constexpr dart::compiler::target::word
TypeArguments_elements_start_offset = 16;
static constexpr dart::compiler::target::word TypeArguments_element_size = 4;
static constexpr dart::compiler::target::word ClassTable_elements_start_offset =
0;
static constexpr dart::compiler::target::word ClassTable_element_size = 168;
static constexpr dart::compiler::target::word Code_entry_point_offset[] = {
4, 12, 8, 16};
static constexpr dart::compiler::target::word
Code_function_entry_point_offset[] = {4, 8};
static constexpr dart::compiler::target::word Array_header_size = 12;
static constexpr dart::compiler::target::word Context_header_size = 12;
static constexpr dart::compiler::target::word Double_InstanceSize = 16;
static constexpr dart::compiler::target::word Float32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Float64x2_InstanceSize = 24;
static constexpr dart::compiler::target::word Instructions_UnalignedHeaderSize =
12;
static constexpr dart::compiler::target::word Int32x4_InstanceSize = 24;
static constexpr dart::compiler::target::word Mint_InstanceSize = 16;
static constexpr dart::compiler::target::word NativeArguments_StructSize = 16;
static constexpr dart::compiler::target::word String_InstanceSize = 12;
static constexpr dart::compiler::target::word TypedData_InstanceSize = 12;
static constexpr dart::compiler::target::word Object_InstanceSize = 4;
static constexpr dart::compiler::target::word TypedDataBase_InstanceSize = 12;
static constexpr dart::compiler::target::word Closure_InstanceSize = 28;
static constexpr dart::compiler::target::word GrowableObjectArray_InstanceSize =
16;
static constexpr dart::compiler::target::word Instance_InstanceSize = 4;
static constexpr dart::compiler::target::word LinkedHashMap_InstanceSize = 28;
#endif // defined(TARGET_ARCH_DBC) && defined(TARGET_ARCH_IS_32_BIT)
#endif // RUNTIME_VM_COMPILER_RUNTIME_OFFSETS_EXTRACTED_H_

View file

@ -149,76 +149,73 @@
FIELD(Thread, AllocateArray_entry_point_offset) \
FIELD(Thread, active_exception_offset) \
FIELD(Thread, active_stacktrace_offset) \
NOT_IN_DBC(FIELD(Thread, array_write_barrier_code_offset)) \
NOT_IN_DBC(FIELD(Thread, array_write_barrier_entry_point_offset)) \
FIELD(Thread, array_write_barrier_code_offset) \
FIELD(Thread, array_write_barrier_entry_point_offset) \
FIELD(Thread, async_stack_trace_offset) \
FIELD(Thread, auto_scope_native_wrapper_entry_point_offset) \
FIELD(Thread, bool_false_offset) \
FIELD(Thread, bool_true_offset) \
NOT_IN_DBC(FIELD(Thread, call_to_runtime_entry_point_offset)) \
NOT_IN_DBC(FIELD(Thread, call_to_runtime_stub_offset)) \
FIELD(Thread, call_to_runtime_entry_point_offset) \
FIELD(Thread, call_to_runtime_stub_offset) \
FIELD(Thread, dart_stream_offset) \
NOT_IN_DBC(FIELD(Thread, optimize_entry_offset)) \
NOT_IN_DBC(FIELD(Thread, optimize_stub_offset)) \
NOT_IN_DBC(FIELD(Thread, deoptimize_entry_offset)) \
NOT_IN_DBC(FIELD(Thread, deoptimize_stub_offset)) \
FIELD(Thread, optimize_entry_offset) \
FIELD(Thread, optimize_stub_offset) \
FIELD(Thread, deoptimize_entry_offset) \
FIELD(Thread, deoptimize_stub_offset) \
FIELD(Thread, double_abs_address_offset) \
FIELD(Thread, double_negate_address_offset) \
FIELD(Thread, end_offset) \
NOT_IN_DBC(FIELD(Thread, enter_safepoint_stub_offset)) \
FIELD(Thread, enter_safepoint_stub_offset) \
FIELD(Thread, execution_state_offset) \
NOT_IN_DBC(FIELD(Thread, exit_safepoint_stub_offset)) \
NOT_IN_DBC(FIELD(Thread, call_native_through_safepoint_stub_offset)) \
NOT_IN_DBC(FIELD(Thread, call_native_through_safepoint_entry_point_offset)) \
NOT_IN_DBC(FIELD(Thread, fix_allocation_stub_code_offset)) \
NOT_IN_DBC(FIELD(Thread, fix_callers_target_code_offset)) \
FIELD(Thread, exit_safepoint_stub_offset) \
FIELD(Thread, call_native_through_safepoint_stub_offset) \
FIELD(Thread, call_native_through_safepoint_entry_point_offset) \
FIELD(Thread, fix_allocation_stub_code_offset) \
FIELD(Thread, fix_callers_target_code_offset) \
FIELD(Thread, float_absolute_address_offset) \
FIELD(Thread, float_negate_address_offset) \
FIELD(Thread, float_not_address_offset) \
FIELD(Thread, float_zerow_address_offset) \
FIELD(Thread, global_object_pool_offset) \
NOT_IN_DBC(FIELD(Thread, interpret_call_entry_point_offset)) \
NOT_IN_DBC(FIELD(Thread, invoke_dart_code_from_bytecode_stub_offset)) \
NOT_IN_DBC(FIELD(Thread, invoke_dart_code_stub_offset)) \
FIELD(Thread, interpret_call_entry_point_offset) \
FIELD(Thread, invoke_dart_code_from_bytecode_stub_offset) \
FIELD(Thread, invoke_dart_code_stub_offset) \
FIELD(Thread, isolate_offset) \
NOT_IN_DBC(FIELD(Thread, lazy_deopt_from_return_stub_offset)) \
NOT_IN_DBC(FIELD(Thread, lazy_deopt_from_throw_stub_offset)) \
NOT_IN_DBC(FIELD(Thread, lazy_specialize_type_test_stub_offset)) \
FIELD(Thread, lazy_deopt_from_return_stub_offset) \
FIELD(Thread, lazy_deopt_from_throw_stub_offset) \
FIELD(Thread, lazy_specialize_type_test_stub_offset) \
FIELD(Thread, marking_stack_block_offset) \
NOT_IN_DBC(FIELD(Thread, megamorphic_call_checked_entry_offset)) \
NOT_IN_DBC(FIELD(Thread, monomorphic_miss_entry_offset)) \
NOT_IN_DBC(FIELD(Thread, monomorphic_miss_stub_offset)) \
FIELD(Thread, megamorphic_call_checked_entry_offset) \
FIELD(Thread, monomorphic_miss_entry_offset) \
FIELD(Thread, monomorphic_miss_stub_offset) \
FIELD(Thread, no_scope_native_wrapper_entry_point_offset) \
NOT_IN_DBC( \
FIELD(Thread, null_error_shared_with_fpu_regs_entry_point_offset)) \
NOT_IN_DBC(FIELD(Thread, null_error_shared_with_fpu_regs_stub_offset)) \
NOT_IN_DBC( \
FIELD(Thread, null_error_shared_without_fpu_regs_entry_point_offset)) \
NOT_IN_DBC(FIELD(Thread, null_error_shared_without_fpu_regs_stub_offset)) \
FIELD(Thread, null_error_shared_with_fpu_regs_entry_point_offset) \
FIELD(Thread, null_error_shared_with_fpu_regs_stub_offset) \
\
FIELD(Thread, null_error_shared_without_fpu_regs_entry_point_offset) \
FIELD(Thread, null_error_shared_without_fpu_regs_stub_offset) \
FIELD(Thread, object_null_offset) \
FIELD(Thread, predefined_symbols_address_offset) \
FIELD(Thread, resume_pc_offset) \
FIELD(Thread, saved_shadow_call_stack_offset) \
FIELD(Thread, safepoint_state_offset) \
NOT_IN_DBC(FIELD(Thread, slow_type_test_stub_offset)) \
FIELD(Thread, slow_type_test_stub_offset) \
FIELD(Thread, stack_limit_offset) \
FIELD(Thread, saved_stack_limit_offset) \
FIELD(Thread, stack_overflow_flags_offset) \
NOT_IN_DBC( \
FIELD(Thread, stack_overflow_shared_with_fpu_regs_entry_point_offset)) \
NOT_IN_DBC(FIELD(Thread, stack_overflow_shared_with_fpu_regs_stub_offset)) \
NOT_IN_DBC(FIELD(Thread, \
stack_overflow_shared_without_fpu_regs_entry_point_offset)) \
NOT_IN_DBC( \
FIELD(Thread, stack_overflow_shared_without_fpu_regs_stub_offset)) \
FIELD(Thread, stack_overflow_shared_with_fpu_regs_entry_point_offset) \
FIELD(Thread, stack_overflow_shared_with_fpu_regs_stub_offset) \
FIELD(Thread, stack_overflow_shared_without_fpu_regs_entry_point_offset) \
\
FIELD(Thread, stack_overflow_shared_without_fpu_regs_stub_offset) \
FIELD(Thread, store_buffer_block_offset) \
FIELD(Thread, top_exit_frame_info_offset) \
FIELD(Thread, top_offset) \
FIELD(Thread, top_resource_offset) \
FIELD(Thread, unboxed_int64_runtime_arg_offset) \
FIELD(Thread, vm_tag_offset) \
NOT_IN_DBC(FIELD(Thread, write_barrier_code_offset)) \
NOT_IN_DBC(FIELD(Thread, write_barrier_entry_point_offset)) \
FIELD(Thread, write_barrier_code_offset) \
FIELD(Thread, write_barrier_entry_point_offset) \
FIELD(Thread, write_barrier_mask_offset) \
FIELD(Thread, callback_code_offset) \
FIELD(TimelineStream, enabled_offset) \

View file

@ -19,7 +19,7 @@ class Assembler;
class StubCodeCompiler : public AllStatic {
public:
#if !defined(TARGET_ARCH_DBC) && !defined(TARGET_ARCH_IA32)
#if !defined(TARGET_ARCH_IA32)
static void GenerateBuildMethodExtractorStub(
Assembler* assembler,
const Object& closure_allocation_stub,
@ -84,10 +84,8 @@ class StubCodeCompiler : public AllStatic {
static constexpr intptr_t kNativeCallbackTrampolineStackDelta = 2;
#endif
#if !defined(TARGET_ARCH_DBC)
static void GenerateJITCallbackTrampolines(Assembler* assembler,
intptr_t next_callback_id);
#endif
#endif // !defined(DART_PRECOMPILED_RUNTIME)
};

View file

@ -1,143 +0,0 @@
// Copyright (c) 2019, 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/globals.h"
#if defined(TARGET_ARCH_DBC)
#include "vm/compiler/assembler/assembler.h"
#include "vm/compiler/backend/flow_graph_compiler.h"
#include "vm/compiler/jit/compiler.h"
#include "vm/cpu.h"
#include "vm/dart_entry.h"
#include "vm/heap/heap.h"
#include "vm/instructions.h"
#include "vm/object_store.h"
#include "vm/runtime_entry.h"
#include "vm/stack_frame.h"
#include "vm/stub_code.h"
#include "vm/tags.h"
#define __ assembler->
namespace dart {
DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects.");
DEFINE_FLAG(bool,
use_slow_path,
false,
"Set to true for debugging & verifying the slow paths.");
namespace compiler {
void StubCodeCompiler::GenerateLazyCompileStub(Assembler* assembler) {
__ Compile();
}
void StubCodeCompiler::GenerateCallClosureNoSuchMethodStub(
Assembler* assembler) {
__ NoSuchMethod();
}
// Not executed, but used as a stack marker when calling
// DRT_OptimizeInvokedFunction.
void StubCodeCompiler::GenerateOptimizeFunctionStub(Assembler* assembler) {
__ Trap();
}
// Not executed, but used as a sentinel in Simulator::JumpToFrame.
void StubCodeCompiler::GenerateRunExceptionHandlerStub(Assembler* assembler) {
__ Trap();
}
void StubCodeCompiler::GenerateDeoptForRewindStub(Assembler* assembler) {
__ DeoptRewind();
}
// TODO(vegorov) Don't generate this stub.
void StubCodeCompiler::GenerateFixCallersTargetStub(Assembler* assembler) {
__ Trap();
}
// TODO(vegorov) Don't generate these stubs.
void StubCodeCompiler::GenerateAllocationStubForClass(Assembler* assembler,
const Class& cls) {
__ Trap();
}
// TODO(vegorov) Don't generate this stub.
void StubCodeCompiler::GenerateMegamorphicMissStub(Assembler* assembler) {
__ Trap();
}
// These deoptimization stubs are only used to populate stack frames
// with something meaningful to make sure GC can scan the stack during
// the last phase of deoptimization which materializes objects.
void StubCodeCompiler::GenerateDeoptimizeLazyFromReturnStub(
Assembler* assembler) {
__ Trap();
}
void StubCodeCompiler::GenerateDeoptimizeLazyFromThrowStub(
Assembler* assembler) {
__ Trap();
}
void StubCodeCompiler::GenerateDeoptimizeStub(Assembler* assembler) {
__ Trap();
}
// TODO(kustermann): Don't generate this stub.
void StubCodeCompiler::GenerateDefaultTypeTestStub(Assembler* assembler) {
__ Trap();
}
// TODO(kustermann): Don't generate this stub.
void StubCodeCompiler::GenerateTopTypeTypeTestStub(Assembler* assembler) {
__ Trap();
}
// TODO(kustermann): Don't generate this stub.
void StubCodeCompiler::GenerateTypeRefTypeTestStub(Assembler* assembler) {
__ Trap();
}
// TODO(kustermann): Don't generate this stub.
void StubCodeCompiler::GenerateUnreachableTypeTestStub(Assembler* assembler) {
__ Trap();
}
// TODO(kustermann): Don't generate this stub.
void StubCodeCompiler::GenerateLazySpecializeTypeTestStub(
Assembler* assembler) {
__ Trap();
}
// TODO(kustermann): Don't generate this stub.
void StubCodeCompiler::GenerateSlowTypeTestStub(Assembler* assembler) {
__ Trap();
}
void StubCodeCompiler::GenerateFrameAwaitingMaterializationStub(
Assembler* assembler) {
__ Trap();
}
void StubCodeCompiler::GenerateAsynchronousGapMarkerStub(Assembler* assembler) {
__ Trap();
}
void StubCodeCompiler::GenerateInterpretCallStub(Assembler* assembler) {
__ Trap();
}
void StubCodeCompiler::GenerateInvokeDartCodeFromBytecodeStub(
Assembler* assembler) {
__ Trap();
}
} // namespace compiler
} // namespace dart
#endif // defined TARGET_ARCH_DBC

View file

@ -13,8 +13,6 @@
#include "vm/constants_arm.h"
#elif defined(TARGET_ARCH_ARM64)
#include "vm/constants_arm64.h"
#elif defined(TARGET_ARCH_DBC)
#include "vm/constants_dbc.h"
#else
#error Unknown architecture.
#endif
@ -41,8 +39,6 @@ using namespace arch_x64; // NOLINT
using namespace arch_arm; // NOLINT
#elif defined(TARGET_ARCH_ARM64)
using namespace arch_arm64; // NOLINT
#elif defined(TARGET_ARCH_DBC)
// DBC is defined in namespace dart already.
#else
#error Unknown architecture.
#endif
@ -85,8 +81,6 @@ class RegisterNames {
#endif // !defined(HOST_ARCH_EQUALS_TARGET_ARCH)
};
#if !defined(TARGET_ARCH_DBC)
static constexpr bool IsArgumentRegister(Register reg) {
return ((1 << reg) & CallingConventions::kArgumentRegisters) != 0;
}
@ -99,8 +93,6 @@ static constexpr bool IsCalleeSavedRegister(Register reg) {
return ((1 << reg) & CallingConventions::kCalleeSaveCpuRegisters) != 0;
}
#endif // !defined(TARGET_ARCH_DBC)
} // namespace dart
#endif // RUNTIME_VM_CONSTANTS_H_

View file

@ -1,25 +0,0 @@
// Copyright (c) 2019, 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.
#define RUNTIME_VM_CONSTANTS_H_ // To work around include guard.
#include "vm/constants_dbc.h"
namespace dart {
const char* cpu_reg_names[kNumberOfCpuRegisters] = {
"R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8", "R9", "R10",
"R11", "R12", "R13", "R14", "R15", "R16", "R17", "R18", "R19", "R20", "R21",
"R22", "R23", "R24", "R25", "R26", "R27", "R28", "R29", "R30", "R31",
#if defined(ARCH_IS_64_BIT)
"R32", "R33", "R34", "R35", "R36", "R37", "R38", "R39", "R40", "R41", "R42",
"R43", "R44", "R45", "R46", "R47", "R48", "R49", "R50", "R51", "R52", "R53",
"R54", "R55", "R56", "R57", "R58", "R59", "R60", "R61", "R62", "R63",
#endif
};
const char* fpu_reg_names[kNumberOfFpuRegisters] = {
"F0",
};
} // namespace dart

File diff suppressed because it is too large Load diff

View file

@ -32,7 +32,7 @@ namespace dart {
// PP - object pool for the currently execution function
//
// Frame info stored below FP additionally contains pointers to the currently
// executing function and code (see stack_frame_dbc.h for more information).
// executing function and code.
//
// In the unoptimized code most of bytecodes take operands implicitly from
// stack and store results again on the stack. Constant operands are usually

View file

@ -30,8 +30,6 @@ class CPU : public AllStatic {
#include "vm/cpu_arm.h"
#elif defined(TARGET_ARCH_ARM64)
#include "vm/cpu_arm64.h"
#elif defined(TARGET_ARCH_DBC)
#include "vm/cpu_dbc.h"
#else
#error Unknown architecture.
#endif

View file

@ -1,49 +0,0 @@
// Copyright (c) 2016, 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/globals.h"
#if defined(TARGET_ARCH_DBC)
#include "vm/cpu.h"
#include "vm/cpu_dbc.h"
#include "vm/cpuinfo.h"
namespace dart {
void CPU::FlushICache(uword start, uword size) {
// Nothing to do.
}
const char* CPU::Id() {
return "dbc";
}
const char* HostCPUFeatures::hardware_ = NULL;
#if defined(DEBUG)
bool HostCPUFeatures::initialized_ = false;
#endif
void HostCPUFeatures::Init() {
CpuInfo::Init();
hardware_ = CpuInfo::GetCpuModel();
#if defined(DEBUG)
initialized_ = true;
#endif
}
void HostCPUFeatures::Cleanup() {
DEBUG_ASSERT(initialized_);
#if defined(DEBUG)
initialized_ = false;
#endif
ASSERT(hardware_ != NULL);
free(const_cast<char*>(hardware_));
hardware_ = NULL;
CpuInfo::Cleanup();
}
} // namespace dart
#endif // defined TARGET_ARCH_DBC

View file

@ -1,46 +0,0 @@
// Copyright (c) 2016, 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.
#ifndef RUNTIME_VM_CPU_DBC_H_
#define RUNTIME_VM_CPU_DBC_H_
#if !defined(RUNTIME_VM_CPU_H_)
#error Do not include cpu_dbc.h directly; use cpu.h instead.
#endif
#include "vm/allocation.h"
#include "vm/simulator.h"
namespace dart {
class HostCPUFeatures : public AllStatic {
public:
static void Init();
static void Cleanup();
static const char* hardware() {
DEBUG_ASSERT(initialized_);
return hardware_;
}
private:
static const char* hardware_;
#if defined(DEBUG)
static bool initialized_;
#endif
};
class TargetCPUFeatures : public AllStatic {
public:
static void Init() { HostCPUFeatures::Init(); }
static void Cleanup() { HostCPUFeatures::Cleanup(); }
static const char* hardware() { return CPU::Id(); }
static bool double_truncate_round_supported() { return true; }
};
} // namespace dart
#endif // RUNTIME_VM_CPU_DBC_H_

View file

@ -26,8 +26,6 @@ VM_UNIT_TEST_CASE(Id) {
#else // defined(HOST_ARCH_ARM64)
EXPECT_STREQ("simarm64", CPU::Id());
#endif // defined(HOST_ARCH_ARM64)
#elif defined(TARGET_ARCH_DBC)
EXPECT_STREQ("dbc", CPU::Id());
#else
#error Architecture was not detected as supported by Dart.
#endif

View file

@ -186,17 +186,6 @@ char* Dart::Init(const uint8_t* vm_isolate_snapshot,
}
#endif
#if defined(TARGET_ARCH_DBC)
// DBC instructions are never executable.
FLAG_write_protect_code = false;
#endif
if (FLAG_enable_interpreter) {
#if defined(TARGET_ARCH_DBC)
return strdup("--enable-interpreter is not supported with DBC");
#endif // defined(TARGET_ARCH_DBC)
}
FrameLayout::Init();
set_thread_exit_callback(thread_exit);
@ -776,7 +765,7 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_data,
if (I->object_store()->megamorphic_miss_code() == Code::null()) {
MegamorphicCacheTable::InitMissHandler(I);
}
#if !defined(TARGET_ARCH_DBC) && !defined(TARGET_ARCH_IA32)
#if !defined(TARGET_ARCH_IA32)
if (I != Dart::vm_isolate()) {
I->object_store()->set_build_method_extractor_code(
Code::Handle(StubCode::GetBuildMethodExtractorStub(nullptr)));
@ -896,14 +885,6 @@ const char* Dart::FeaturesString(Isolate* isolate,
buffer.AddString(" x64-sysv");
#endif
#elif defined(TARGET_ARCH_DBC)
#if defined(ARCH_IS_32_BIT)
buffer.AddString(" dbc32");
#elif defined(ARCH_IS_64_BIT)
buffer.AddString(" dbc64");
#else
#error What word size?
#endif
#else
#error What architecture?
#endif

View file

@ -6090,8 +6090,6 @@ DART_EXPORT Dart_Handle Dart_SortClasses() {
DART_EXPORT Dart_Handle Dart_Precompile() {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
#elif defined(TARGET_ARCH_DBC)
return Api::NewError("AOT compilation is not supported on DBC.");
#elif !defined(DART_PRECOMPILER)
return Api::NewError(
"This VM was built without support for AOT compilation.");
@ -6116,8 +6114,6 @@ Dart_CreateAppAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback,
void* callback_data) {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
#elif defined(TARGET_ARCH_DBC)
return Api::NewError("AOT compilation is not supported on DBC.");
#elif defined(TARGET_OS_WINDOWS)
return Api::NewError("Assembly generation is not implemented for Windows.");
#elif !defined(DART_PRECOMPILER)
@ -6154,8 +6150,6 @@ Dart_CreateVMAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback,
void* callback_data) {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
#elif defined(TARGET_ARCH_DBC)
return Api::NewError("AOT compilation is not supported on DBC.");
#elif defined(TARGET_OS_WINDOWS)
return Api::NewError("Assembly generation is not implemented for Windows.");
#elif !defined(DART_PRECOMPILER)
@ -6184,8 +6178,6 @@ Dart_CreateAppAOTSnapshotAsElf(Dart_StreamingWriteCallback callback,
bool strip) {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
#elif defined(TARGET_ARCH_DBC)
return Api::NewError("AOT compilation is not supported on DBC.");
#elif !defined(DART_PRECOMPILER)
return Api::NewError(
"This VM was built without support for AOT compilation.");
@ -6245,8 +6237,6 @@ Dart_CreateAppAOTSnapshotAsBlobs(uint8_t** vm_snapshot_data_buffer,
intptr_t* isolate_snapshot_instructions_size) {
#if defined(TARGET_ARCH_IA32)
return Api::NewError("AOT compilation is not supported on IA32.");
#elif defined(TARGET_ARCH_DBC)
return Api::NewError("AOT compilation is not supported on DBC.");
#elif !defined(DART_PRECOMPILER)
return Api::NewError(
"This VM was built without support for AOT compilation.");

View file

@ -301,10 +301,7 @@ class Api : AllStatic {
static bool IsFfiEnabled() {
// dart:ffi is not implemented for the following configurations
#if defined(TARGET_ARCH_DBC) && !defined(ARCH_IS_64_BIT)
// TODO(36809): Support SimDBC32.
return false;
#elif defined(TARGET_ARCH_ARM) && \
#if defined(TARGET_ARCH_ARM) && \
!(defined(TARGET_OS_ANDROID) || defined(TARGET_OS_MACOS_IOS))
// TODO(36309): Support hardfp calling convention.
return false;

View file

@ -159,20 +159,15 @@ RawObject* DartEntry::InvokeFunction(const Function& function,
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
// Now Call the invoke stub which will invoke the dart function.
#if !defined(TARGET_ARCH_DBC)
// Now Call the invoke stub which will invoke the dart function.
invokestub entrypoint =
reinterpret_cast<invokestub>(StubCode::InvokeDartCode().EntryPoint());
#endif
const Code& code = Code::Handle(zone, function.CurrentCode());
ASSERT(!code.IsNull());
ASSERT(thread->no_callback_scope_depth() == 0);
SuspendLongJumpScope suspend_long_jump_scope(thread);
TransitionToGenerated transition(thread);
#if defined(TARGET_ARCH_DBC)
return Simulator::Current()->Call(code, arguments_descriptor, arguments,
thread);
#elif defined(USING_SIMULATOR)
#if defined(USING_SIMULATOR)
return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call(
reinterpret_cast<intptr_t>(entrypoint), reinterpret_cast<intptr_t>(&code),
reinterpret_cast<intptr_t>(&arguments_descriptor),

View file

@ -180,9 +180,7 @@ void Breakpoint::PrintJSON(JSONStream* stream) {
void CodeBreakpoint::VisitObjectPointers(ObjectPointerVisitor* visitor) {
visitor->VisitPointer(reinterpret_cast<RawObject**>(&code_));
visitor->VisitPointer(reinterpret_cast<RawObject**>(&bytecode_));
#if !defined(TARGET_ARCH_DBC)
visitor->VisitPointer(reinterpret_cast<RawObject**>(&saved_value_));
#endif
}
ActivationFrame::ActivationFrame(uword pc,
@ -1750,13 +1748,7 @@ CodeBreakpoint::CodeBreakpoint(const Code& code,
bpt_location_(NULL),
next_(NULL),
breakpoint_kind_(kind),
#if !defined(TARGET_ARCH_DBC)
saved_value_(Code::null())
#else
saved_value_(SimulatorBytecode::kTrap),
saved_value_fastsmi_(SimulatorBytecode::kTrap)
#endif
{
saved_value_(Code::null()) {
ASSERT(!code.IsNull());
ASSERT(token_pos_.IsReal());
ASSERT(pc_ != 0);
@ -1775,13 +1767,7 @@ CodeBreakpoint::CodeBreakpoint(const Bytecode& bytecode,
bpt_location_(NULL),
next_(NULL),
breakpoint_kind_(RawPcDescriptors::kAnyKind),
#if !defined(TARGET_ARCH_DBC)
saved_value_(Code::null())
#else
saved_value_(SimulatorBytecode::kTrap),
saved_value_fastsmi_(SimulatorBytecode::kTrap)
#endif
{
saved_value_(Code::null()) {
ASSERT(!bytecode.IsNull());
ASSERT(FLAG_enable_interpreter);
ASSERT(token_pos_.IsReal());

View file

@ -244,15 +244,7 @@ class CodeBreakpoint {
CodeBreakpoint* next_;
RawPcDescriptors::Kind breakpoint_kind_;
#if !defined(TARGET_ARCH_DBC)
RawCode* saved_value_;
#else
// When running on the DBC interpreter we patch bytecode in place with
// DebugBreak. This is an instruction that was replaced. DebugBreak
// will execute it after the breakpoint.
Instr saved_value_;
Instr saved_value_fastsmi_;
#endif
friend class Debugger;
DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint);

View file

@ -1,109 +0,0 @@
// Copyright (c) 2016, 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/globals.h"
#if defined(TARGET_ARCH_DBC)
#include "vm/code_patcher.h"
#include "vm/cpu.h"
#include "vm/debugger.h"
#include "vm/instructions.h"
#include "vm/stub_code.h"
namespace dart {
#ifndef PRODUCT
RawCode* CodeBreakpoint::OrigStubAddress() const {
return reinterpret_cast<RawCode*>(static_cast<uintptr_t>(saved_value_));
}
static Instr* CallInstructionFromReturnAddress(uword pc) {
return reinterpret_cast<Instr*>(pc) - 1;
}
static Instr* FastSmiInstructionFromReturnAddress(uword pc) {
return reinterpret_cast<Instr*>(pc) - 2;
}
void CodeBreakpoint::PatchCode() {
ASSERT(!is_enabled_);
auto thread = Thread::Current();
auto zone = thread->zone();
const Code& code = Code::Handle(zone, code_);
const Instructions& instrs = Instructions::Handle(zone, code.instructions());
thread->isolate_group()->RunWithStoppedMutators([&]() {
WritableInstructionsScope writable(instrs.PayloadStart(), instrs.Size());
saved_value_ = *CallInstructionFromReturnAddress(pc_);
switch (breakpoint_kind_) {
case RawPcDescriptors::kIcCall:
case RawPcDescriptors::kUnoptStaticCall: {
// DebugBreak has an A operand matching the call it replaces.
// This ensures that Return instructions continue to work - as they
// look at calls to figure out how many arguments to drop.
*CallInstructionFromReturnAddress(pc_) = SimulatorBytecode::Encode(
SimulatorBytecode::kDebugBreak,
SimulatorBytecode::DecodeArgc(saved_value_), 0, 0);
break;
}
case RawPcDescriptors::kRuntimeCall: {
*CallInstructionFromReturnAddress(pc_) = SimulatorBytecode::kDebugBreak;
break;
}
default:
UNREACHABLE();
}
// If this call is the fall-through for a fast Smi op, also disable the fast
// Smi op.
if ((SimulatorBytecode::DecodeOpcode(saved_value_) ==
SimulatorBytecode::kInstanceCall2) &&
SimulatorBytecode::IsFastSmiOpcode(
*FastSmiInstructionFromReturnAddress(pc_))) {
saved_value_fastsmi_ = *FastSmiInstructionFromReturnAddress(pc_);
*FastSmiInstructionFromReturnAddress(pc_) =
SimulatorBytecode::Encode(SimulatorBytecode::kNop, 0, 0, 0);
} else {
saved_value_fastsmi_ = SimulatorBytecode::kTrap;
}
});
is_enabled_ = true;
}
void CodeBreakpoint::RestoreCode() {
ASSERT(is_enabled_);
auto thread = Thread::Current();
auto zone = thread->zone();
const Code& code = Code::Handle(zone, code_);
const Instructions& instrs = Instructions::Handle(zone, code.instructions());
thread->isolate_group()->RunWithStoppedMutators([&]() {
WritableInstructionsScope writable(instrs.PayloadStart(), instrs.Size());
switch (breakpoint_kind_) {
case RawPcDescriptors::kIcCall:
case RawPcDescriptors::kUnoptStaticCall:
case RawPcDescriptors::kRuntimeCall: {
*CallInstructionFromReturnAddress(pc_) = saved_value_;
break;
}
default:
UNREACHABLE();
}
if (saved_value_fastsmi_ != SimulatorBytecode::kTrap) {
Instr current_instr = *FastSmiInstructionFromReturnAddress(pc_);
ASSERT(SimulatorBytecode::DecodeOpcode(current_instr) ==
SimulatorBytecode::kNop);
*FastSmiInstructionFromReturnAddress(pc_) = saved_value_fastsmi_;
}
});
is_enabled_ = false;
}
#endif // !PRODUCT
} // namespace dart
#endif // defined TARGET_ARCH_DBC

Some files were not shown because too many files have changed in this diff Show more