mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 16:19:07 +00:00
[vm/compiler] Split compiler sources out of normal VM sources.
Make them form its own source set (libdart_compiler) and completely exclude them from AOT runtime targets. Previously we had some inconsistencies, with some files were using DART_PRECOMPILED_RUNTIME to fully or partially exclude either contents from their headers or from implementation, while other files did nothing and relied on linker to throw their contents away. This change tries to address this inconsistency. A follow up change would include a check in most compiler headers which would prohibit to use them while building AOT runtime. Change-Id: Ief11b11cbc518b301d3e93fce80580a31bbad151 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142993 Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
parent
87bc71fb65
commit
a41a1dc917
|
@ -236,6 +236,7 @@ library_for_all_configs("libdart") {
|
|||
"vm:libdart_lib",
|
||||
"vm:libdart_vm",
|
||||
]
|
||||
compiler_lib = "vm:libdart_compiler"
|
||||
extra_configs = [ ":dart_shared_lib" ]
|
||||
include_dirs = [ "." ]
|
||||
public_configs = [ ":dart_public_config" ]
|
||||
|
|
|
@ -65,56 +65,67 @@ _all_configs = [
|
|||
suffix = "_jit"
|
||||
configs = _jit_config
|
||||
snapshot = true
|
||||
compiler = true
|
||||
},
|
||||
{
|
||||
suffix = "_jit_product"
|
||||
configs = _jit_product_config
|
||||
snapshot = true
|
||||
compiler = true
|
||||
},
|
||||
{
|
||||
suffix = "_precompiled_runtime"
|
||||
configs = _precompiled_runtime_config
|
||||
snapshot = true
|
||||
compiler = false
|
||||
},
|
||||
{
|
||||
suffix = "_precompiled_runtime_product"
|
||||
configs = _precompiled_runtime_product_config
|
||||
snapshot = true
|
||||
compiler = false
|
||||
},
|
||||
{
|
||||
suffix = "_precompiler"
|
||||
configs = _precompiler_config
|
||||
snapshot = false
|
||||
compiler = true
|
||||
},
|
||||
{
|
||||
suffix = "_precompiler_product"
|
||||
configs = _precompiler_product_config
|
||||
snapshot = false
|
||||
compiler = true
|
||||
},
|
||||
{
|
||||
suffix = "_precompiler_fuchsia"
|
||||
configs = _precompiler_fuchsia_config
|
||||
snapshot = false
|
||||
compiler = true
|
||||
},
|
||||
{
|
||||
suffix = "_precompiler_product_fuchsia"
|
||||
configs = _precompiler_product_fuchsia_config
|
||||
snapshot = false
|
||||
compiler = true
|
||||
},
|
||||
{
|
||||
suffix = "_precompiler_host_targeting_host"
|
||||
configs = _precompiler_host_targeting_host_config
|
||||
snapshot = false
|
||||
compiler = true
|
||||
},
|
||||
{
|
||||
suffix = "_precompiler_product_host_targeting_host"
|
||||
configs = _precompiler_product_host_targeting_host_config
|
||||
snapshot = false
|
||||
compiler = true
|
||||
},
|
||||
{
|
||||
suffix = "_libfuzzer"
|
||||
configs = _libfuzzer_config
|
||||
snapshot = true
|
||||
compiler = true
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -177,6 +188,13 @@ template("library_for_all_configs") {
|
|||
foreach(dep, configurable_deps) {
|
||||
configured_deps += [ "${dep}${conf.suffix}" ]
|
||||
}
|
||||
if (defined(compiler_lib)) {
|
||||
if (conf.compiler) {
|
||||
configured_deps += [ "${compiler_lib}${conf.suffix}" ]
|
||||
} else {
|
||||
not_needed([ "compiler_lib" ])
|
||||
}
|
||||
}
|
||||
deps = configured_deps + extra_deps
|
||||
if (conf.snapshot) {
|
||||
if (defined(snapshot_sources)) {
|
||||
|
@ -190,3 +208,47 @@ template("library_for_all_configs") {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
template("library_for_all_configs_with_compiler") {
|
||||
assert(defined(invoker.target_type))
|
||||
extra_configs = []
|
||||
if (defined(invoker.extra_configs)) {
|
||||
extra_configs += invoker.extra_configs
|
||||
}
|
||||
configurable_deps = []
|
||||
if (defined(invoker.configurable_deps)) {
|
||||
configurable_deps += invoker.configurable_deps
|
||||
}
|
||||
extra_deps = []
|
||||
if (defined(invoker.extra_deps)) {
|
||||
extra_deps += invoker.extra_deps
|
||||
}
|
||||
foreach(conf, _all_configs) {
|
||||
if (conf.compiler) {
|
||||
target(invoker.target_type, "${target_name}${conf.suffix}") {
|
||||
forward_variables_from(invoker,
|
||||
"*",
|
||||
[
|
||||
"extra_configs",
|
||||
"extra_deps",
|
||||
"configurable_deps",
|
||||
])
|
||||
configs += conf.configs + extra_configs
|
||||
configured_deps = []
|
||||
foreach(dep, configurable_deps) {
|
||||
configured_deps += [ "${dep}${conf.suffix}" ]
|
||||
}
|
||||
deps = configured_deps + extra_deps
|
||||
if (conf.snapshot) {
|
||||
if (defined(snapshot_sources)) {
|
||||
sources += snapshot_sources
|
||||
}
|
||||
} else {
|
||||
if (defined(snapshot_sources)) {
|
||||
not_needed([ "snapshot_sources" ])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
#include "vm/bootstrap_natives.h"
|
||||
#include "vm/class_finalizer.h"
|
||||
#include "vm/class_id.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/ffi/call.h"
|
||||
#include "vm/compiler/ffi/callback.h"
|
||||
#include "vm/compiler/ffi/native_type.h"
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
#include "vm/exceptions.h"
|
||||
#include "vm/flags.h"
|
||||
#include "vm/log.h"
|
||||
|
@ -22,6 +18,13 @@
|
|||
#include "vm/object_store.h"
|
||||
#include "vm/symbols.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/ffi/call.h"
|
||||
#include "vm/compiler/ffi/callback.h"
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
// The following functions are runtime checks on type arguments.
|
||||
|
@ -69,7 +72,7 @@ static const Double& AsDouble(const Instance& instance) {
|
|||
return Double::Cast(instance);
|
||||
}
|
||||
|
||||
// Calcuate the size of a native type.
|
||||
// Calculate the size of a native type.
|
||||
//
|
||||
// You must check [IsConcreteNativeType] and [CheckSized] first to verify that
|
||||
// this type has a defined size.
|
||||
|
|
|
@ -8,10 +8,13 @@
|
|||
#include "vm/native_entry.h"
|
||||
#include "vm/object.h"
|
||||
#include "vm/regexp_assembler_bytecode.h"
|
||||
#include "vm/regexp_assembler_ir.h"
|
||||
#include "vm/regexp_parser.h"
|
||||
#include "vm/thread.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/regexp_assembler_ir.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
DEFINE_NATIVE_ENTRY(RegExp_factory, 0, 6) {
|
||||
|
|
|
@ -90,11 +90,23 @@ library_for_all_configs("libdart_vm") {
|
|||
"*_test.cc",
|
||||
"*_test.h",
|
||||
])
|
||||
sources = vm_sources + rebase_path(compiler_sources, ".", "./compiler/") +
|
||||
sources = vm_sources + rebase_path(compiler_api_sources, ".", "./compiler/") +
|
||||
rebase_path(disassembler_sources, ".", "./compiler/") +
|
||||
rebase_path(heap_sources, ".", "./heap/")
|
||||
include_dirs = [ ".." ]
|
||||
}
|
||||
|
||||
library_for_all_configs_with_compiler("libdart_compiler") {
|
||||
target_type = "source_set"
|
||||
public_configs = [ ":libdart_vm_config" ]
|
||||
set_sources_assignment_filter([
|
||||
"*_test.cc",
|
||||
"*_test.h",
|
||||
])
|
||||
sources = rebase_path(compiler_sources, ".", "./compiler/")
|
||||
include_dirs = [ ".." ]
|
||||
}
|
||||
|
||||
library_for_all_configs("libdart_lib") {
|
||||
target_type = "source_set"
|
||||
if (is_fuchsia) {
|
||||
|
|
|
@ -9,10 +9,8 @@
|
|||
#include "vm/bss_relocs.h"
|
||||
#include "vm/class_id.h"
|
||||
#include "vm/code_observers.h"
|
||||
#include "vm/compiler/api/print_filter.h"
|
||||
#include "vm/compiler/assembler/disassembler.h"
|
||||
#include "vm/compiler/backend/code_statistics.h"
|
||||
#include "vm/compiler/backend/il_printer.h"
|
||||
#include "vm/compiler/relocation.h"
|
||||
#include "vm/dart.h"
|
||||
#include "vm/dispatch_table.h"
|
||||
#include "vm/flag_list.h"
|
||||
|
@ -28,6 +26,12 @@
|
|||
#include "vm/timeline.h"
|
||||
#include "vm/version.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/backend/code_statistics.h"
|
||||
#include "vm/compiler/backend/il_printer.h"
|
||||
#include "vm/compiler/relocation.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
@ -1746,7 +1750,7 @@ class CodeDeserializationCluster : public DeserializationCluster {
|
|||
if (owner.IsFunction()) {
|
||||
if ((FLAG_disassemble ||
|
||||
(code.is_optimized() && FLAG_disassemble_optimized)) &&
|
||||
FlowGraphPrinter::ShouldPrint(Function::Cast(owner))) {
|
||||
compiler::PrintFilter::ShouldPrint(Function::Cast(owner))) {
|
||||
Disassembler::DisassembleCode(Function::Cast(owner), code,
|
||||
code.is_optimized());
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
// 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.
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME) && \
|
||||
(!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
|
||||
|
||||
#include "vm/code_comments.h"
|
||||
|
||||
namespace dart {
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME) && \
|
||||
(!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
|
||||
|
||||
const Code::Comments& CreateCommentsFrom(compiler::Assembler* assembler) {
|
||||
const auto& comments = assembler->comments();
|
||||
Code::Comments& result = Code::Comments::New(comments.length());
|
||||
|
@ -21,7 +20,6 @@ const Code::Comments& CreateCommentsFrom(compiler::Assembler* assembler) {
|
|||
return result;
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME) && \
|
||||
// (!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
|
||||
|
||||
} // namespace dart
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
#ifndef RUNTIME_VM_CODE_COMMENTS_H_
|
||||
#define RUNTIME_VM_CODE_COMMENTS_H_
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME) && \
|
||||
(!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
|
||||
|
||||
#include "vm/code_observers.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/object.h"
|
||||
|
||||
namespace dart {
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME) && \
|
||||
(!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
|
||||
|
||||
class CodeCommentsWrapper final : public CodeComments {
|
||||
public:
|
||||
explicit CodeCommentsWrapper(const Code::Comments& comments)
|
||||
|
@ -37,9 +37,9 @@ class CodeCommentsWrapper final : public CodeComments {
|
|||
|
||||
const Code::Comments& CreateCommentsFrom(compiler::Assembler* assembler);
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME) && \
|
||||
// (!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME) && \
|
||||
// (!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
|
||||
#endif // RUNTIME_VM_CODE_COMMENTS_H_
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "vm/code_descriptors.h"
|
||||
|
||||
#include "vm/compiler/compiler_state.h"
|
||||
#include "vm/compiler/api/deopt_id.h"
|
||||
#include "vm/log.h"
|
||||
#include "vm/object_store.h"
|
||||
#include "vm/zone_text_buffer.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "vm/code_patcher.h"
|
||||
|
||||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
#include "vm/instructions.h"
|
||||
#include "vm/object.h"
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
#if defined(TARGET_ARCH_IA32)
|
||||
|
||||
#include "vm/code_patcher.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
#include "vm/cpu.h"
|
||||
#include "vm/dart_entry.h"
|
||||
#include "vm/instructions.h"
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
#if defined(TARGET_ARCH_X64)
|
||||
|
||||
#include "vm/code_patcher.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
#include "vm/cpu.h"
|
||||
#include "vm/dart_entry.h"
|
||||
#include "vm/instructions.h"
|
||||
|
|
52
runtime/vm/compiler/api/deopt_id.h
Normal file
52
runtime/vm/compiler/api/deopt_id.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
// Copyright (c) 2020, 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_API_DEOPT_ID_H_
|
||||
#define RUNTIME_VM_COMPILER_API_DEOPT_ID_H_
|
||||
|
||||
#include "platform/allocation.h"
|
||||
|
||||
namespace dart {
|
||||
|
||||
// Deoptimization Id logic.
|
||||
//
|
||||
// Deoptimization ids are used to refer to deoptimization points, at which
|
||||
// control can enter unoptimized code from the optimized version of the code.
|
||||
//
|
||||
// Note: any instruction that does a call has two deoptimization points,
|
||||
// one before the call and one after the call - so that we could deoptimize
|
||||
// to either before or after the call depending on whether the same call
|
||||
// already occured in the optimized code (and potentially produced
|
||||
// observable side-effects) or not.
|
||||
//
|
||||
// To simplify implementation we always allocate two deopt ids (one for before
|
||||
// point and one for the after point).
|
||||
class DeoptId : public AllStatic {
|
||||
public:
|
||||
static constexpr intptr_t kNone = -1;
|
||||
|
||||
static inline intptr_t Next(intptr_t deopt_id) { return deopt_id + kStep; }
|
||||
|
||||
static inline intptr_t ToDeoptAfter(intptr_t deopt_id) {
|
||||
ASSERT(IsDeoptBefore(deopt_id));
|
||||
return deopt_id + kAfterOffset;
|
||||
}
|
||||
|
||||
static inline bool IsDeoptBefore(intptr_t deopt_id) {
|
||||
return (deopt_id % kStep) == kBeforeOffset;
|
||||
}
|
||||
|
||||
static inline bool IsDeoptAfter(intptr_t deopt_id) {
|
||||
return (deopt_id % kStep) == kAfterOffset;
|
||||
}
|
||||
|
||||
private:
|
||||
static constexpr intptr_t kStep = 2;
|
||||
static constexpr intptr_t kBeforeOffset = 0;
|
||||
static constexpr intptr_t kAfterOffset = 1;
|
||||
};
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // RUNTIME_VM_COMPILER_API_DEOPT_ID_H_
|
70
runtime/vm/compiler/api/print_filter.cc
Normal file
70
runtime/vm/compiler/api/print_filter.cc
Normal file
|
@ -0,0 +1,70 @@
|
|||
// Copyright (c) 2020, 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.
|
||||
#if !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
|
||||
|
||||
#include "vm/compiler/api/print_filter.h"
|
||||
|
||||
#include "vm/flags.h"
|
||||
#include "vm/object.h"
|
||||
|
||||
namespace dart {
|
||||
|
||||
DEFINE_FLAG(charp,
|
||||
print_flow_graph_filter,
|
||||
NULL,
|
||||
"Print only IR of functions with matching names");
|
||||
|
||||
namespace compiler {
|
||||
|
||||
// Checks whether function's name matches the given filter, which is
|
||||
// a comma-separated list of strings.
|
||||
static bool PassesFilter(const char* filter, const Function& function) {
|
||||
if (filter == NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
char* save_ptr; // Needed for strtok_r.
|
||||
const char* scrubbed_name =
|
||||
String::Handle(function.QualifiedScrubbedName()).ToCString();
|
||||
const char* function_name = function.ToFullyQualifiedCString();
|
||||
intptr_t function_name_len = strlen(function_name);
|
||||
|
||||
intptr_t len = strlen(filter) + 1; // Length with \0.
|
||||
char* filter_buffer = new char[len];
|
||||
strncpy(filter_buffer, filter, len); // strtok modifies arg 1.
|
||||
char* token = strtok_r(filter_buffer, ",", &save_ptr);
|
||||
bool found = false;
|
||||
while (token != NULL) {
|
||||
if ((strstr(function_name, token) != NULL) ||
|
||||
(strstr(scrubbed_name, token) != NULL)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
const intptr_t token_len = strlen(token);
|
||||
if (token[token_len - 1] == '%') {
|
||||
if (function_name_len > token_len) {
|
||||
const char* suffix =
|
||||
function_name + (function_name_len - token_len + 1);
|
||||
if (strncmp(suffix, token, token_len - 1) == 0) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
token = strtok_r(NULL, ",", &save_ptr);
|
||||
}
|
||||
delete[] filter_buffer;
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
bool PrintFilter::ShouldPrint(const Function& function) {
|
||||
return PassesFilter(FLAG_print_flow_graph_filter, function);
|
||||
}
|
||||
|
||||
} // namespace compiler
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
|
27
runtime/vm/compiler/api/print_filter.h
Normal file
27
runtime/vm/compiler/api/print_filter.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c) 2020, 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_API_PRINT_FILTER_H_
|
||||
#define RUNTIME_VM_COMPILER_API_PRINT_FILTER_H_
|
||||
#if !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
|
||||
|
||||
#include "platform/allocation.h"
|
||||
|
||||
namespace dart {
|
||||
|
||||
class Function;
|
||||
|
||||
namespace compiler {
|
||||
|
||||
class PrintFilter : public AllStatic {
|
||||
public:
|
||||
static bool ShouldPrint(const Function& function);
|
||||
};
|
||||
|
||||
} // namespace compiler
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
|
||||
#endif // RUNTIME_VM_COMPILER_API_PRINT_FILTER_H_
|
29
runtime/vm/compiler/api/type_check_mode.h
Normal file
29
runtime/vm/compiler/api/type_check_mode.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Copyright (c) 2020, 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_API_TYPE_CHECK_MODE_H_
|
||||
#define RUNTIME_VM_COMPILER_API_TYPE_CHECK_MODE_H_
|
||||
|
||||
namespace dart {
|
||||
|
||||
// Invocation mode for TypeCheck runtime entry that describes
|
||||
// where we are calling it from.
|
||||
enum TypeCheckMode {
|
||||
// TypeCheck is invoked from LazySpecializeTypeTest stub.
|
||||
// It should replace stub on the type with a specialized version.
|
||||
kTypeCheckFromLazySpecializeStub,
|
||||
|
||||
// TypeCheck is invoked from the SlowTypeTest stub.
|
||||
// This means that cache can be lazily created (if needed)
|
||||
// and dst_name can be fetched from the pool.
|
||||
kTypeCheckFromSlowStub,
|
||||
|
||||
// TypeCheck is invoked from normal inline AssertAssignable.
|
||||
// Both cache and dst_name must be already populated.
|
||||
kTypeCheckFromInline
|
||||
};
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // RUNTIME_VM_COMPILER_API_TYPE_CHECK_MODE_H_
|
|
@ -589,8 +589,6 @@ class Assembler : public AssemblerBase {
|
|||
B4 | (imm16 & 0xf);
|
||||
}
|
||||
|
||||
static uword GetBreakInstructionFiller() { return BkptEncoding(0); }
|
||||
|
||||
// Floating point instructions (VFPv3-D16 and VFPv3-D32 profiles).
|
||||
void vmovsr(SRegister sn, Register rt, Condition cond = AL);
|
||||
void vmovrs(Register rt, SRegister sn, Condition cond = AL);
|
||||
|
|
|
@ -1034,11 +1034,6 @@ class Assembler : public AssemblerBase {
|
|||
// Breakpoint.
|
||||
void brk(uint16_t imm) { EmitExceptionGenOp(BRK, imm); }
|
||||
|
||||
static uword GetBreakInstructionFiller() {
|
||||
const intptr_t encoding = ExceptionGenOpEncoding(BRK, 0);
|
||||
return encoding << 32 | encoding;
|
||||
}
|
||||
|
||||
// Double floating point.
|
||||
bool fmovdi(VRegister vd, double immd) {
|
||||
int64_t imm64 = bit_cast<int64_t, double>(immd);
|
||||
|
|
|
@ -549,8 +549,6 @@ class Assembler : public AssemblerBase {
|
|||
void int3();
|
||||
void hlt();
|
||||
|
||||
static uword GetBreakInstructionFiller() { return 0xCCCCCCCC; }
|
||||
|
||||
void j(Condition condition, Label* label, bool near = kFarJump);
|
||||
void j(Condition condition, const ExternalLabel* label);
|
||||
|
||||
|
|
|
@ -642,8 +642,6 @@ class Assembler : public AssemblerBase {
|
|||
// 'size' indicates size in bytes and must be in the range 1..8.
|
||||
void nop(int size = 1);
|
||||
|
||||
static uword GetBreakInstructionFiller() { return 0xCCCCCCCCCCCCCCCC; }
|
||||
|
||||
void j(Condition condition, Label* label, bool near = kFarJump);
|
||||
void jmp(Register reg) { EmitUnaryL(reg, 0xFF, 4); }
|
||||
void jmp(const Address& address) { EmitUnaryL(address, 0xFF, 4); }
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
#include "vm/compiler/assembler/disassembler.h"
|
||||
|
||||
#include "vm/code_patcher.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/il_printer.h"
|
||||
#include "vm/deopt_instructions.h"
|
||||
#include "vm/globals.h"
|
||||
#include "vm/instructions.h"
|
||||
|
@ -18,7 +16,10 @@ namespace dart {
|
|||
|
||||
#if !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
DECLARE_FLAG(bool, trace_inlining_intervals);
|
||||
#endif
|
||||
|
||||
DEFINE_FLAG(bool, trace_source_positions, false, "Source position diagnostics");
|
||||
|
||||
void DisassembleToStdout::ConsumeInstruction(char* hex_buffer,
|
||||
|
@ -416,9 +417,12 @@ void Disassembler::DisassembleCodeHelper(const char* function_fullname,
|
|||
}
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
if (optimized && FLAG_trace_inlining_intervals) {
|
||||
code.DumpInlineIntervals();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (FLAG_trace_source_positions) {
|
||||
code.DumpSourcePositions();
|
||||
}
|
||||
|
|
|
@ -6,11 +6,14 @@
|
|||
#define RUNTIME_VM_COMPILER_ASSEMBLER_DISASSEMBLER_H_
|
||||
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/globals.h"
|
||||
#include "vm/log.h"
|
||||
#include "vm/object.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
// Forward declaration.
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "platform/utils.h"
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/constants_x86.h"
|
||||
#include "vm/heap/heap.h"
|
||||
#include "vm/instructions.h"
|
||||
#include "vm/os.h"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
|
||||
#include "vm/compiler/api/type_check_mode.h"
|
||||
#include "vm/compiler/backend/il_printer.h"
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
|
||||
#include "vm/compiler/api/type_check_mode.h"
|
||||
#include "vm/compiler/backend/il_printer.h"
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
|
||||
#include "vm/code_patcher.h"
|
||||
#include "vm/compiler/api/type_check_mode.h"
|
||||
#include "vm/compiler/backend/il_printer.h"
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#include "vm/compiler/frontend/flow_graph_builder.h"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
|
||||
#include "vm/compiler/api/type_check_mode.h"
|
||||
#include "vm/compiler/backend/il_printer.h"
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#include "vm/compiler/ffi/native_location.h"
|
||||
|
|
|
@ -5804,13 +5804,8 @@ class AllocateUninitializedContextInstr
|
|||
virtual bool HasUnknownSideEffects() const { return false; }
|
||||
|
||||
virtual bool WillAllocateNewOrRemembered() const {
|
||||
return WillAllocateNewOrRemembered(num_context_variables_);
|
||||
}
|
||||
|
||||
static bool WillAllocateNewOrRemembered(intptr_t num_context_variables) {
|
||||
if (!Context::IsValidLength(num_context_variables)) return false;
|
||||
return Heap::IsAllocatableInNewSpace(
|
||||
Context::InstanceSize(num_context_variables));
|
||||
return compiler::target::WillAllocateNewOrRememberedContext(
|
||||
num_context_variables_);
|
||||
}
|
||||
|
||||
virtual AliasIdentity Identity() const { return identity_; }
|
||||
|
@ -5965,12 +5960,8 @@ class CreateArrayInstr : public TemplateAllocation<2, Throws> {
|
|||
if (!num_elements()->BindsToConstant()) return false;
|
||||
const Object& length = num_elements()->BoundConstant();
|
||||
if (!length.IsSmi()) return false;
|
||||
return WillAllocateNewOrRemembered(Smi::Cast(length).Value());
|
||||
}
|
||||
|
||||
static bool WillAllocateNewOrRemembered(const intptr_t length) {
|
||||
if (!Array::IsValidLength(length)) return false;
|
||||
return !Array::UseCardMarkingForAllocation(length);
|
||||
return compiler::target::WillAllocateNewOrRememberedArray(
|
||||
Smi::Cast(length).Value());
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -6291,13 +6282,8 @@ class AllocateContextInstr : public TemplateAllocation<0, NoThrow> {
|
|||
virtual bool HasUnknownSideEffects() const { return false; }
|
||||
|
||||
virtual bool WillAllocateNewOrRemembered() const {
|
||||
return WillAllocateNewOrRemembered(context_slots().length());
|
||||
}
|
||||
|
||||
static bool WillAllocateNewOrRemembered(intptr_t num_context_variables) {
|
||||
if (!Context::IsValidLength(num_context_variables)) return false;
|
||||
return Heap::IsAllocatableInNewSpace(
|
||||
Context::InstanceSize(num_context_variables));
|
||||
return compiler::target::WillAllocateNewOrRememberedContext(
|
||||
context_slots().length());
|
||||
}
|
||||
|
||||
PRINT_OPERANDS_TO_SUPPORT
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "vm/compiler/backend/il_printer.h"
|
||||
|
||||
#include "vm/compiler/api/print_filter.h"
|
||||
#include "vm/compiler/backend/il.h"
|
||||
#include "vm/compiler/backend/range_analysis.h"
|
||||
#include "vm/compiler/ffi/native_calling_convention.h"
|
||||
|
@ -14,60 +15,6 @@ namespace dart {
|
|||
|
||||
#if !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
|
||||
|
||||
DEFINE_FLAG(charp,
|
||||
print_flow_graph_filter,
|
||||
NULL,
|
||||
"Print only IR of functions with matching names");
|
||||
|
||||
// Checks whether function's name matches the given filter, which is
|
||||
// a comma-separated list of strings.
|
||||
bool FlowGraphPrinter::PassesFilter(const char* filter,
|
||||
const Function& function) {
|
||||
if (filter == NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
char* save_ptr; // Needed for strtok_r.
|
||||
const char* scrubbed_name =
|
||||
String::Handle(function.QualifiedScrubbedName()).ToCString();
|
||||
const char* function_name = function.ToFullyQualifiedCString();
|
||||
intptr_t function_name_len = strlen(function_name);
|
||||
|
||||
intptr_t len = strlen(filter) + 1; // Length with \0.
|
||||
char* filter_buffer = new char[len];
|
||||
strncpy(filter_buffer, filter, len); // strtok modifies arg 1.
|
||||
char* token = strtok_r(filter_buffer, ",", &save_ptr);
|
||||
bool found = false;
|
||||
while (token != NULL) {
|
||||
if ((strstr(function_name, token) != NULL) ||
|
||||
(strstr(scrubbed_name, token) != NULL)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
const intptr_t token_len = strlen(token);
|
||||
if (token[token_len - 1] == '%') {
|
||||
if (function_name_len > token_len) {
|
||||
const char* suffix =
|
||||
function_name + (function_name_len - token_len + 1);
|
||||
if (strncmp(suffix, token, token_len - 1) == 0) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
token = strtok_r(NULL, ",", &save_ptr);
|
||||
}
|
||||
delete[] filter_buffer;
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
bool FlowGraphPrinter::ShouldPrint(const Function& function) {
|
||||
return PassesFilter(FLAG_print_flow_graph_filter, function);
|
||||
}
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
DEFINE_FLAG(bool,
|
||||
display_sorted_ic_data,
|
||||
false,
|
||||
|
@ -76,6 +23,10 @@ DEFINE_FLAG(bool, print_environments, false, "Print SSA environments.");
|
|||
|
||||
DECLARE_FLAG(bool, trace_inlining_intervals);
|
||||
|
||||
bool FlowGraphPrinter::ShouldPrint(const Function& function) {
|
||||
return compiler::PrintFilter::ShouldPrint(function);
|
||||
}
|
||||
|
||||
void FlowGraphPrinter::PrintGraph(const char* phase, FlowGraph* flow_graph) {
|
||||
LogBlock lb;
|
||||
THR_Print("*** BEGIN CFG\n%s\n", phase);
|
||||
|
@ -1224,12 +1175,8 @@ const char* Environment::ToCString() const {
|
|||
return Thread::Current()->zone()->MakeCopyOfString(buffer);
|
||||
}
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#else // !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
const char* Instruction::ToCString() const {
|
||||
return DebugName();
|
||||
}
|
||||
|
@ -1266,8 +1213,6 @@ bool FlowGraphPrinter::ShouldPrint(const Function& function) {
|
|||
return false;
|
||||
}
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#endif // !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
|
||||
|
||||
} // namespace dart
|
||||
|
|
|
@ -54,8 +54,6 @@ class FlowGraphPrinter : public ValueObject {
|
|||
|
||||
static bool ShouldPrint(const Function& function);
|
||||
|
||||
static bool PassesFilter(const char* filter, const Function& function);
|
||||
|
||||
private:
|
||||
const Function& function_;
|
||||
const GrowableArray<BlockEntryInstr*>& block_order_;
|
||||
|
|
|
@ -28,13 +28,6 @@ compiler_sources = [
|
|||
"assembler/assembler_ia32.h",
|
||||
"assembler/assembler_x64.cc",
|
||||
"assembler/assembler_x64.h",
|
||||
"assembler/disassembler.cc",
|
||||
"assembler/disassembler.h",
|
||||
"assembler/disassembler_arm.cc",
|
||||
"assembler/disassembler_arm64.cc",
|
||||
"assembler/disassembler_kbc.cc",
|
||||
"assembler/disassembler_kbc.h",
|
||||
"assembler/disassembler_x86.cc",
|
||||
"assembler/object_pool_builder.h",
|
||||
"backend/block_builder.h",
|
||||
"backend/block_scheduler.cc",
|
||||
|
@ -112,8 +105,6 @@ compiler_sources = [
|
|||
"ffi/native_calling_convention.h",
|
||||
"ffi/native_location.cc",
|
||||
"ffi/native_location.h",
|
||||
"ffi/native_type.cc",
|
||||
"ffi/native_type.h",
|
||||
"ffi/recognized_method.cc",
|
||||
"ffi/recognized_method.h",
|
||||
"frontend/base_flow_graph_builder.cc",
|
||||
|
@ -150,8 +141,6 @@ compiler_sources = [
|
|||
"graph_intrinsifier_x64.cc",
|
||||
"intrinsifier.cc",
|
||||
"intrinsifier.h",
|
||||
"jit/compiler.cc",
|
||||
"jit/compiler.h",
|
||||
"jit/jit_call_specializer.cc",
|
||||
"jit/jit_call_specializer.h",
|
||||
"method_recognizer.cc",
|
||||
|
@ -159,8 +148,6 @@ compiler_sources = [
|
|||
"recognized_methods_list.h",
|
||||
"relocation.cc",
|
||||
"relocation.h",
|
||||
"runtime_api.cc",
|
||||
"runtime_api.h",
|
||||
"stub_code_compiler.cc",
|
||||
"stub_code_compiler.h",
|
||||
"stub_code_compiler_arm.cc",
|
||||
|
@ -196,3 +183,26 @@ compiler_sources_tests = [
|
|||
"cha_test.cc",
|
||||
"write_barrier_elimination_test.cc",
|
||||
]
|
||||
|
||||
compiler_api_sources = [
|
||||
"api/deopt_id.h",
|
||||
"api/print_filter.cc",
|
||||
"api/print_filter.h",
|
||||
"api/type_check_mode.h",
|
||||
"ffi/native_type.cc",
|
||||
"ffi/native_type.h",
|
||||
"jit/compiler.cc",
|
||||
"jit/compiler.h",
|
||||
"runtime_api.cc",
|
||||
"runtime_api.h",
|
||||
]
|
||||
|
||||
disassembler_sources = [
|
||||
"assembler/disassembler.cc",
|
||||
"assembler/disassembler.h",
|
||||
"assembler/disassembler_arm.cc",
|
||||
"assembler/disassembler_arm64.cc",
|
||||
"assembler/disassembler_kbc.cc",
|
||||
"assembler/disassembler_kbc.h",
|
||||
"assembler/disassembler_x86.cc",
|
||||
]
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
#include "vm/compiler/compiler_state.h"
|
||||
#include "vm/growable_array.h"
|
||||
|
||||
#ifndef DART_PRECOMPILED_RUNTIME
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "vm/compiler/backend/slot.h"
|
||||
#include "vm/growable_array.h"
|
||||
#include "vm/scopes.h"
|
||||
|
||||
namespace dart {
|
||||
|
@ -72,5 +71,3 @@ const ZoneGrowableArray<const Slot*>& CompilerState::GetDummyContextSlots(
|
|||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // DART_PRECOMPILED_RUNTIME
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#ifndef RUNTIME_VM_COMPILER_COMPILER_STATE_H_
|
||||
#define RUNTIME_VM_COMPILER_COMPILER_STATE_H_
|
||||
|
||||
#include "vm/compiler/api/deopt_id.h"
|
||||
#include "vm/compiler/cha.h"
|
||||
#include "vm/heap/safepoint.h"
|
||||
#include "vm/thread.h"
|
||||
|
@ -16,44 +17,6 @@ class LocalVariable;
|
|||
class SlotCache;
|
||||
class Slot;
|
||||
|
||||
// Deoptimization Id logic.
|
||||
//
|
||||
// Deoptimization ids are used to refer to deoptimization points, at which
|
||||
// control can enter unoptimized code from the optimized version of the code.
|
||||
//
|
||||
// Note: any instruction that does a call has two deoptimization points,
|
||||
// one before the call and one after the call - so that we could deoptimize
|
||||
// to either before or after the call depending on whether the same call
|
||||
// already occured in the optimized code (and potentially produced
|
||||
// observable side-effects) or not.
|
||||
//
|
||||
// To simplify implementation we always allocate two deopt ids (one for before
|
||||
// point and one for the after point).
|
||||
class DeoptId : public AllStatic {
|
||||
public:
|
||||
static constexpr intptr_t kNone = -1;
|
||||
|
||||
static inline intptr_t Next(intptr_t deopt_id) { return deopt_id + kStep; }
|
||||
|
||||
static inline intptr_t ToDeoptAfter(intptr_t deopt_id) {
|
||||
ASSERT(IsDeoptBefore(deopt_id));
|
||||
return deopt_id + kAfterOffset;
|
||||
}
|
||||
|
||||
static inline bool IsDeoptBefore(intptr_t deopt_id) {
|
||||
return (deopt_id % kStep) == kBeforeOffset;
|
||||
}
|
||||
|
||||
static inline bool IsDeoptAfter(intptr_t deopt_id) {
|
||||
return (deopt_id % kStep) == kAfterOffset;
|
||||
}
|
||||
|
||||
private:
|
||||
static constexpr intptr_t kStep = 2;
|
||||
static constexpr intptr_t kBeforeOffset = 0;
|
||||
static constexpr intptr_t kAfterOffset = 1;
|
||||
};
|
||||
|
||||
// Global compiler state attached to the thread.
|
||||
class CompilerState : public ThreadStackResource {
|
||||
public:
|
||||
|
|
|
@ -6,10 +6,13 @@
|
|||
|
||||
#include "platform/assert.h"
|
||||
#include "platform/globals.h"
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#include "vm/compiler/runtime_api.h"
|
||||
#include "vm/object.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
namespace compiler {
|
||||
|
@ -121,6 +124,7 @@ intptr_t NativeFundamentalType::AlignmentInBytesField() const {
|
|||
UNREACHABLE();
|
||||
}
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
bool NativeFundamentalType::IsExpressibleAsRepresentation() const {
|
||||
switch (representation_) {
|
||||
case kInt8:
|
||||
|
@ -163,6 +167,7 @@ Representation NativeFundamentalType::AsRepresentation() const {
|
|||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
bool NativeFundamentalType::Equals(const NativeType& other) const {
|
||||
if (!other.IsFundamental()) {
|
||||
|
@ -242,6 +247,7 @@ NativeType& NativeType::FromAbstractType(const AbstractType& type, Zone* zone) {
|
|||
return NativeType::FromTypedDataClassId(type.type_class_id(), zone);
|
||||
}
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
static FundamentalType fundamental_rep(Representation rep) {
|
||||
switch (rep) {
|
||||
case kUnboxedDouble:
|
||||
|
@ -264,6 +270,7 @@ NativeFundamentalType& NativeType::FromUnboxedRepresentation(Representation rep,
|
|||
Zone* zone) {
|
||||
return *new (zone) NativeFundamentalType(fundamental_rep(rep));
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
const char* NativeType::ToCString() const {
|
||||
char buffer[1024];
|
||||
|
|
|
@ -9,11 +9,16 @@
|
|||
|
||||
#include "platform/assert.h"
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#include "vm/compiler/runtime_api.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#endif
|
||||
|
||||
namespace dart {
|
||||
|
||||
class BufferFormatter;
|
||||
|
||||
namespace compiler {
|
||||
|
||||
namespace ffi {
|
||||
|
@ -31,7 +36,7 @@ class NativeFundamentalType;
|
|||
// * tagged
|
||||
// * untagged
|
||||
//
|
||||
// Instead, NativeTypes support representations not supprted in Dart's unboxed
|
||||
// Instead, NativeTypes support representations not supported in Dart's unboxed
|
||||
// Representations, such as:
|
||||
// * Fundamental types (https://en.cppreference.com/w/cpp/language/types):
|
||||
// * int8_t
|
||||
|
@ -48,8 +53,11 @@ class NativeType : public ZoneAllocated {
|
|||
public:
|
||||
static NativeType& FromAbstractType(const AbstractType& type, Zone* zone);
|
||||
static NativeType& FromTypedDataClassId(classid_t class_id, Zone* zone);
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
static NativeFundamentalType& FromUnboxedRepresentation(Representation rep,
|
||||
Zone* zone);
|
||||
#endif
|
||||
|
||||
virtual bool IsFundamental() const { return false; }
|
||||
const NativeFundamentalType& AsFundamental() const;
|
||||
|
@ -71,6 +79,7 @@ class NativeType : public ZoneAllocated {
|
|||
// The alignment in bytes of this representation as member of a composite.
|
||||
virtual intptr_t AlignmentInBytesField() const = 0;
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
// NativeTypes which are available as unboxed Representations.
|
||||
virtual bool IsExpressibleAsRepresentation() const { return false; }
|
||||
|
||||
|
@ -82,6 +91,7 @@ class NativeType : public ZoneAllocated {
|
|||
const auto& widened = WidenTo4Bytes(zone_);
|
||||
return widened.AsRepresentation();
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
virtual bool Equals(const NativeType& other) const { UNREACHABLE(); }
|
||||
|
||||
|
@ -135,8 +145,10 @@ class NativeFundamentalType : public NativeType {
|
|||
virtual intptr_t AlignmentInBytesStack() const;
|
||||
virtual intptr_t AlignmentInBytesField() const;
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
virtual bool IsExpressibleAsRepresentation() const;
|
||||
virtual Representation AsRepresentation() const;
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
virtual bool Equals(const NativeType& other) const;
|
||||
virtual NativeFundamentalType& Split(intptr_t part, Zone* zone) const;
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/code_patcher.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/assembler/disassembler.h"
|
||||
#include "vm/compiler/backend/block_scheduler.h"
|
||||
#include "vm/compiler/backend/branch_optimizer.h"
|
||||
|
@ -45,6 +45,7 @@
|
|||
#include "vm/thread_registry.h"
|
||||
#include "vm/timeline.h"
|
||||
#include "vm/timer.h"
|
||||
#endif
|
||||
|
||||
namespace dart {
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#define RUNTIME_VM_COMPILER_JIT_COMPILER_H_
|
||||
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/compiler/compiler_state.h"
|
||||
#include "vm/compiler/api/deopt_id.h"
|
||||
#include "vm/growable_array.h"
|
||||
#include "vm/runtime_entry.h"
|
||||
#include "vm/thread_pool.h"
|
||||
|
|
|
@ -4,6 +4,20 @@
|
|||
|
||||
#include "vm/compiler/runtime_api.h"
|
||||
|
||||
#include "vm/object.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/runtime_offsets_list.h"
|
||||
#include "vm/dart_entry.h"
|
||||
#include "vm/longjump.h"
|
||||
#include "vm/native_arguments.h"
|
||||
#include "vm/native_entry.h"
|
||||
#include "vm/object_store.h"
|
||||
#include "vm/runtime_entry.h"
|
||||
#include "vm/symbols.h"
|
||||
#include "vm/timeline.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
namespace compiler {
|
||||
namespace target {
|
||||
|
@ -14,23 +28,23 @@ bool IsSmi(int64_t v) {
|
|||
return Utils::IsInt(kSmiBits + 1, v);
|
||||
}
|
||||
|
||||
bool WillAllocateNewOrRememberedContext(intptr_t num_context_variables) {
|
||||
if (!dart::Context::IsValidLength(num_context_variables)) return false;
|
||||
return dart::Heap::IsAllocatableInNewSpace(
|
||||
dart::Context::InstanceSize(num_context_variables));
|
||||
}
|
||||
|
||||
bool WillAllocateNewOrRememberedArray(intptr_t length) {
|
||||
if (!dart::Array::IsValidLength(length)) return false;
|
||||
return !dart::Array::UseCardMarkingForAllocation(length);
|
||||
}
|
||||
|
||||
} // namespace target
|
||||
} // namespace compiler
|
||||
} // namespace dart
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#include "vm/compiler/runtime_offsets_list.h"
|
||||
#include "vm/dart_entry.h"
|
||||
#include "vm/longjump.h"
|
||||
#include "vm/native_arguments.h"
|
||||
#include "vm/native_entry.h"
|
||||
#include "vm/object.h"
|
||||
#include "vm/object_store.h"
|
||||
#include "vm/runtime_entry.h"
|
||||
#include "vm/symbols.h"
|
||||
#include "vm/timeline.h"
|
||||
|
||||
namespace dart {
|
||||
namespace compiler {
|
||||
|
||||
|
|
|
@ -362,6 +362,10 @@ bool CanEmbedAsRawPointerInGeneratedCode(const dart::Object& obj);
|
|||
word ToRawPointer(const dart::Object& a);
|
||||
#endif // defined(TARGET_ARCH_IA32)
|
||||
|
||||
bool WillAllocateNewOrRememberedContext(intptr_t num_context_variables);
|
||||
|
||||
bool WillAllocateNewOrRememberedArray(intptr_t length);
|
||||
|
||||
//
|
||||
// Target specific offsets and constants.
|
||||
//
|
||||
|
|
|
@ -50,7 +50,6 @@ class StubCodeCompiler : public AllStatic {
|
|||
const Object& context_allocation_stub);
|
||||
#endif
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
static RawArray* BuildStaticCallsTable(
|
||||
Zone* zone,
|
||||
compiler::UnresolvedPcRelativeCalls* unresolved_calls);
|
||||
|
@ -121,31 +120,12 @@ class StubCodeCompiler : public AllStatic {
|
|||
|
||||
static void GenerateJITCallbackTrampolines(Assembler* assembler,
|
||||
intptr_t next_callback_id);
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
};
|
||||
|
||||
} // namespace compiler
|
||||
|
||||
enum DeoptStubKind { kLazyDeoptFromReturn, kLazyDeoptFromThrow, kEagerDeopt };
|
||||
|
||||
// Invocation mode for TypeCheck runtime entry that describes
|
||||
// where we are calling it from.
|
||||
enum TypeCheckMode {
|
||||
// TypeCheck is invoked from LazySpecializeTypeTest stub.
|
||||
// It should replace stub on the type with a specialized version.
|
||||
kTypeCheckFromLazySpecializeStub,
|
||||
|
||||
// TypeCheck is invoked from the SlowTypeTest stub.
|
||||
// This means that cache can be lazily created (if needed)
|
||||
// and dst_name can be fetched from the pool.
|
||||
kTypeCheckFromSlowStub,
|
||||
|
||||
// TypeCheck is invoked from normal inline AssertAssignable.
|
||||
// Both cache and dst_name must be already populated.
|
||||
kTypeCheckFromInline
|
||||
};
|
||||
|
||||
// Zap value used to indicate unused CODE_REG in deopt.
|
||||
static const uword kZapCodeReg = 0xf1f1f1f1;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "vm/class_id.h"
|
||||
#include "vm/code_entry_kind.h"
|
||||
#include "vm/compiler/api/type_check_mode.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#include "vm/constants.h"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "vm/class_id.h"
|
||||
#include "vm/code_entry_kind.h"
|
||||
#include "vm/compiler/api/type_check_mode.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#include "vm/constants.h"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "vm/class_id.h"
|
||||
#include "vm/code_entry_kind.h"
|
||||
#include "vm/compiler/api/type_check_mode.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#include "vm/constants.h"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "vm/class_id.h"
|
||||
#include "vm/code_entry_kind.h"
|
||||
#include "vm/compiler/api/type_check_mode.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/constants.h"
|
||||
#include "vm/instructions.h"
|
||||
|
|
|
@ -947,6 +947,8 @@ float ReciprocalStep(float op1, float op2);
|
|||
float ReciprocalSqrtEstimate(float op);
|
||||
float ReciprocalSqrtStep(float op1, float op2);
|
||||
|
||||
constexpr uword kBreakInstructionFiller = 0xE1200070; // bkpt #0
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // RUNTIME_VM_CONSTANTS_ARM_H_
|
||||
|
|
|
@ -1326,6 +1326,8 @@ class Instr {
|
|||
DISALLOW_IMPLICIT_CONSTRUCTORS(Instr);
|
||||
};
|
||||
|
||||
const uword kBreakInstructionFiller = 0xD4200000D4200000L; // brk #0; brk #0
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // RUNTIME_VM_CONSTANTS_ARM64_H_
|
||||
|
|
|
@ -247,6 +247,8 @@ class CallingConventions {
|
|||
static constexpr ExtensionStrategy kArgumentStackExtension = kExtendedTo4;
|
||||
};
|
||||
|
||||
const uword kBreakInstructionFiller = 0xCCCCCCCC;
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // RUNTIME_VM_CONSTANTS_IA32_H_
|
||||
|
|
|
@ -408,6 +408,8 @@ class Instr {
|
|||
// becomes important to us.
|
||||
const int MAX_NOP_SIZE = 8;
|
||||
|
||||
const uword kBreakInstructionFiller = 0xCCCCCCCCCCCCCCCCL;
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // RUNTIME_VM_CONSTANTS_X64_H_
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "vm/cpu.h"
|
||||
#include "vm/cpu_x64.h"
|
||||
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/constants.h"
|
||||
#include "vm/cpuinfo.h"
|
||||
#include "vm/heap/heap.h"
|
||||
|
|
|
@ -22,11 +22,7 @@
|
|||
#include "vm/debugger.h"
|
||||
#include "vm/dwarf.h"
|
||||
#include "vm/elf.h"
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/kernel_loader.h"
|
||||
#endif
|
||||
#include "platform/unicode.h"
|
||||
#include "vm/compiler/aot/precompiler.h"
|
||||
#include "vm/exceptions.h"
|
||||
#include "vm/flags.h"
|
||||
#include "vm/growable_array.h"
|
||||
|
@ -59,6 +55,11 @@
|
|||
#include "vm/uri.h"
|
||||
#include "vm/version.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/aot/precompiler.h"
|
||||
#include "vm/kernel_loader.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
// Facilitate quick access to the current zone once we have the current thread.
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "platform/safe_stack.h"
|
||||
#include "vm/class_finalizer.h"
|
||||
#include "vm/compiler/frontend/bytecode_reader.h"
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
#include "vm/debugger.h"
|
||||
#include "vm/dispatch_table.h"
|
||||
#include "vm/heap/safepoint.h"
|
||||
|
@ -19,6 +17,11 @@
|
|||
#include "vm/stub_code.h"
|
||||
#include "vm/symbols.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/frontend/bytecode_reader.h"
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
#include "platform/address_sanitizer.h"
|
||||
|
||||
#include "vm/code_descriptors.h"
|
||||
#include "vm/code_patcher.h"
|
||||
#include "vm/compiler/api/deopt_id.h"
|
||||
#include "vm/compiler/assembler/disassembler.h"
|
||||
#include "vm/compiler/assembler/disassembler_kbc.h"
|
||||
#include "vm/compiler/frontend/bytecode_reader.h"
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
#include "vm/dart_entry.h"
|
||||
#include "vm/deopt_instructions.h"
|
||||
#include "vm/flags.h"
|
||||
#include "vm/globals.h"
|
||||
#include "vm/interpreter.h"
|
||||
|
@ -41,6 +41,11 @@
|
|||
#include "vm/token_position.h"
|
||||
#include "vm/visitor.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/frontend/bytecode_reader.h"
|
||||
#include "vm/deopt_instructions.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
DEFINE_FLAG(bool,
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "vm/debugger.h"
|
||||
|
||||
#include "vm/code_patcher.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/cpu.h"
|
||||
#include "vm/instructions.h"
|
||||
#include "vm/stub_code.h"
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
#ifndef RUNTIME_VM_DEOPT_INSTRUCTIONS_H_
|
||||
#define RUNTIME_VM_DEOPT_INSTRUCTIONS_H_
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/code_descriptors.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
#include "vm/compiler/backend/locations.h"
|
||||
#include "vm/deferred_objects.h"
|
||||
|
@ -19,6 +19,7 @@
|
|||
|
||||
namespace dart {
|
||||
|
||||
class Location;
|
||||
class Value;
|
||||
class MaterializeObjectInstr;
|
||||
class StackFrame;
|
||||
|
@ -615,4 +616,5 @@ class DeoptInfo : public AllStatic {
|
|||
|
||||
} // namespace dart
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#endif // RUNTIME_VM_DEOPT_INSTRUCTIONS_H_
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
#include "vm/ffi_callback_trampolines.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/code_comments.h"
|
||||
#include "vm/code_observers.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/assembler/disassembler.h"
|
||||
#include "vm/exceptions.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
// 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_FFI_CALLBACK_TRAMPOLINES_H_
|
||||
#define RUNTIME_VM_FFI_CALLBACK_TRAMPOLINES_H_
|
||||
|
||||
#include "platform/allocation.h"
|
||||
#include "platform/growable_array.h"
|
||||
#include "vm/compiler/stub_code_compiler.h"
|
||||
#include "vm/flag_list.h"
|
||||
#include "vm/virtual_memory.h"
|
||||
|
||||
#ifndef RUNTIME_VM_FFI_CALLBACK_TRAMPOLINES_H_
|
||||
#define RUNTIME_VM_FFI_CALLBACK_TRAMPOLINES_H_
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/stub_code_compiler.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "vm/heap/sweeper.h"
|
||||
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/globals.h"
|
||||
#include "vm/heap/freelist.h"
|
||||
#include "vm/heap/heap.h"
|
||||
|
@ -52,8 +51,7 @@ bool GCSweeper::SweepPage(HeapPage* page, FreeList* freelist, bool locked) {
|
|||
uword cursor = current;
|
||||
uword end = current + obj_size;
|
||||
while (cursor < end) {
|
||||
*reinterpret_cast<uword*>(cursor) =
|
||||
compiler::Assembler::GetBreakInstructionFiller();
|
||||
*reinterpret_cast<uword*>(cursor) = kBreakInstructionFiller;
|
||||
cursor += kWordSize;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "platform/assert.h"
|
||||
#include "vm/class_id.h"
|
||||
#include "vm/compiler/backend/code_statistics.h"
|
||||
#include "vm/compiler/runtime_api.h"
|
||||
#include "vm/dwarf.h"
|
||||
#include "vm/elf.h"
|
||||
|
@ -22,6 +21,10 @@
|
|||
#include "vm/timeline.h"
|
||||
#include "vm/type_testing_stubs.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/backend/code_statistics.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
#if defined(DART_PRECOMPILER)
|
||||
|
@ -849,8 +852,7 @@ void AssemblyImageWriter::WriteText(WriteStream* clustered_stream, bool vm) {
|
|||
compiler::target::ObjectAlignment::kObjectAlignment) -
|
||||
unaligned_size;
|
||||
while (alignment_size > 0) {
|
||||
WriteWordLiteralText(
|
||||
compiler::Assembler::GetBreakInstructionFiller());
|
||||
WriteWordLiteralText(kBreakInstructionFiller);
|
||||
alignment_size -= sizeof(compiler::target::uword);
|
||||
text_offset += sizeof(compiler::target::uword);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "vm/interpreter.h"
|
||||
|
||||
#include "vm/compiler/api/type_check_mode.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/assembler/disassembler_kbc.h"
|
||||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "vm/class_table.h"
|
||||
#include "vm/constants_kbc.h"
|
||||
#include "vm/exceptions.h"
|
||||
#include "vm/ffi_callback_trampolines.h"
|
||||
#include "vm/field_table.h"
|
||||
#include "vm/fixed_cache.h"
|
||||
#include "vm/growable_array.h"
|
||||
|
@ -37,6 +36,10 @@
|
|||
#include "vm/token_position.h"
|
||||
#include "vm/virtual_memory.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/ffi_callback_trampolines.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
// Forward declarations.
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// 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.
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#include "vm/kernel.h"
|
||||
|
||||
#include "vm/bit_vector.h"
|
||||
|
@ -14,7 +16,6 @@
|
|||
#include "vm/parser.h" // For Parser::kParameter* constants.
|
||||
#include "vm/stack_frame.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
namespace kernel {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// 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.
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#include "vm/kernel_loader.h"
|
||||
|
||||
|
@ -23,7 +24,6 @@
|
|||
#include "vm/symbols.h"
|
||||
#include "vm/thread.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
namespace dart {
|
||||
namespace kernel {
|
||||
|
||||
|
|
|
@ -13,17 +13,10 @@
|
|||
#include "vm/bootstrap.h"
|
||||
#include "vm/class_finalizer.h"
|
||||
#include "vm/code_comments.h"
|
||||
#include "vm/code_descriptors.h"
|
||||
#include "vm/code_observers.h"
|
||||
#include "vm/compiler/aot/precompiler.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/assembler/disassembler.h"
|
||||
#include "vm/compiler/assembler/disassembler_kbc.h"
|
||||
#include "vm/compiler/compiler_state.h"
|
||||
#include "vm/compiler/frontend/bytecode_fingerprints.h"
|
||||
#include "vm/compiler/frontend/bytecode_reader.h"
|
||||
#include "vm/compiler/frontend/kernel_fingerprints.h"
|
||||
#include "vm/compiler/frontend/kernel_translation_helper.h"
|
||||
#include "vm/compiler/intrinsifier.h"
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
#include "vm/cpu.h"
|
||||
#include "vm/dart.h"
|
||||
|
@ -63,6 +56,18 @@
|
|||
#include "vm/type_testing_stubs.h"
|
||||
#include "vm/zone_text_buffer.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/aot/precompiler.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/code_statistics.h"
|
||||
#include "vm/compiler/compiler_state.h"
|
||||
#include "vm/compiler/frontend/bytecode_fingerprints.h"
|
||||
#include "vm/compiler/frontend/bytecode_reader.h"
|
||||
#include "vm/compiler/frontend/kernel_fingerprints.h"
|
||||
#include "vm/compiler/frontend/kernel_translation_helper.h"
|
||||
#include "vm/compiler/intrinsifier.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
DEFINE_FLAG(int,
|
||||
|
@ -2530,8 +2535,7 @@ void Object::InitializeObject(uword address, intptr_t class_id, intptr_t size) {
|
|||
uword cur = address + sizeof(RawObject);
|
||||
uword end = address + size;
|
||||
if (class_id == kInstructionsCid) {
|
||||
compiler::target::uword initial_value =
|
||||
compiler::Assembler::GetBreakInstructionFiller();
|
||||
compiler::target::uword initial_value = kBreakInstructionFiller;
|
||||
while (cur < end) {
|
||||
*reinterpret_cast<compiler::target::uword*>(cur) = initial_value;
|
||||
cur += compiler::target::kWordSize;
|
||||
|
@ -7469,6 +7473,7 @@ void Function::SetIsOptimizable(bool value) const {
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
bool Function::CanBeInlined() const {
|
||||
// Our force-optimized functions cannot deoptimize to an unoptimized frame.
|
||||
// If the instructions of the force-optimized function body get moved via
|
||||
|
@ -7479,14 +7484,17 @@ bool Function::CanBeInlined() const {
|
|||
if (ForceOptimize()) {
|
||||
return CompilerState::Current().is_aot();
|
||||
}
|
||||
#if defined(PRODUCT)
|
||||
return is_inlinable() && !is_external() && !is_generated_body();
|
||||
#else
|
||||
|
||||
#if !defined(PRODUCT)
|
||||
Thread* thread = Thread::Current();
|
||||
return is_inlinable() && !is_external() && !is_generated_body() &&
|
||||
!thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone());
|
||||
#endif
|
||||
if (thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone())) {
|
||||
return false;
|
||||
}
|
||||
#endif // !defined(PRODUCT)
|
||||
|
||||
return is_inlinable() && !is_external() && !is_generated_body();
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
intptr_t Function::NumParameters() const {
|
||||
return num_fixed_parameters() + NumOptionalParameters();
|
||||
|
|
|
@ -14,12 +14,15 @@
|
|||
#include "vm/dart_entry.h"
|
||||
#include "vm/regexp_assembler.h"
|
||||
#include "vm/regexp_assembler_bytecode.h"
|
||||
#include "vm/regexp_assembler_ir.h"
|
||||
#include "vm/regexp_ast.h"
|
||||
#include "vm/symbols.h"
|
||||
#include "vm/thread.h"
|
||||
#include "vm/unibrow-inl.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/regexp_assembler_ir.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#define Z (zone())
|
||||
|
||||
namespace dart {
|
||||
|
@ -701,7 +704,7 @@ void NegativeSubmatchSuccess::Emit(RegExpCompiler* compiler, Trace* trace) {
|
|||
|
||||
// Omit flushing the trace. We discard the entire stack frame anyway.
|
||||
|
||||
if (!label()->IsBound()) {
|
||||
if (!label()->is_bound()) {
|
||||
// We are completely independent of the trace, since we ignore it,
|
||||
// so this code can be used as the generic version.
|
||||
assembler->BindBlock(label());
|
||||
|
@ -728,7 +731,7 @@ void EndNode::Emit(RegExpCompiler* compiler, Trace* trace) {
|
|||
return;
|
||||
}
|
||||
RegExpMacroAssembler* assembler = compiler->macro_assembler();
|
||||
if (!label()->IsBound()) {
|
||||
if (!label()->is_bound()) {
|
||||
assembler->BindBlock(label());
|
||||
}
|
||||
switch (action_) {
|
||||
|
@ -1126,7 +1129,7 @@ static void CutOutRange(RegExpMacroAssembler* masm,
|
|||
EmitDoubleBoundaryTest(masm, ranges->At(cut_index),
|
||||
ranges->At(cut_index + 1) - 1, &dummy, in_range_label,
|
||||
&dummy);
|
||||
ASSERT(!dummy.IsLinked());
|
||||
ASSERT(!dummy.is_linked());
|
||||
// Cut out the single range by rewriting the array. This creates a new
|
||||
// range that is a merger of the two ranges on either side of the one we
|
||||
// are cutting out. The oddity of the labels is preserved.
|
||||
|
@ -1314,7 +1317,7 @@ static void GenerateBranches(RegExpMacroAssembler* masm,
|
|||
GenerateBranches(masm, ranges, start_index, new_end_index, min_char,
|
||||
border - 1, &dummy, even_label, odd_label);
|
||||
|
||||
if (handle_rest.IsLinked()) {
|
||||
if (handle_rest.is_linked()) {
|
||||
masm->BindBlock(&handle_rest);
|
||||
bool flip = (new_start_index & 1) != (start_index & 1);
|
||||
GenerateBranches(masm, ranges, new_start_index, end_index, border, max_char,
|
||||
|
@ -1432,7 +1435,7 @@ RegExpNode::LimitResult RegExpNode::LimitVersions(RegExpCompiler* compiler,
|
|||
|
||||
RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
|
||||
if (trace->is_trivial()) {
|
||||
if (label_.IsBound()) {
|
||||
if (label_.is_bound()) {
|
||||
// We are being asked to generate a generic version, but that's already
|
||||
// been done so just go to it.
|
||||
macro_assembler->GoTo(&label_);
|
||||
|
@ -3352,7 +3355,7 @@ void ChoiceNode::EmitOutOfLineContinuation(RegExpCompiler* compiler,
|
|||
AlternativeGeneration* alt_gen,
|
||||
intptr_t preload_characters,
|
||||
bool next_expects_preload) {
|
||||
if (!alt_gen->possible_success.IsLinked()) return;
|
||||
if (!alt_gen->possible_success.is_linked()) return;
|
||||
|
||||
RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
|
||||
macro_assembler->BindBlock(&alt_gen->possible_success);
|
||||
|
@ -3621,7 +3624,7 @@ void DotPrinter::PrintAttributes(RegExpNode* that) {
|
|||
printer.PrintBit("WI", info->follows_word_interest);
|
||||
printer.PrintBit("SI", info->follows_start_interest);
|
||||
BlockLabel* label = that->label();
|
||||
if (label->IsBound()) printer.PrintPositive("@", label->Position());
|
||||
if (label->is_bound()) printer.PrintPositive("@", label->pos());
|
||||
OS::PrintErr(
|
||||
"}\"];\n"
|
||||
" a%p -> n%p [style=dashed, color=grey, arrowhead=none];\n",
|
||||
|
|
|
@ -7,9 +7,6 @@
|
|||
|
||||
#include "platform/unicode.h"
|
||||
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
#include "vm/compiler/backend/il.h"
|
||||
#include "vm/object.h"
|
||||
#include "vm/regexp_assembler.h"
|
||||
#include "vm/splay-tree.h"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "vm/flags.h"
|
||||
#include "vm/regexp.h"
|
||||
#include "vm/runtime_entry.h"
|
||||
#include "vm/unibrow-inl.h"
|
||||
|
||||
namespace dart {
|
||||
|
@ -96,8 +97,7 @@ DEFINE_RAW_LEAF_RUNTIME_ENTRY(
|
|||
false /* is_float */,
|
||||
reinterpret_cast<RuntimeFunction>(&CaseInsensitiveCompareUTF16));
|
||||
|
||||
BlockLabel::BlockLabel()
|
||||
: block_(NULL), is_bound_(false), is_linked_(false), pos_(-1) {
|
||||
BlockLabel::BlockLabel() {
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
if (!FLAG_interpret_irregexp) {
|
||||
// Only needed by the compiled IR backend.
|
||||
|
|
|
@ -5,9 +5,12 @@
|
|||
#ifndef RUNTIME_VM_REGEXP_ASSEMBLER_H_
|
||||
#define RUNTIME_VM_REGEXP_ASSEMBLER_H_
|
||||
|
||||
#include "vm/object.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/il.h"
|
||||
#include "vm/object.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
|
@ -32,60 +35,59 @@ class BlockLabel : public ValueObject {
|
|||
// Used by the IR assembler.
|
||||
public:
|
||||
BlockLabel();
|
||||
|
||||
JoinEntryInstr* block() const { return block_; }
|
||||
|
||||
bool IsBound() const { return is_bound_; }
|
||||
void SetBound(intptr_t block_id) {
|
||||
ASSERT(!is_bound_);
|
||||
block_->set_block_id(block_id);
|
||||
is_bound_ = true;
|
||||
}
|
||||
|
||||
bool IsLinked() const { return !is_bound_ && is_linked_; }
|
||||
void SetLinked() { is_linked_ = true; }
|
||||
|
||||
intptr_t Position() const {
|
||||
ASSERT(IsBound());
|
||||
return block_->block_id();
|
||||
}
|
||||
|
||||
private:
|
||||
JoinEntryInstr* block_;
|
||||
|
||||
bool is_bound_;
|
||||
bool is_linked_;
|
||||
|
||||
// Used by the bytecode assembler.
|
||||
public:
|
||||
~BlockLabel() { ASSERT(!is_linked()); }
|
||||
|
||||
intptr_t pos() const { return pos_; }
|
||||
bool is_bound() const { return IsBound(); }
|
||||
bool is_linked() const { return IsLinked(); }
|
||||
bool is_bound() const { return is_bound_; }
|
||||
bool is_linked() const { return !is_bound_ && is_linked_; }
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
JoinEntryInstr* block() const { return block_; }
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
void Unuse() {
|
||||
pos_ = 0;
|
||||
pos_ = -1;
|
||||
is_bound_ = false;
|
||||
is_linked_ = false;
|
||||
}
|
||||
|
||||
void bind_to(intptr_t pos) {
|
||||
void BindTo(intptr_t pos) {
|
||||
pos_ = pos;
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
if (block_ != nullptr) block_->set_block_id(pos);
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
is_bound_ = true;
|
||||
is_linked_ = false;
|
||||
ASSERT(is_bound());
|
||||
}
|
||||
|
||||
void link_to(intptr_t pos) {
|
||||
// Used by bytecode assembler to form a linked list out of
|
||||
// forward jumps to an unbound label.
|
||||
void LinkTo(intptr_t pos) {
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
ASSERT(block_ == nullptr);
|
||||
#endif
|
||||
ASSERT(!is_bound_);
|
||||
pos_ = pos;
|
||||
is_bound_ = false;
|
||||
is_linked_ = true;
|
||||
ASSERT(is_linked());
|
||||
}
|
||||
|
||||
// Used by IR builder to mark block label as used.
|
||||
void SetLinked() {
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
ASSERT(block_ != nullptr);
|
||||
#endif
|
||||
if (!is_bound_) {
|
||||
is_linked_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
intptr_t pos_;
|
||||
bool is_bound_ = false;
|
||||
bool is_linked_ = false;
|
||||
intptr_t pos_ = -1;
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
JoinEntryInstr* block_ = nullptr;
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
};
|
||||
|
||||
class RegExpMacroAssembler : public ZoneAllocated {
|
||||
|
|
|
@ -44,7 +44,7 @@ void BytecodeRegExpMacroAssembler::BindBlock(BlockLabel* l) {
|
|||
*reinterpret_cast<uint32_t*>(buffer_->data() + fixup) = pc_;
|
||||
}
|
||||
}
|
||||
l->bind_to(pc_);
|
||||
l->BindTo(pc_);
|
||||
}
|
||||
|
||||
void BytecodeRegExpMacroAssembler::EmitOrLink(BlockLabel* l) {
|
||||
|
@ -56,7 +56,7 @@ void BytecodeRegExpMacroAssembler::EmitOrLink(BlockLabel* l) {
|
|||
if (l->is_linked()) {
|
||||
pos = l->pos();
|
||||
}
|
||||
l->link_to(pc_);
|
||||
l->LinkTo(pc_);
|
||||
Emit32(pos);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -682,10 +682,10 @@ void IRRegExpMacroAssembler::Backtrack() {
|
|||
// If the BlockLabel does not yet contain a block, it is created.
|
||||
// If there is a current instruction, append a goto to the bound block.
|
||||
void IRRegExpMacroAssembler::BindBlock(BlockLabel* label) {
|
||||
ASSERT(!label->IsBound());
|
||||
ASSERT(!label->is_bound());
|
||||
ASSERT(label->block()->next() == NULL);
|
||||
|
||||
label->SetBound(block_id_.Alloc());
|
||||
label->BindTo(block_id_.Alloc());
|
||||
blocks_.Add(label->block());
|
||||
|
||||
if (current_instruction_ != NULL) {
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
#include "vm/runtime_entry.h"
|
||||
|
||||
#include "vm/code_descriptors.h"
|
||||
#include "vm/code_patcher.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/frontend/bytecode_reader.h"
|
||||
#include "vm/compiler/api/deopt_id.h"
|
||||
#include "vm/compiler/api/type_check_mode.h"
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
#include "vm/dart_api_impl.h"
|
||||
#include "vm/dart_entry.h"
|
||||
#include "vm/debugger.h"
|
||||
#include "vm/deopt_instructions.h"
|
||||
#include "vm/exceptions.h"
|
||||
#include "vm/flags.h"
|
||||
#include "vm/heap/verifier.h"
|
||||
|
@ -30,6 +30,10 @@
|
|||
#include "vm/thread_registry.h"
|
||||
#include "vm/type_testing_stubs.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/deopt_instructions.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
DEFINE_FLAG(
|
||||
|
@ -342,14 +346,12 @@ DEFINE_LEAF_RUNTIME_ENTRY(RawObject*,
|
|||
const intptr_t length =
|
||||
Array::LengthOf(reinterpret_cast<RawArray*>(object));
|
||||
add_to_remembered_set =
|
||||
CreateArrayInstr::WillAllocateNewOrRemembered(length);
|
||||
compiler::target::WillAllocateNewOrRememberedArray(length);
|
||||
} else if (object->IsContext()) {
|
||||
const intptr_t num_context_variables =
|
||||
Context::NumVariables(reinterpret_cast<RawContext*>(object));
|
||||
add_to_remembered_set =
|
||||
AllocateContextInstr::WillAllocateNewOrRemembered(
|
||||
num_context_variables) ||
|
||||
AllocateUninitializedContextInstr::WillAllocateNewOrRemembered(
|
||||
compiler::target::WillAllocateNewOrRememberedContext(
|
||||
num_context_variables);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#endif
|
||||
#include "vm/flags.h"
|
||||
#include "vm/heap/safepoint.h"
|
||||
#include "vm/log.h"
|
||||
#include "vm/native_arguments.h"
|
||||
#include "vm/runtime_entry_list.h"
|
||||
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
|
||||
#include "vm/runtime_entry.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/stub_code.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
// Copyright (c) 2012, 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.
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#include "vm/scopes.h"
|
||||
|
||||
#include "vm/compiler/backend/slot.h"
|
||||
#include "vm/object.h"
|
||||
#include "vm/stack_frame.h"
|
||||
#include "vm/symbols.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "platform/assert.h"
|
||||
#include "platform/globals.h"
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/compiler/backend/slot.h"
|
||||
#include "vm/growable_array.h"
|
||||
#include "vm/object.h"
|
||||
#include "vm/raw_object.h"
|
||||
|
@ -21,6 +20,7 @@ namespace dart {
|
|||
|
||||
class CompileType;
|
||||
class LocalScope;
|
||||
class Slot;
|
||||
|
||||
// Indices of [LocalVariable]s are abstract and have little todo with the
|
||||
// actual frame layout!
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
#include "vm/stack_frame.h"
|
||||
|
||||
#include "platform/memory_sanitizer.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/code_descriptors.h"
|
||||
#include "vm/compiler/runtime_api.h"
|
||||
#include "vm/deopt_instructions.h"
|
||||
#include "vm/heap/become.h"
|
||||
#include "vm/isolate.h"
|
||||
#include "vm/object.h"
|
||||
|
@ -21,6 +20,10 @@
|
|||
#include "vm/stub_code.h"
|
||||
#include "vm/visitor.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/deopt_instructions.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
|
@ -847,6 +850,7 @@ void InlinedFunctionsIterator::Advance() {
|
|||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
}
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
// Finds the potential offset for the current function's FP if the
|
||||
// current frame were to be deoptimized.
|
||||
intptr_t InlinedFunctionsIterator::GetDeoptFpOffset() const {
|
||||
|
@ -860,6 +864,7 @@ intptr_t InlinedFunctionsIterator::GetDeoptFpOffset() const {
|
|||
UNREACHABLE();
|
||||
return 0;
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#if defined(DEBUG)
|
||||
void ValidateFrames() {
|
||||
|
|
|
@ -431,7 +431,9 @@ class InlinedFunctionsIterator : public ValueObject {
|
|||
return code_.raw();
|
||||
}
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
intptr_t GetDeoptFpOffset() const;
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
private:
|
||||
void SetDone() { index_ = -1; }
|
||||
|
|
|
@ -4,11 +4,14 @@
|
|||
|
||||
#include "vm/stack_trace.h"
|
||||
|
||||
#include "vm/compiler/frontend/bytecode_reader.h"
|
||||
#include "vm/dart_api_impl.h"
|
||||
#include "vm/stack_frame.h"
|
||||
#include "vm/symbols.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/frontend/bytecode_reader.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
// Keep in sync with
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "platform/assert.h"
|
||||
#include "platform/globals.h"
|
||||
#include "vm/clustered_snapshot.h"
|
||||
#include "vm/compiler/aot/precompiler.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/assembler/disassembler.h"
|
||||
#include "vm/flags.h"
|
||||
#include "vm/heap/safepoint.h"
|
||||
|
@ -18,6 +16,11 @@
|
|||
#include "vm/virtual_memory.h"
|
||||
#include "vm/visitor.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/aot/precompiler.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
DEFINE_FLAG(bool, disassemble_stubs, false, "Disassemble generated stubs.");
|
||||
|
|
|
@ -6,12 +6,15 @@
|
|||
#define RUNTIME_VM_STUB_CODE_H_
|
||||
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/runtime_api.h"
|
||||
#include "vm/compiler/stub_code_compiler.h"
|
||||
#include "vm/object.h"
|
||||
#include "vm/stub_code_list.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/stub_code_compiler.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
// Forward declarations.
|
||||
|
@ -66,12 +69,14 @@ class StubCode : public AllStatic {
|
|||
compiler::ObjectPoolBuilder* pool);
|
||||
#endif
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
// Generate the stub and finalize the generated code into the stub
|
||||
// code executable area.
|
||||
static RawCode* Generate(
|
||||
const char* name,
|
||||
compiler::ObjectPoolBuilder* object_pool_builder,
|
||||
void (*GenerateStub)(compiler::Assembler* assembler));
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
static const Code& UnoptimizedStaticCallEntry(intptr_t num_args_tested);
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "vm/thread.h"
|
||||
|
||||
#include "vm/dart_api_state.h"
|
||||
#include "vm/ffi_callback_trampolines.h"
|
||||
#include "vm/growable_array.h"
|
||||
#include "vm/heap/safepoint.h"
|
||||
#include "vm/isolate.h"
|
||||
|
@ -25,6 +24,10 @@
|
|||
#include "vm/timeline.h"
|
||||
#include "vm/zone.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/ffi_callback_trampolines.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
#if !defined(PRODUCT)
|
||||
|
|
|
@ -4,10 +4,14 @@
|
|||
|
||||
#include "vm/type_testing_stubs.h"
|
||||
#include "vm/compiler/assembler/disassembler.h"
|
||||
#include "vm/object_store.h"
|
||||
#include "vm/stub_code.h"
|
||||
#include "vm/timeline.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/backend/flow_graph_compiler.h"
|
||||
#include "vm/compiler/backend/il_printer.h"
|
||||
#include "vm/object_store.h"
|
||||
#include "vm/timeline.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#define __ assembler->
|
||||
|
||||
|
@ -580,6 +584,7 @@ void RegisterTypeArgumentsUse(const Function& function,
|
|||
|
||||
#else // !defined(TARGET_ARCH_IA32)
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
void RegisterTypeArgumentsUse(const Function& function,
|
||||
TypeUsageInfo* type_usage_info,
|
||||
const Class& klass,
|
||||
|
@ -587,6 +592,7 @@ void RegisterTypeArgumentsUse(const Function& function,
|
|||
// We only have a [TypeUsageInfo] object available durin AOT compilation.
|
||||
UNREACHABLE();
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#endif // !defined(TARGET_ARCH_IA32)
|
||||
|
||||
|
|
|
@ -5,8 +5,12 @@
|
|||
#ifndef RUNTIME_VM_TYPE_TESTING_STUBS_H_
|
||||
#define RUNTIME_VM_TYPE_TESTING_STUBS_H_
|
||||
|
||||
#include "vm/object.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/compiler/assembler/assembler.h"
|
||||
#include "vm/compiler/backend/il.h"
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
|
@ -369,10 +373,12 @@ class TypeUsageInfo : public ThreadStackResource {
|
|||
Class& klass_;
|
||||
};
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
void RegisterTypeArgumentsUse(const Function& function,
|
||||
TypeUsageInfo* type_usage_info,
|
||||
const Class& klass,
|
||||
Definition* type_arguments);
|
||||
#endif
|
||||
|
||||
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
|
|
Loading…
Reference in a new issue