Revert "[vm] Move the interpreter under a flag."
This reverts commit 715ab7b30b.
Reason for revert: simarm and kernel precomp builds failing
Original change's description:
> [vm] Move the interpreter under a flag.
>
> After this CL, the interpreter is included by default in the
> JIT VM under the flag --enable-interpreter.
>
> Change-Id: I06458f20288d67981822788ee6e867c2127ebdd3
> Reviewed-on: https://dart-review.googlesource.com/71800
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
TBR=rmacnak@google.com,alexmarkov@google.com,zra@google.com,asiva@google.com,regis@google.com
Change-Id: I3622f4dbe53288d07fc21b34ee5ff68f2682b36d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/74001
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
431fd74441
commit
21406f576a
@@ -124,6 +124,17 @@ config("dart_arch_config") {
|
||||
}
|
||||
}
|
||||
|
||||
config("dart_interpreter_config") {
|
||||
defines = [ "DART_USE_INTERPRETER" ]
|
||||
}
|
||||
|
||||
config("dart_maybe_interpreter_config") {
|
||||
defines = []
|
||||
if (dart_use_interpreter) {
|
||||
defines += [ "DART_USE_INTERPRETER" ]
|
||||
}
|
||||
}
|
||||
|
||||
config("dart_config") {
|
||||
defines = []
|
||||
|
||||
|
||||
@@ -247,6 +247,7 @@ template("build_libdart_builtin") {
|
||||
static_library(target_name) {
|
||||
configs += [
|
||||
"..:dart_arch_config",
|
||||
"..:dart_maybe_interpreter_config",
|
||||
"..:dart_config",
|
||||
] + extra_configs
|
||||
if (is_fuchsia) {
|
||||
@@ -407,6 +408,7 @@ template("build_gen_snapshot") {
|
||||
|
||||
build_gen_snapshot("gen_snapshot") {
|
||||
extra_configs = [
|
||||
"..:dart_maybe_interpreter_config",
|
||||
"..:dart_maybe_product_config",
|
||||
"..:dart_os_config",
|
||||
]
|
||||
@@ -419,6 +421,7 @@ build_gen_snapshot("gen_snapshot") {
|
||||
|
||||
build_gen_snapshot("gen_snapshot_product") {
|
||||
extra_configs = [
|
||||
"..:dart_maybe_interpreter_config",
|
||||
"..:dart_product_config",
|
||||
"..:dart_os_config",
|
||||
]
|
||||
@@ -431,6 +434,7 @@ build_gen_snapshot("gen_snapshot_product") {
|
||||
|
||||
build_gen_snapshot("gen_snapshot_fuchsia") {
|
||||
extra_configs = [
|
||||
"..:dart_maybe_interpreter_config",
|
||||
"..:dart_maybe_product_config",
|
||||
"..:dart_os_fuchsia_config",
|
||||
]
|
||||
@@ -443,6 +447,7 @@ build_gen_snapshot("gen_snapshot_fuchsia") {
|
||||
|
||||
build_gen_snapshot("gen_snapshot_product_fuchsia") {
|
||||
extra_configs = [
|
||||
"..:dart_maybe_interpreter_config",
|
||||
"..:dart_product_config",
|
||||
"..:dart_os_fuchsia_config",
|
||||
]
|
||||
@@ -453,6 +458,60 @@ build_gen_snapshot("gen_snapshot_product_fuchsia") {
|
||||
]
|
||||
}
|
||||
|
||||
if (!is_win) {
|
||||
build_gen_snapshot("gen_snapshot_interpreter") {
|
||||
extra_configs = [
|
||||
"..:dart_interpreter_config",
|
||||
"..:dart_maybe_product_config",
|
||||
"..:dart_os_config",
|
||||
]
|
||||
extra_deps = [
|
||||
":gen_snapshot_dart_io",
|
||||
":libdart_builtin",
|
||||
"..:libdart_nosnapshot_with_precompiler_interpreter",
|
||||
]
|
||||
}
|
||||
|
||||
build_gen_snapshot("gen_snapshot_product_interpreter") {
|
||||
extra_configs = [
|
||||
"..:dart_interpreter_config",
|
||||
"..:dart_product_config",
|
||||
"..:dart_os_config",
|
||||
]
|
||||
extra_deps = [
|
||||
":gen_snapshot_dart_io",
|
||||
":libdart_builtin",
|
||||
"..:libdart_nosnapshot_with_precompiler_interpreter",
|
||||
]
|
||||
}
|
||||
|
||||
build_gen_snapshot("gen_snapshot_interpreter_fuchsia") {
|
||||
extra_configs = [
|
||||
"..:dart_interpreter_config",
|
||||
"..:dart_maybe_product_config",
|
||||
"..:dart_os_fuchsia_config",
|
||||
]
|
||||
extra_deps = [
|
||||
":gen_snapshot_dart_io_fuchsia",
|
||||
":libdart_builtin_fuchsia",
|
||||
"..:libdart_nosnapshot_with_precompiler_interpreter_fuchsia",
|
||||
]
|
||||
}
|
||||
|
||||
build_gen_snapshot("gen_snapshot_product_interpreter_fuchsia") {
|
||||
extra_configs = [
|
||||
"..:dart_interpreter_config",
|
||||
"..:dart_product_config",
|
||||
"..:dart_os_fuchsia_config",
|
||||
]
|
||||
extra_deps = [
|
||||
":gen_snapshot_dart_io_product_fuchsia",
|
||||
":libdart_builtin_product_fuchsia",
|
||||
"..:libdart_nosnapshot_with_precompiler_product_interpreter_fuchsia",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
# A source set for the implementation of 'dart:io' library
|
||||
# (without secure sockets) suitable for linking with gen_snapshot.
|
||||
template("build_gen_snapshot_dart_io") {
|
||||
@@ -464,6 +523,7 @@ template("build_gen_snapshot_dart_io") {
|
||||
configs += [
|
||||
"..:dart_arch_config",
|
||||
"..:dart_config",
|
||||
"..:dart_maybe_interpreter_config",
|
||||
"..:dart_precompiler_config",
|
||||
] + extra_configs
|
||||
deps = []
|
||||
@@ -551,6 +611,7 @@ template("dart_io") {
|
||||
configs += [
|
||||
"..:dart_arch_config",
|
||||
"..:dart_config",
|
||||
"..:dart_maybe_interpreter_config",
|
||||
"..:dart_os_config",
|
||||
] + extra_configs
|
||||
if (is_fuchsia) {
|
||||
@@ -879,6 +940,7 @@ template("dart_executable") {
|
||||
"..:dart_arch_config",
|
||||
"..:dart_config",
|
||||
"..:dart_os_config",
|
||||
"..:dart_maybe_interpreter_config",
|
||||
"..:dart_maybe_product_config",
|
||||
] + extra_configs
|
||||
if (is_fuchsia) {
|
||||
@@ -1124,6 +1186,7 @@ executable("run_vm_tests") {
|
||||
"..:dart_arch_config",
|
||||
"..:dart_config",
|
||||
"..:dart_os_config",
|
||||
"..:dart_maybe_interpreter_config",
|
||||
"..:dart_maybe_product_config",
|
||||
]
|
||||
if (is_fuchsia) {
|
||||
|
||||
+76
-8
@@ -16,13 +16,33 @@ _base_fuchsia_config = [
|
||||
"$_dart_runtime:dart_os_fuchsia_config",
|
||||
]
|
||||
|
||||
_maybe_product = [ "$_dart_runtime:dart_maybe_product_config" ]
|
||||
_maybe_interpreter_maybe_product = [
|
||||
"$_dart_runtime:dart_maybe_interpreter_config",
|
||||
"$_dart_runtime:dart_maybe_product_config",
|
||||
]
|
||||
|
||||
_product = [ "$_dart_runtime:dart_product_config" ]
|
||||
_maybe_interpreter_product = [
|
||||
"$_dart_runtime:dart_maybe_interpreter_config",
|
||||
"$_dart_runtime:dart_product_config",
|
||||
]
|
||||
|
||||
_jit_config = _base_config + _maybe_product
|
||||
_interpreter_maybe_product = [
|
||||
"$_dart_runtime:dart_interpreter_config",
|
||||
"$_dart_runtime:dart_maybe_product_config",
|
||||
]
|
||||
|
||||
_jit_product_config = _base_config + _product
|
||||
_interpreter_product = [
|
||||
"$_dart_runtime:dart_interpreter_config",
|
||||
"$_dart_runtime:dart_product_config",
|
||||
]
|
||||
|
||||
_jit_config = _base_config + _maybe_interpreter_maybe_product
|
||||
|
||||
_jit_product_config = _base_config + _maybe_interpreter_product
|
||||
|
||||
_jit_interpreter_config = _base_config + _interpreter_maybe_product
|
||||
|
||||
_jit_product_interpreter_config = _base_config + _interpreter_product
|
||||
|
||||
_precompiled_runtime_config =
|
||||
_base_config + [
|
||||
@@ -52,16 +72,28 @@ _nosnapshot_precompiler_base = [
|
||||
]
|
||||
|
||||
_nosnapshot_with_precompiler_config =
|
||||
_base_config + _nosnapshot_precompiler_base + _maybe_product
|
||||
_base_config + _nosnapshot_precompiler_base + _maybe_interpreter_maybe_product
|
||||
|
||||
_nosnapshot_with_precompiler_interpreter_config =
|
||||
_base_config + _nosnapshot_precompiler_base + _interpreter_maybe_product
|
||||
|
||||
_nosnapshot_with_precompiler_product_interpreter_config =
|
||||
_base_config + _nosnapshot_precompiler_base + _interpreter_product
|
||||
|
||||
_nosnapshot_with_precompiler_product_config =
|
||||
_base_config + _nosnapshot_precompiler_base + _product
|
||||
_base_config + _nosnapshot_precompiler_base + _maybe_interpreter_product
|
||||
|
||||
_nosnapshot_with_precompiler_fuchsia_config =
|
||||
_base_fuchsia_config + _nosnapshot_precompiler_base + _maybe_product
|
||||
_base_fuchsia_config + _nosnapshot_precompiler_base + _maybe_interpreter_maybe_product
|
||||
|
||||
_nosnapshot_with_precompiler_product_fuchsia_config =
|
||||
_base_fuchsia_config + _nosnapshot_precompiler_base + _product
|
||||
_base_fuchsia_config + _nosnapshot_precompiler_base + _maybe_interpreter_product
|
||||
|
||||
_nosnapshot_with_precompiler_interpreter_fuchsia_config =
|
||||
_base_fuchsia_config + _nosnapshot_precompiler_base + _interpreter_maybe_product
|
||||
|
||||
_nosnapshot_with_precompiler_product_interpreter_fuchsia_config =
|
||||
_base_fuchsia_config + _nosnapshot_precompiler_base + _interpreter_product
|
||||
|
||||
_all_configs = [
|
||||
{
|
||||
@@ -116,6 +148,42 @@ _all_configs = [
|
||||
},
|
||||
]
|
||||
|
||||
# The interpreter is not currently needed on Windows.
|
||||
if (!is_win) {
|
||||
_all_configs += [
|
||||
{
|
||||
suffix = "_jit_interpreter"
|
||||
configs = _jit_interpreter_config
|
||||
snapshot = true
|
||||
},
|
||||
{
|
||||
suffix = "_jit_product_interpreter"
|
||||
configs = _jit_product_interpreter_config
|
||||
snapshot = true
|
||||
},
|
||||
{
|
||||
suffix = "_nosnapshot_with_precompiler_interpreter"
|
||||
configs = _nosnapshot_with_precompiler_interpreter_config
|
||||
snapshot = false
|
||||
},
|
||||
{
|
||||
suffix = "_nosnapshot_with_precompiler_product_interpreter"
|
||||
configs = _nosnapshot_with_precompiler_product_interpreter_config
|
||||
snapshot = false
|
||||
},
|
||||
{
|
||||
suffix = "_nosnapshot_with_precompiler_interpreter_fuchsia"
|
||||
configs = _nosnapshot_with_precompiler_interpreter_fuchsia_config
|
||||
snapshot = false
|
||||
},
|
||||
{
|
||||
suffix = "_nosnapshot_with_precompiler_product_interpreter_fuchsia"
|
||||
configs = _nosnapshot_with_precompiler_product_interpreter_fuchsia_config
|
||||
snapshot = false
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
# This template creates a target for each of the configurations listed above.
|
||||
# For example:
|
||||
#
|
||||
|
||||
@@ -78,8 +78,9 @@ declare_args() {
|
||||
dart_component_kind = "static_library"
|
||||
}
|
||||
|
||||
# Whether the VM's platform dill file contains bytecode.
|
||||
dart_platform_bytecode = false
|
||||
# Whether the runtime should interpret called functions for which bytecode
|
||||
# is provided by kernel, rather than compile them before execution.
|
||||
dart_use_interpreter = false
|
||||
|
||||
# Whether the VM includes the kernel service in all modes (debug, release,
|
||||
# product).
|
||||
@@ -90,7 +91,7 @@ declare_args() {
|
||||
# We create a kernel service app-jit snapshot only for when the target
|
||||
# architecture is x64 for other cases we will use the '.dill' file
|
||||
# which is already linked in the VM.
|
||||
if (dart_target_arch == "x64") {
|
||||
if (dart_target_arch == "x64" && !dart_use_interpreter) {
|
||||
create_kernel_service_snapshot = true
|
||||
} else {
|
||||
create_kernel_service_snapshot = false
|
||||
|
||||
+4
-5
@@ -328,14 +328,13 @@ compile_platform("vm_platform") {
|
||||
"$root_out_dir/vm_outline_strong.dill",
|
||||
]
|
||||
|
||||
args = [
|
||||
"--strong-mode",
|
||||
"dart:core",
|
||||
]
|
||||
args = [ "--strong-mode" ]
|
||||
|
||||
if (dart_platform_bytecode) {
|
||||
if (dart_use_interpreter) {
|
||||
args += [ "--bytecode" ]
|
||||
}
|
||||
|
||||
args += [ "dart:core" ]
|
||||
}
|
||||
|
||||
group("kernel_platform_files") {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
#include "vm/globals.h"
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
|
||||
#include "vm/compiler/assembler/disassembler_kbc.h"
|
||||
|
||||
@@ -370,4 +370,4 @@ void KernelBytecodeDisassembler::Disassemble(const Function& function) {
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define RUNTIME_VM_COMPILER_ASSEMBLER_DISASSEMBLER_KBC_H_
|
||||
|
||||
#include "vm/globals.h"
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
|
||||
#include "vm/compiler/assembler/disassembler.h"
|
||||
|
||||
@@ -84,6 +84,6 @@ class KernelBytecodeDisassembler : public AllStatic {
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
|
||||
#endif // RUNTIME_VM_COMPILER_ASSEMBLER_DISASSEMBLER_KBC_H_
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "vm/timeline.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
|
||||
#define Z (zone_)
|
||||
#define H (translation_helper_)
|
||||
@@ -681,4 +682,5 @@ RawNativeEntryData* BytecodeMetadataHelper::NativeEntry(
|
||||
} // namespace kernel
|
||||
} // namespace dart
|
||||
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "vm/object.h"
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
|
||||
namespace dart {
|
||||
namespace kernel {
|
||||
@@ -44,5 +45,6 @@ class BytecodeMetadataHelper : public MetadataHelper {
|
||||
} // namespace kernel
|
||||
} // namespace dart
|
||||
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#endif // RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_READER_H_
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
namespace dart {
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
|
||||
namespace kernel {
|
||||
|
||||
#define Z (zone_)
|
||||
@@ -1906,9 +1903,10 @@ FlowGraph* StreamingFlowGraphBuilder::BuildGraph() {
|
||||
|
||||
SetOffset(kernel_offset);
|
||||
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// TODO(regis): Clean up this logic of when to compile.
|
||||
// If the bytecode was previously loaded, we really want to compile.
|
||||
if (FLAG_enable_interpreter && !function.HasBytecode()) {
|
||||
if (!function.HasBytecode()) {
|
||||
// TODO(regis): For now, we skip bytecode loading for functions that were
|
||||
// synthesized and that do not have bytecode. Since they inherited the
|
||||
// kernel offset of a concrete function, the wrong bytecode would be loaded.
|
||||
@@ -1929,6 +1927,7 @@ FlowGraph* StreamingFlowGraphBuilder::BuildGraph() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Mark forwarding stubs.
|
||||
switch (function.kind()) {
|
||||
|
||||
@@ -39,7 +39,9 @@ class StreamingFlowGraphBuilder : public KernelReaderHelper {
|
||||
&type_translator_,
|
||||
active_class_,
|
||||
flow_graph_builder),
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
bytecode_metadata_helper_(this, &type_translator_, active_class_),
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
direct_call_metadata_helper_(this),
|
||||
inferred_type_metadata_helper_(this),
|
||||
procedure_attributes_metadata_helper_(this),
|
||||
@@ -417,7 +419,9 @@ class StreamingFlowGraphBuilder : public KernelReaderHelper {
|
||||
ActiveClass* const active_class_;
|
||||
TypeTranslator type_translator_;
|
||||
ConstantEvaluator constant_evaluator_;
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
BytecodeMetadataHelper bytecode_metadata_helper_;
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
DirectCallMetadataHelper direct_call_metadata_helper_;
|
||||
InferredTypeMetadataHelper inferred_type_metadata_helper_;
|
||||
ProcedureAttributesMetadataHelper procedure_attributes_metadata_helper_;
|
||||
|
||||
@@ -1042,7 +1042,6 @@ class KernelReaderHelper {
|
||||
// kernel program.
|
||||
intptr_t data_program_offset_;
|
||||
|
||||
friend class BytecodeMetadataHelper;
|
||||
friend class ClassHelper;
|
||||
friend class CallSiteAttributesMetadataHelper;
|
||||
friend class ConstantEvaluator;
|
||||
@@ -1065,6 +1064,10 @@ class KernelReaderHelper {
|
||||
friend class VariableDeclarationHelper;
|
||||
friend bool NeedsDynamicInvocationForwarder(const Function& function);
|
||||
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
friend class BytecodeMetadataHelper;
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(KernelReaderHelper);
|
||||
};
|
||||
|
||||
@@ -89,7 +89,6 @@ DEFINE_FLAG(bool,
|
||||
false,
|
||||
"Enable compiler verification assertions");
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
DECLARE_FLAG(bool, huge_method_cutoff_in_code_size);
|
||||
DECLARE_FLAG(bool, trace_failed_optimization_attempts);
|
||||
DECLARE_FLAG(bool, unbox_numeric_fields);
|
||||
@@ -163,8 +162,11 @@ FlowGraph* DartCompilationPipeline::BuildFlowGraph(
|
||||
/* not inlining */ NULL, optimized,
|
||||
osr_id);
|
||||
FlowGraph* graph = builder.BuildGraph();
|
||||
ASSERT((graph != NULL) || (FLAG_enable_interpreter &&
|
||||
parsed_function->function().HasBytecode()));
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
ASSERT((graph != NULL) || parsed_function->function().HasBytecode());
|
||||
#else
|
||||
ASSERT(graph != NULL);
|
||||
#endif
|
||||
return graph;
|
||||
}
|
||||
FlowGraphBuilder builder(*parsed_function, ic_data_array,
|
||||
@@ -258,13 +260,14 @@ DEFINE_RUNTIME_ENTRY(CompileFunction, 1) {
|
||||
}
|
||||
Exceptions::PropagateError(Error::Cast(result));
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// TODO(regis): Revisit.
|
||||
if (FLAG_enable_interpreter && !function.HasCode() &&
|
||||
function.HasBytecode()) {
|
||||
if (!function.HasCode() && function.HasBytecode()) {
|
||||
// Function was not actually compiled, but its bytecode was loaded.
|
||||
// Verify that InterpretCall stub code was installed.
|
||||
ASSERT(function.CurrentCode() == StubCode::InterpretCall_entry()->code());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Compiler::CanOptimizeFunction(Thread* thread, const Function& function) {
|
||||
@@ -829,11 +832,12 @@ RawCode* CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
|
||||
zone, parsed_function(), *ic_data_array, osr_id(), optimized());
|
||||
}
|
||||
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// TODO(regis): Revisit.
|
||||
if (FLAG_enable_interpreter && (flow_graph == NULL) &&
|
||||
function.HasBytecode()) {
|
||||
if (flow_graph == NULL && function.HasBytecode()) {
|
||||
return Code::null();
|
||||
}
|
||||
#endif
|
||||
|
||||
const bool print_flow_graph =
|
||||
(FLAG_print_flow_graph ||
|
||||
@@ -1018,10 +1022,12 @@ static RawObject* CompileFunctionHelper(CompilationPipeline* pipeline,
|
||||
|
||||
const Code& result = Code::Handle(helper.Compile(pipeline));
|
||||
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// TODO(regis): Revisit.
|
||||
if (FLAG_enable_interpreter && result.IsNull() && function.HasBytecode()) {
|
||||
if (result.IsNull() && function.HasBytecode()) {
|
||||
return Object::null();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!result.IsNull()) {
|
||||
if (!optimized) {
|
||||
@@ -1397,9 +1403,11 @@ RawError* Compiler::CompileAllFunctions(const Class& cls) {
|
||||
func ^= functions.At(i);
|
||||
ASSERT(!func.IsNull());
|
||||
if (!func.HasCode() &&
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// TODO(regis): Revisit.
|
||||
// Do not compile function if its bytecode is already loaded.
|
||||
(!FLAG_enable_interpreter || !func.HasBytecode()) &&
|
||||
!func.HasBytecode() &&
|
||||
#endif
|
||||
!func.is_abstract() && !func.IsRedirectingFactory()) {
|
||||
if ((cls.is_mixin_app_alias() || cls.IsMixinApplication()) &&
|
||||
func.HasOptionalParameters()) {
|
||||
@@ -1410,10 +1418,13 @@ RawError* Compiler::CompileAllFunctions(const Class& cls) {
|
||||
if (result.IsError()) {
|
||||
return Error::Cast(result).raw();
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// TODO(regis): Revisit.
|
||||
// The compiler may load bytecode and return Code::null().
|
||||
ASSERT(!result.IsNull() ||
|
||||
(FLAG_enable_interpreter && func.HasBytecode()));
|
||||
ASSERT(!result.IsNull() || func.HasBytecode());
|
||||
#else
|
||||
ASSERT(!result.IsNull());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return Error::null();
|
||||
@@ -1500,13 +1511,15 @@ RawObject* Compiler::EvaluateStaticInitializer(const Field& field) {
|
||||
CompileParsedFunctionHelper helper(parsed_function, false, kNoOSRDeoptId);
|
||||
const Code& code = Code::Handle(helper.Compile(&pipeline));
|
||||
const Function& initializer = parsed_function->function();
|
||||
|
||||
if (!code.IsNull()) {
|
||||
code.set_var_descriptors(Object::empty_var_descriptors());
|
||||
return DartEntry::InvokeFunction(initializer, Object::empty_array());
|
||||
} else if (FLAG_enable_interpreter && initializer.HasBytecode()) {
|
||||
// In case the initializer has bytecode, the compilation step above only
|
||||
// loaded the bytecode without generating code.
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
// In case the initializer has bytecode, the compilation step above only
|
||||
// loaded the bytecode without generating code.
|
||||
if (!code.IsNull() || initializer.HasBytecode()) {
|
||||
#endif
|
||||
// Invoke the function to evaluate the expression.
|
||||
return DartEntry::InvokeFunction(initializer, Object::empty_array());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-18
@@ -135,24 +135,6 @@ char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
|
||||
FLAG_verify_gc_contains = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (FLAG_enable_interpreter) {
|
||||
#if defined(USING_SIMULATOR) || defined(TARGET_ARCH_DBC)
|
||||
return strdup(
|
||||
"--enable-interpreter is not supported when targeting "
|
||||
"a sim* architecture.");
|
||||
#endif // defined(USING_SIMULATOR) || defined(TARGET_ARCH_DBC)
|
||||
|
||||
#if defined(TARGET_OS_WINDOWS)
|
||||
// TODO(34393): The interpreter currently relies on computed gotos, which
|
||||
// aren't supported on Windows.
|
||||
return strdup("--enable-interpreter is not supported on Windows.");
|
||||
#endif // defined(TARGET_OS_WINDOWS)
|
||||
|
||||
FLAG_use_field_guards = false;
|
||||
FLAG_optimization_counter_threshold = -1;
|
||||
}
|
||||
|
||||
FrameLayout::InitOnce();
|
||||
|
||||
set_thread_exit_callback(thread_exit);
|
||||
@@ -734,6 +716,10 @@ const char* Dart::FeaturesString(Isolate* isolate,
|
||||
buffer.AddString(" x64-sysv");
|
||||
#endif
|
||||
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
buffer.AddString(" kbc");
|
||||
#endif
|
||||
|
||||
#elif defined(TARGET_ARCH_DBC)
|
||||
#if defined(ARCH_IS_32_BIT)
|
||||
buffer.AddString(" dbc32");
|
||||
|
||||
+11
-15
@@ -19,8 +19,6 @@
|
||||
|
||||
namespace dart {
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
|
||||
// A cache of VM heap allocated arguments descriptors.
|
||||
RawArray* ArgumentsDescriptor::cached_args_descriptors_[kCachedDescriptorCount];
|
||||
|
||||
@@ -128,24 +126,17 @@ RawObject* DartEntry::InvokeFunction(const Function& function,
|
||||
Zone* zone = thread->zone();
|
||||
ASSERT(thread->IsMutatorThread());
|
||||
ScopedIsolateStackLimits stack_limit(thread, current_sp);
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
if (!function.HasCode()) {
|
||||
// There's no native code. If we're not using the interpreter, then we
|
||||
// compile to native code. If we are using the interpreter, but there's no
|
||||
// native code and no bytecode, then we invoke the compiler to extract the
|
||||
// bytecode.
|
||||
if (!FLAG_enable_interpreter || !function.HasBytecode()) {
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// The function is not compiled yet. Interpret it if it has bytecode.
|
||||
// The bytecode is loaded as part as an aborted compilation step.
|
||||
if (!function.HasBytecode()) {
|
||||
const Object& result =
|
||||
Object::Handle(zone, Compiler::CompileFunction(thread, function));
|
||||
if (result.IsError()) {
|
||||
return Error::Cast(result).raw();
|
||||
}
|
||||
}
|
||||
|
||||
// At this point we should have either native code or bytecode.
|
||||
ASSERT(function.HasCode() || function.HasBytecode());
|
||||
|
||||
// If we have bytecode but no native code then invoke the interpreter.
|
||||
if (!function.HasCode() && function.HasBytecode()) {
|
||||
ASSERT(thread->no_callback_scope_depth() == 0);
|
||||
SuspendLongJumpScope suspend_long_jump_scope(thread);
|
||||
@@ -153,9 +144,14 @@ RawObject* DartEntry::InvokeFunction(const Function& function,
|
||||
return Interpreter::Current()->Call(function, arguments_descriptor,
|
||||
arguments, thread);
|
||||
}
|
||||
#else
|
||||
const Object& result =
|
||||
Object::Handle(zone, Compiler::CompileFunction(thread, function));
|
||||
if (result.IsError()) {
|
||||
return Error::Cast(result).raw();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
// Now Call the invoke stub which will invoke the dart function.
|
||||
#if !defined(TARGET_ARCH_DBC)
|
||||
invokestub entrypoint = reinterpret_cast<invokestub>(
|
||||
|
||||
@@ -57,7 +57,6 @@ DEFINE_FLAG(bool,
|
||||
"handler instead. This handler dispatches breakpoints to "
|
||||
"the VM service.");
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
DECLARE_FLAG(bool, warn_on_pause_with_no_debugger);
|
||||
|
||||
#ifndef PRODUCT
|
||||
@@ -262,14 +261,14 @@ ActivationFrame::ActivationFrame(uword pc,
|
||||
var_descriptors_(LocalVarDescriptors::ZoneHandle()),
|
||||
desc_indices_(8),
|
||||
pc_desc_(PcDescriptors::ZoneHandle()) {
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
// TODO(regis): If debugging of interpreted code is required, recognize an
|
||||
// interpreted activation frame and respect alternate frame layout.
|
||||
// For now, punt.
|
||||
if (FLAG_enable_interpreter && function_.Bytecode() == code_.raw()) {
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
if (function_.Bytecode() == code_.raw()) {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#endif
|
||||
}
|
||||
|
||||
ActivationFrame::ActivationFrame(Kind kind)
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
namespace dart {
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
DECLARE_FLAG(bool, trace_deoptimization);
|
||||
DEFINE_FLAG(bool,
|
||||
print_stacktrace_at_throw,
|
||||
@@ -464,20 +463,15 @@ void Exceptions::JumpToFrame(Thread* thread,
|
||||
Simulator::Current()->JumpToFrame(program_counter, stack_pointer,
|
||||
frame_pointer, thread);
|
||||
#else
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
Interpreter* interpreter = thread->isolate()->interpreter();
|
||||
if ((interpreter != NULL) && interpreter->HasFrame(frame_pointer)) {
|
||||
interpreter->JumpToFrame(program_counter, stack_pointer, frame_pointer,
|
||||
thread);
|
||||
}
|
||||
// TODO(regis): We still possibly need to unwind interpreter frames if they
|
||||
// are callee frames of the C++ frame handling the exception.
|
||||
if (FLAG_enable_interpreter) {
|
||||
Interpreter* interpreter = thread->isolate()->interpreter();
|
||||
ASSERT(interpreter != NULL);
|
||||
if (interpreter->HasFrame(frame_pointer)) {
|
||||
interpreter->JumpToFrame(program_counter, stack_pointer, frame_pointer,
|
||||
thread);
|
||||
}
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#endif
|
||||
// Prepare for unwinding frames by destroying all the stack resources
|
||||
// in the previous frames.
|
||||
StackResource::Unwind(thread);
|
||||
|
||||
+10
-4
@@ -12,6 +12,13 @@
|
||||
#define USING_DBC false
|
||||
#endif
|
||||
|
||||
// Don't use USING_KBC outside of this file.
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
#define USING_KBC true
|
||||
#else
|
||||
#define USING_KBC false
|
||||
#endif
|
||||
|
||||
// Don't use USING_MULTICORE outside of this file.
|
||||
#if defined(ARCH_IS_MULTI_CORE)
|
||||
#define USING_MULTICORE true
|
||||
@@ -125,7 +132,7 @@ constexpr bool kDartPrecompiledRuntime = false;
|
||||
"Max size of new gen semi space in MB") \
|
||||
P(new_gen_semi_initial_size, int, (kWordSize <= 4) ? 1 : 2, \
|
||||
"Initial size of new gen semi space in MB") \
|
||||
P(optimization_counter_threshold, int, 30000, \
|
||||
P(optimization_counter_threshold, int, USING_KBC ? -1 : 30000, \
|
||||
"Function's usage-counter value before it is optimized, -1 means never") \
|
||||
P(old_gen_heap_size, int, kDefaultMaxOldGenHeapSize, \
|
||||
"Max size of old gen heap size in MB, or 0 for unlimited," \
|
||||
@@ -188,7 +195,7 @@ constexpr bool kDartPrecompiledRuntime = false;
|
||||
P(use_compactor, bool, false, "Compact the heap during old-space GC.") \
|
||||
P(use_cha_deopt, bool, true, \
|
||||
"Use class hierarchy analysis even if it can cause deoptimization.") \
|
||||
P(use_field_guards, bool, !USING_DBC, \
|
||||
P(use_field_guards, bool, !USING_DBC && !USING_KBC, \
|
||||
"Use field guards and track field types") \
|
||||
C(use_osr, false, true, bool, true, "Use OSR") \
|
||||
P(use_strong_mode_types, bool, true, "Optimize based on strong mode types.") \
|
||||
@@ -209,7 +216,6 @@ constexpr bool kDartPrecompiledRuntime = false;
|
||||
R(enable_testing_pragmas, false, bool, false, \
|
||||
"Enable magical pragmas for testing purposes. Use at your own risk!") \
|
||||
R(eliminate_type_checks, true, bool, true, \
|
||||
"Eliminate type checks when allowed by static type analysis.") \
|
||||
P(enable_interpreter, bool, false, "Enable interpreting kernel bytecode.")
|
||||
"Eliminate type checks when allowed by static type analysis.")
|
||||
|
||||
#endif // RUNTIME_VM_FLAG_LIST_H_
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "vm/globals.h"
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(TARGET_OS_WINDOWS)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
|
||||
#include "vm/interpreter.h"
|
||||
|
||||
@@ -4852,4 +4852,4 @@ void Interpreter::VisitObjectPointers(ObjectPointerVisitor* visitor) {
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME) && !defined(TARGET_OS_WINDOWS)
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define RUNTIME_VM_INTERPRETER_H_
|
||||
|
||||
#include "vm/globals.h"
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
|
||||
#include "vm/compiler/method_recognizer.h"
|
||||
#include "vm/constants_kbc.h"
|
||||
@@ -221,6 +221,6 @@ class Interpreter {
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
|
||||
#endif // RUNTIME_VM_INTERPRETER_H_
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
// Copyright (c) 2018, 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_OS_WINDOWS)
|
||||
|
||||
#include "vm/interpreter.h"
|
||||
|
||||
#include "platform/assert.h"
|
||||
#include "vm/object.h"
|
||||
|
||||
namespace dart {
|
||||
|
||||
IntrinsicHandler Interpreter::intrinsics_[Interpreter::kIntrinsicCount];
|
||||
|
||||
void Interpreter::InitOnce() {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
Interpreter::Interpreter() {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
Interpreter::~Interpreter() {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
Interpreter* Interpreter::Current() {
|
||||
UNIMPLEMENTED();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
bool Interpreter::IsTracingExecution() const {
|
||||
UNIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
void Interpreter::TraceInstruction(uint32_t* pc) const {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
#endif // defined(DEBUG)
|
||||
|
||||
void Interpreter::Exit(Thread* thread,
|
||||
RawObject** base,
|
||||
RawObject** frame,
|
||||
uint32_t* pc) {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
void Interpreter::CallRuntime(Thread* thread,
|
||||
RawObject** base,
|
||||
RawObject** exit_frame,
|
||||
uint32_t* pc,
|
||||
intptr_t argc_tag,
|
||||
RawObject** args,
|
||||
RawObject** result,
|
||||
uword target) {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
bool Interpreter::InvokeCompiled(Thread* thread,
|
||||
RawFunction* function,
|
||||
RawObject** call_base,
|
||||
RawObject** call_top,
|
||||
uint32_t** pc,
|
||||
RawObject*** FP,
|
||||
RawObject*** SP) {
|
||||
UNIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Interpreter::ProcessInvocation(bool* invoked,
|
||||
Thread* thread,
|
||||
RawFunction* function,
|
||||
RawObject** call_base,
|
||||
RawObject** call_top,
|
||||
uint32_t** pc,
|
||||
RawObject*** FP,
|
||||
RawObject*** SP) {
|
||||
UNIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Interpreter::Invoke(Thread* thread,
|
||||
RawObject** call_base,
|
||||
RawObject** call_top,
|
||||
uint32_t** pc,
|
||||
RawObject*** FP,
|
||||
RawObject*** SP) {
|
||||
UNIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
void Interpreter::InlineCacheMiss(int checked_args,
|
||||
Thread* thread,
|
||||
RawICData* icdata,
|
||||
RawObject** args,
|
||||
RawObject** top,
|
||||
uint32_t* pc,
|
||||
RawObject** FP,
|
||||
RawObject** SP) {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
bool Interpreter::InstanceCall1(Thread* thread,
|
||||
RawICData* icdata,
|
||||
RawObject** call_base,
|
||||
RawObject** top,
|
||||
uint32_t** pc,
|
||||
RawObject*** FP,
|
||||
RawObject*** SP,
|
||||
bool optimized) {
|
||||
UNIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Interpreter::InstanceCall2(Thread* thread,
|
||||
RawICData* icdata,
|
||||
RawObject** call_base,
|
||||
RawObject** top,
|
||||
uint32_t** pc,
|
||||
RawObject*** FP,
|
||||
RawObject*** SP,
|
||||
bool optimized) {
|
||||
UNIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
void Interpreter::PrepareForTailCall(RawCode* code,
|
||||
RawImmutableArray* args_desc,
|
||||
RawObject** FP,
|
||||
RawObject*** SP,
|
||||
uint32_t** pc) {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
bool Interpreter::Deoptimize(Thread* thread,
|
||||
uint32_t** pc,
|
||||
RawObject*** FP,
|
||||
RawObject*** SP,
|
||||
bool is_lazy) {
|
||||
UNIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Interpreter::AssertAssignable(Thread* thread,
|
||||
uint32_t* pc,
|
||||
RawObject** FP,
|
||||
RawObject** call_top,
|
||||
RawObject** args,
|
||||
RawSubtypeTestCache* cache) {
|
||||
UNIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
RawObject* Interpreter::Call(const Function& function,
|
||||
const Array& arguments_descriptor,
|
||||
const Array& arguments,
|
||||
Thread* thread) {
|
||||
UNIMPLEMENTED();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RawObject* Interpreter::Call(RawFunction* function,
|
||||
RawArray* argdesc,
|
||||
intptr_t argc,
|
||||
RawObject* const* argv,
|
||||
Thread* thread) {
|
||||
UNIMPLEMENTED();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Interpreter::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
void Interpreter::VisitObjectPointers(ObjectPointerVisitor* visitor) {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // defined(TARGET_OS_WINDOWS)
|
||||
@@ -911,9 +911,7 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
|
||||
library_tag_handler_(NULL),
|
||||
api_state_(NULL),
|
||||
random_(),
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
interpreter_(NULL),
|
||||
#endif
|
||||
simulator_(NULL),
|
||||
mutex_(new Mutex(NOT_IN_PRODUCT("Isolate::mutex_"))),
|
||||
symbols_mutex_(new Mutex(NOT_IN_PRODUCT("Isolate::symbols_mutex_"))),
|
||||
@@ -990,7 +988,7 @@ Isolate::~Isolate() {
|
||||
delete heap_;
|
||||
delete object_store_;
|
||||
delete api_state_;
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
delete interpreter_;
|
||||
#endif
|
||||
#if defined(USING_SIMULATOR)
|
||||
@@ -1982,11 +1980,11 @@ void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
if (interpreter() != NULL) {
|
||||
interpreter()->VisitObjectPointers(visitor);
|
||||
}
|
||||
#endif
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
|
||||
#if defined(TARGET_ARCH_DBC)
|
||||
if (simulator() != NULL) {
|
||||
|
||||
@@ -39,9 +39,7 @@ class HandleScope;
|
||||
class HandleVisitor;
|
||||
class Heap;
|
||||
class ICData;
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
class Interpreter;
|
||||
#endif
|
||||
class IsolateProfilerData;
|
||||
class IsolateReloadContext;
|
||||
class IsolateSpawnState;
|
||||
@@ -411,10 +409,8 @@ class Isolate : public BaseIsolate {
|
||||
|
||||
Random* random() { return &random_; }
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
Interpreter* interpreter() const { return interpreter_; }
|
||||
void set_interpreter(Interpreter* value) { interpreter_ = value; }
|
||||
#endif
|
||||
|
||||
Simulator* simulator() const { return simulator_; }
|
||||
void set_simulator(Simulator* value) { simulator_ = value; }
|
||||
@@ -977,9 +973,7 @@ class Isolate : public BaseIsolate {
|
||||
Dart_LibraryTagHandler library_tag_handler_;
|
||||
ApiState* api_state_;
|
||||
Random random_;
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
Interpreter* interpreter_;
|
||||
#endif
|
||||
Simulator* simulator_;
|
||||
Mutex* mutex_; // Protects compiler stats.
|
||||
Mutex* symbols_mutex_; // Protects concurrent access to the symbol table.
|
||||
|
||||
@@ -97,7 +97,8 @@ class RunKernelTask : public ThreadPool::Task {
|
||||
api_flags.strong = true;
|
||||
api_flags.unsafe_trust_strong_mode_types = false;
|
||||
api_flags.sync_async = true;
|
||||
#if !defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC)
|
||||
#if !defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC) && \
|
||||
!defined(DART_USE_INTERPRETER)
|
||||
api_flags.use_field_guards = true;
|
||||
#endif
|
||||
#if !defined(DART_PRECOMPILER)
|
||||
|
||||
@@ -216,6 +216,7 @@ class NativeArguments {
|
||||
friend class NativeEntryData;
|
||||
friend class Simulator;
|
||||
|
||||
#if defined(TARGET_ARCH_DBC) || defined(DART_USE_INTERPRETER)
|
||||
// Allow simulator and interpreter to create NativeArguments in reverse order
|
||||
// on the stack.
|
||||
NativeArguments(Thread* thread,
|
||||
@@ -226,6 +227,7 @@ class NativeArguments {
|
||||
argc_tag_(ReverseArgOrderBit::update(true, argc_tag)),
|
||||
argv_(argv),
|
||||
retval_(retval) {}
|
||||
#endif
|
||||
|
||||
// Since this function is passed a RawObject directly, we need to be
|
||||
// exceedingly careful when we use it. If there are any other side
|
||||
|
||||
@@ -103,6 +103,7 @@ void NativeEntry::PropagateErrors(NativeArguments* arguments) {
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
#if defined(TARGET_ARCH_DBC) || defined(DART_USE_INTERPRETER)
|
||||
uword NativeEntry::BootstrapNativeCallWrapperEntry() {
|
||||
uword entry =
|
||||
reinterpret_cast<uword>(NativeEntry::BootstrapNativeCallWrapper);
|
||||
@@ -113,6 +114,7 @@ void NativeEntry::BootstrapNativeCallWrapper(Dart_NativeArguments args,
|
||||
Dart_NativeFunction func) {
|
||||
func(args);
|
||||
}
|
||||
#endif
|
||||
|
||||
uword NativeEntry::NoScopeNativeCallWrapperEntry() {
|
||||
uword entry = reinterpret_cast<uword>(NativeEntry::NoScopeNativeCallWrapper);
|
||||
|
||||
@@ -129,9 +129,11 @@ class NativeEntry : public AllStatic {
|
||||
uword pc);
|
||||
static const uint8_t* ResolveSymbol(uword pc);
|
||||
|
||||
#if defined(TARGET_ARCH_DBC) || defined(DART_USE_INTERPRETER)
|
||||
static uword BootstrapNativeCallWrapperEntry();
|
||||
static void BootstrapNativeCallWrapper(Dart_NativeArguments args,
|
||||
Dart_NativeFunction func);
|
||||
#endif
|
||||
|
||||
static uword NoScopeNativeCallWrapperEntry();
|
||||
static void NoScopeNativeCallWrapper(Dart_NativeArguments args,
|
||||
|
||||
+20
-27
@@ -5959,19 +5959,15 @@ void Function::AttachCode(const Code& value) const {
|
||||
bool Function::HasCode() const {
|
||||
NoSafepointScope no_safepoint;
|
||||
ASSERT(raw_ptr()->code_ != Code::null());
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
return raw_ptr()->code_ != StubCode::LazyCompile_entry()->code();
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
return raw_ptr()->code_ != StubCode::LazyCompile_entry()->code() &&
|
||||
raw_ptr()->code_ != StubCode::InterpretCall_entry()->code();
|
||||
#else
|
||||
if (FLAG_enable_interpreter) {
|
||||
return raw_ptr()->code_ != StubCode::LazyCompile_entry()->code() &&
|
||||
raw_ptr()->code_ != StubCode::InterpretCall_entry()->code();
|
||||
} else {
|
||||
return raw_ptr()->code_ != StubCode::LazyCompile_entry()->code();
|
||||
}
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
return raw_ptr()->code_ != StubCode::LazyCompile_entry()->code();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
void Function::AttachBytecode(const Code& value) const {
|
||||
DEBUG_ASSERT(IsMutatorOrAtSafepoint());
|
||||
// Finish setting up code before activating it.
|
||||
@@ -5989,22 +5985,19 @@ bool Function::HasBytecode() const {
|
||||
return raw_ptr()->bytecode_ != Code::null();
|
||||
}
|
||||
|
||||
bool Function::HasBytecode(RawFunction* function) {
|
||||
return function->ptr()->bytecode_ != Code::null();
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
bool Function::HasCode(RawFunction* function) {
|
||||
NoSafepointScope no_safepoint;
|
||||
ASSERT(function->ptr()->code_ != Code::null());
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
return function->ptr()->code_ != StubCode::LazyCompile_entry()->code();
|
||||
#else
|
||||
return function->ptr()->code_ != StubCode::LazyCompile_entry()->code() &&
|
||||
function->ptr()->code_ != StubCode::InterpretCall_entry()->code();
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
}
|
||||
|
||||
bool Function::HasBytecode(RawFunction* function) {
|
||||
return function->ptr()->bytecode_ != Code::null();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void Function::ClearCode() const {
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
UNREACHABLE();
|
||||
@@ -6012,9 +6005,9 @@ void Function::ClearCode() const {
|
||||
ASSERT(Thread::Current()->IsMutatorThread());
|
||||
|
||||
StorePointer(&raw_ptr()->unoptimized_code_, Code::null());
|
||||
if (FLAG_enable_interpreter) {
|
||||
StorePointer(&raw_ptr()->bytecode_, Code::null());
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
StorePointer(&raw_ptr()->bytecode_, Code::null());
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
|
||||
SetInstructions(Code::Handle(StubCode::LazyCompile_entry()->code()));
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
@@ -8517,8 +8510,7 @@ RawNativeEntryData* NativeEntryData::New() {
|
||||
}
|
||||
|
||||
const char* NativeEntryData::ToCString() const {
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
ASSERT(FLAG_enable_interpreter);
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
if (IsNull()) {
|
||||
return "NativeEntryData: null";
|
||||
}
|
||||
@@ -8538,7 +8530,7 @@ const char* NativeEntryData::ToCString() const {
|
||||
reinterpret_cast<uword>(native_function()));
|
||||
#else
|
||||
UNREACHABLE();
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
|
||||
RawField* Field::CloneFromOriginal() const {
|
||||
@@ -15828,7 +15820,9 @@ RawCode* Code::FinalizeCode(const Function& function,
|
||||
#endif // !PRODUCT
|
||||
return FinalizeCode("", compiler, assembler, optimized, stats);
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
RawCode* Code::FinalizeBytecode(const void* bytecode_data,
|
||||
intptr_t bytecode_size,
|
||||
const ObjectPool& object_pool,
|
||||
@@ -15886,8 +15880,7 @@ RawCode* Code::FinalizeBytecode(const void* bytecode_data,
|
||||
code.comments().comments_.Length());
|
||||
return code.raw();
|
||||
}
|
||||
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
|
||||
bool Code::SlowFindRawCodeVisitor::FindObject(RawObject* raw_obj) const {
|
||||
return RawCode::ContainsPC(raw_obj, pc_);
|
||||
|
||||
+4
-2
@@ -2364,8 +2364,8 @@ class Function : public Object {
|
||||
}
|
||||
void set_unoptimized_code(const Code& value) const;
|
||||
bool HasCode() const;
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
static bool HasCode(RawFunction* function);
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
static bool HasBytecode(RawFunction* function);
|
||||
#endif
|
||||
|
||||
@@ -2379,7 +2379,7 @@ class Function : public Object {
|
||||
return OFFSET_OF(RawFunction, unchecked_entry_point_);
|
||||
}
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
void AttachBytecode(const Code& bytecode) const;
|
||||
RawCode* Bytecode() const { return raw_ptr()->bytecode_; }
|
||||
bool HasBytecode() const;
|
||||
@@ -5263,10 +5263,12 @@ class Code : public Object {
|
||||
Assembler* assembler,
|
||||
bool optimized,
|
||||
CodeStatistics* stats = nullptr);
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
static RawCode* FinalizeBytecode(const void* bytecode_data,
|
||||
intptr_t bytecode_size,
|
||||
const ObjectPool& object_pool,
|
||||
CodeStatistics* stats = nullptr);
|
||||
#endif
|
||||
#endif
|
||||
static RawCode* LookupCode(uword pc);
|
||||
static RawCode* LookupCodeInVmIsolate(uword pc);
|
||||
|
||||
@@ -983,8 +983,10 @@ class RawFunction : public RawObject {
|
||||
RawObject** to_no_code() {
|
||||
return reinterpret_cast<RawObject**>(&ptr()->ic_data_array_);
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
RawCode* bytecode_;
|
||||
#endif
|
||||
RawCode* code_; // Currently active code. Accessed from generated code.
|
||||
NOT_IN_PRECOMPILED(RawCode* bytecode_);
|
||||
NOT_IN_PRECOMPILED(RawCode* unoptimized_code_); // Unoptimized code, keep it
|
||||
// after optimization.
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
@@ -1131,11 +1133,11 @@ class RawField : public RawObject {
|
||||
UNREACHABLE();
|
||||
return NULL;
|
||||
}
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
VISIT_TO(RawObject*, dependent_code_);
|
||||
#else
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
RawSubtypeTestCache* type_test_cache_; // For type test in implicit setter.
|
||||
VISIT_TO(RawObject*, type_test_cache_);
|
||||
#else
|
||||
VISIT_TO(RawObject*, dependent_code_);
|
||||
#endif
|
||||
TokenPosition token_pos_;
|
||||
TokenPosition end_token_pos_;
|
||||
|
||||
+38
-26
@@ -63,7 +63,6 @@ DEFINE_FLAG(bool, trace_patching, false, "Trace patching of code.");
|
||||
DEFINE_FLAG(bool, trace_runtime_calls, false, "Trace runtime calls");
|
||||
DEFINE_FLAG(bool, trace_type_checks, false, "Trace runtime type checks.");
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
DECLARE_FLAG(int, max_deoptimization_counter_threshold);
|
||||
DECLARE_FLAG(bool, enable_inlining_annotations);
|
||||
DECLARE_FLAG(bool, trace_compiler);
|
||||
@@ -392,9 +391,13 @@ DEFINE_RUNTIME_ENTRY(InstantiateTypeArguments, 3) {
|
||||
instantiator_type_arguments.IsInstantiated());
|
||||
ASSERT(function_type_arguments.IsNull() ||
|
||||
function_type_arguments.IsInstantiated());
|
||||
#if !defined(DART_USE_INTERPRETER)
|
||||
// Code inlined in the caller should have optimized the case where the
|
||||
// instantiator can be reused as type argument vector.
|
||||
// However, it is non-trivial for the bytecode generator to implement this
|
||||
// optimization, so we do not require it when the interpreter is used.
|
||||
ASSERT(!type_arguments.IsUninstantiatedIdentity());
|
||||
#endif
|
||||
if (isolate->type_checks()) {
|
||||
Error& bound_error = Error::Handle(zone);
|
||||
type_arguments = type_arguments.InstantiateAndCanonicalizeFrom(
|
||||
@@ -459,8 +462,11 @@ DEFINE_RUNTIME_ENTRY(SubtypeCheck, 5) {
|
||||
// Allocate a new SubtypeTestCache for use in interpreted implicit setters.
|
||||
// Return value: newly allocated SubtypeTestCache.
|
||||
DEFINE_RUNTIME_ENTRY(AllocateSubtypeTestCache, 0) {
|
||||
ASSERT(FLAG_enable_interpreter);
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
arguments.SetReturn(SubtypeTestCache::Handle(zone, SubtypeTestCache::New()));
|
||||
#else
|
||||
UNREACHABLE();
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
|
||||
// Allocate a new context large enough to hold the given number of variables.
|
||||
@@ -498,7 +504,7 @@ DEFINE_RUNTIME_ENTRY(CloneContext, 1) {
|
||||
// Arg1: method.
|
||||
// Return value: newly allocated Closure.
|
||||
DEFINE_RUNTIME_ENTRY(ExtractMethod, 2) {
|
||||
ASSERT(FLAG_enable_interpreter);
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
const Instance& receiver = Instance::CheckedHandle(zone, arguments.ArgAt(0));
|
||||
const Function& method = Function::CheckedHandle(zone, arguments.ArgAt(1));
|
||||
const TypeArguments& instantiator_type_arguments =
|
||||
@@ -513,6 +519,9 @@ DEFINE_RUNTIME_ENTRY(ExtractMethod, 2) {
|
||||
Closure::New(instantiator_type_arguments, Object::null_type_arguments(),
|
||||
Object::empty_type_arguments(), method, context));
|
||||
arguments.SetReturn(closure);
|
||||
#else
|
||||
UNREACHABLE();
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
|
||||
// Result of an invoke may be an unhandled exception, in which case we
|
||||
@@ -528,7 +537,7 @@ static void CheckResultError(const Object& result) {
|
||||
// Arg1: field name.
|
||||
// Return value: field value.
|
||||
DEFINE_RUNTIME_ENTRY(GetFieldForDispatch, 2) {
|
||||
ASSERT(FLAG_enable_interpreter);
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
const Instance& receiver = Instance::CheckedHandle(zone, arguments.ArgAt(0));
|
||||
const String& name = String::CheckedHandle(zone, arguments.ArgAt(1));
|
||||
const Class& receiver_class = Class::Handle(zone, receiver.clazz());
|
||||
@@ -547,13 +556,16 @@ DEFINE_RUNTIME_ENTRY(GetFieldForDispatch, 2) {
|
||||
Object::Handle(zone, DartEntry::InvokeFunction(getter, args));
|
||||
CheckResultError(result);
|
||||
arguments.SetReturn(result);
|
||||
#else
|
||||
UNREACHABLE();
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
|
||||
// Resolve 'call' function of receiver.
|
||||
// Arg0: receiver (not a closure).
|
||||
// Return value: 'call' function'.
|
||||
DEFINE_RUNTIME_ENTRY(ResolveCallFunction, 1) {
|
||||
ASSERT(FLAG_enable_interpreter);
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
const Instance& receiver = Instance::CheckedHandle(zone, arguments.ArgAt(0));
|
||||
ASSERT(!receiver.IsClosure()); // Interpreter tests for closure.
|
||||
Class& cls = Class::Handle(zone, receiver.clazz());
|
||||
@@ -566,6 +578,9 @@ DEFINE_RUNTIME_ENTRY(ResolveCallFunction, 1) {
|
||||
cls = cls.SuperClass();
|
||||
} while (!cls.IsNull());
|
||||
arguments.SetReturn(call_function);
|
||||
#else
|
||||
UNREACHABLE();
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
|
||||
// Helper routine for tracing a type check.
|
||||
@@ -903,14 +918,14 @@ DEFINE_RUNTIME_ENTRY(TypeCheck, 7) {
|
||||
|
||||
if (should_update_cache) {
|
||||
if (cache.IsNull()) {
|
||||
if (FLAG_enable_interpreter) {
|
||||
// TODO(regis): Remove this workaround once the interpreter can provide
|
||||
// a non-null cache for the type test in an implicit setter.
|
||||
if (mode == kTypeCheckFromInline) {
|
||||
arguments.SetReturn(src_instance);
|
||||
return;
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// TODO(regis): Remove this workaround once the interpreter can provide a
|
||||
// non-null cache for the type test in an implicit setter.
|
||||
if (mode == kTypeCheckFromInline) {
|
||||
arguments.SetReturn(src_instance);
|
||||
return;
|
||||
}
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
|
||||
#if !defined(TARGET_ARCH_DBC) && !defined(TARGET_ARCH_IA32)
|
||||
ASSERT(mode == kTypeCheckFromSlowStub);
|
||||
@@ -2075,16 +2090,14 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
|
||||
}
|
||||
|
||||
bool interpreter_stack_overflow = false;
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
if (FLAG_enable_interpreter) {
|
||||
// Do not allocate an interpreter, if none is allocated yet.
|
||||
Interpreter* interpreter = Isolate::Current()->interpreter();
|
||||
if (interpreter != NULL) {
|
||||
interpreter_stack_overflow =
|
||||
interpreter->get_sp() >= interpreter->stack_limit();
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// Do not allocate an interpreter, if none is allocated yet.
|
||||
Interpreter* interpreter = Isolate::Current()->interpreter();
|
||||
if (interpreter != NULL) {
|
||||
interpreter_stack_overflow =
|
||||
interpreter->get_sp() >= interpreter->stack_limit();
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#endif
|
||||
|
||||
// If an interrupt happens at the same time as a stack overflow, we
|
||||
// process the stack overflow now and leave the interrupt for next
|
||||
@@ -2718,10 +2731,7 @@ RawObject* RuntimeEntry::InterpretCall(RawFunction* function,
|
||||
intptr_t argc,
|
||||
RawObject** argv,
|
||||
Thread* thread) {
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
UNREACHABLE();
|
||||
#else
|
||||
ASSERT(FLAG_enable_interpreter);
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
Interpreter* interpreter = Interpreter::Current();
|
||||
#if defined(DEBUG)
|
||||
uword exit_fp = thread->top_exit_frame_info();
|
||||
@@ -2744,7 +2754,9 @@ RawObject* RuntimeEntry::InterpretCall(RawFunction* function,
|
||||
Exceptions::PropagateError(Error::Cast(result));
|
||||
}
|
||||
return result.raw();
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
#else
|
||||
UNREACHABLE();
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
+24
-17
@@ -21,8 +21,6 @@
|
||||
|
||||
namespace dart {
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
|
||||
const FrameLayout invalid_frame_layout = {
|
||||
/*.first_object_from_fp = */ -1,
|
||||
/*.last_fixed_object_from_fp = */ -1,
|
||||
@@ -430,9 +428,9 @@ void StackFrameIterator::SetupLastExitFrameData() {
|
||||
ASSERT(thread_ != NULL);
|
||||
uword exit_marker = thread_->top_exit_frame_info();
|
||||
frames_.fp_ = exit_marker;
|
||||
if (FLAG_enable_interpreter) {
|
||||
frames_.CheckIfInterpreted(exit_marker);
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
frames_.CheckIfInterpreted(exit_marker);
|
||||
#endif
|
||||
}
|
||||
|
||||
void StackFrameIterator::SetupNextExitFrameData() {
|
||||
@@ -444,9 +442,9 @@ void StackFrameIterator::SetupNextExitFrameData() {
|
||||
frames_.fp_ = exit_marker;
|
||||
frames_.sp_ = 0;
|
||||
frames_.pc_ = 0;
|
||||
if (FLAG_enable_interpreter) {
|
||||
frames_.CheckIfInterpreted(exit_marker);
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
frames_.CheckIfInterpreted(exit_marker);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Tell MemorySanitizer that generated code initializes part of the stack.
|
||||
@@ -486,9 +484,9 @@ StackFrameIterator::StackFrameIterator(uword last_fp,
|
||||
frames_.fp_ = last_fp;
|
||||
frames_.sp_ = 0;
|
||||
frames_.pc_ = 0;
|
||||
if (FLAG_enable_interpreter) {
|
||||
frames_.CheckIfInterpreted(last_fp);
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
frames_.CheckIfInterpreted(last_fp);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(TARGET_ARCH_DBC)
|
||||
@@ -509,9 +507,9 @@ StackFrameIterator::StackFrameIterator(uword fp,
|
||||
frames_.fp_ = fp;
|
||||
frames_.sp_ = sp;
|
||||
frames_.pc_ = pc;
|
||||
if (FLAG_enable_interpreter) {
|
||||
frames_.CheckIfInterpreted(fp);
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
frames_.CheckIfInterpreted(fp);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -577,17 +575,16 @@ StackFrame* StackFrameIterator::NextFrame() {
|
||||
return current_frame_;
|
||||
}
|
||||
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
void StackFrameIterator::FrameSetIterator::CheckIfInterpreted(
|
||||
uword exit_marker) {
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
// TODO(regis): We should rely on a new thread vm_tag to identify an
|
||||
// interpreter frame and not need the HasFrame() method.
|
||||
ASSERT(FLAG_enable_interpreter);
|
||||
Isolate* isolate = thread_->isolate();
|
||||
Interpreter* interpreter = isolate != NULL ? isolate->interpreter() : NULL;
|
||||
is_interpreted_ = (interpreter != NULL) && interpreter->HasFrame(exit_marker);
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
}
|
||||
#endif
|
||||
|
||||
StackFrame* StackFrameIterator::FrameSetIterator::NextFrame(bool validate) {
|
||||
StackFrame* frame;
|
||||
@@ -596,11 +593,15 @@ StackFrame* StackFrameIterator::FrameSetIterator::NextFrame(bool validate) {
|
||||
frame->sp_ = sp_;
|
||||
frame->fp_ = fp_;
|
||||
frame->pc_ = pc_;
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
frame->is_interpreted_ = is_interpreted_;
|
||||
#endif
|
||||
sp_ = frame->GetCallerSp();
|
||||
fp_ = frame->GetCallerFp();
|
||||
pc_ = frame->GetCallerPc();
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
ASSERT(is_interpreted_ == frame->is_interpreted_);
|
||||
#endif
|
||||
ASSERT(!validate || frame->IsValid());
|
||||
return frame;
|
||||
}
|
||||
@@ -609,11 +610,15 @@ ExitFrame* StackFrameIterator::NextExitFrame() {
|
||||
exit_.sp_ = frames_.sp_;
|
||||
exit_.fp_ = frames_.fp_;
|
||||
exit_.pc_ = frames_.pc_;
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
exit_.is_interpreted_ = frames_.is_interpreted_;
|
||||
#endif
|
||||
frames_.sp_ = exit_.GetCallerSp();
|
||||
frames_.fp_ = exit_.GetCallerFp();
|
||||
frames_.pc_ = exit_.GetCallerPc();
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
ASSERT(frames_.is_interpreted_ == exit_.is_interpreted_);
|
||||
#endif
|
||||
ASSERT(!validate_ || exit_.IsValid());
|
||||
return &exit_;
|
||||
}
|
||||
@@ -623,7 +628,9 @@ EntryFrame* StackFrameIterator::NextEntryFrame() {
|
||||
entry_.sp_ = frames_.sp_;
|
||||
entry_.fp_ = frames_.fp_;
|
||||
entry_.pc_ = frames_.pc_;
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
entry_.is_interpreted_ = frames_.is_interpreted_;
|
||||
#endif
|
||||
SetupNextExitFrameData(); // Setup data for next exit frame in chain.
|
||||
ASSERT(!validate_ || entry_.IsValid());
|
||||
return &entry_;
|
||||
|
||||
@@ -161,7 +161,11 @@ class StackFrame : public ValueObject {
|
||||
virtual bool IsStubFrame() const;
|
||||
virtual bool IsEntryFrame() const { return false; }
|
||||
virtual bool IsExitFrame() const { return false; }
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
virtual bool is_interpreted() const { return is_interpreted_; }
|
||||
#else
|
||||
virtual bool is_interpreted() const { return false; }
|
||||
#endif
|
||||
|
||||
RawFunction* LookupDartFunction() const;
|
||||
RawCode* LookupDartCode() const;
|
||||
@@ -175,8 +179,13 @@ class StackFrame : public ValueObject {
|
||||
|
||||
protected:
|
||||
explicit StackFrame(Thread* thread)
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
: fp_(0), sp_(0), pc_(0), thread_(thread), is_interpreted_(false) {
|
||||
}
|
||||
#else
|
||||
: fp_(0), sp_(0), pc_(0), thread_(thread) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Name of the frame, used for generic frame printing functionality.
|
||||
virtual const char* GetName() const {
|
||||
@@ -220,7 +229,9 @@ class StackFrame : public ValueObject {
|
||||
uword sp_;
|
||||
uword pc_;
|
||||
Thread* thread_;
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
bool is_interpreted_;
|
||||
#endif
|
||||
|
||||
// The iterators FrameSetIterator and StackFrameIterator set the private
|
||||
// fields fp_ and sp_ when they return the respective frame objects.
|
||||
@@ -338,6 +349,7 @@ class StackFrameIterator : public ValueObject {
|
||||
StackFrame* NextFrame(bool validate);
|
||||
|
||||
private:
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
explicit FrameSetIterator(Thread* thread)
|
||||
: fp_(0),
|
||||
sp_(0),
|
||||
@@ -347,13 +359,20 @@ class StackFrameIterator : public ValueObject {
|
||||
is_interpreted_(false) {}
|
||||
bool is_interpreted() const { return is_interpreted_; }
|
||||
void CheckIfInterpreted(uword exit_marker);
|
||||
#else
|
||||
explicit FrameSetIterator(Thread* thread)
|
||||
: fp_(0), sp_(0), pc_(0), stack_frame_(thread), thread_(thread) {}
|
||||
bool is_interpreted() const { return false; }
|
||||
#endif
|
||||
|
||||
uword fp_;
|
||||
uword sp_;
|
||||
uword pc_;
|
||||
StackFrame stack_frame_; // Singleton frame returned by NextFrame().
|
||||
Thread* thread_;
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
bool is_interpreted_;
|
||||
#endif
|
||||
|
||||
friend class StackFrameIterator;
|
||||
DISALLOW_COPY_AND_ASSIGN(FrameSetIterator);
|
||||
@@ -374,7 +393,9 @@ class StackFrameIterator : public ValueObject {
|
||||
void SetupLastExitFrameData();
|
||||
void SetupNextExitFrameData();
|
||||
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
void CheckInterpreterExitFrame(uword exit_marker);
|
||||
#endif
|
||||
|
||||
bool validate_; // Validate each frame as we traverse the frames.
|
||||
EntryFrame entry_; // Singleton entry frame returned by NextEntryFrame().
|
||||
|
||||
+13
-20
@@ -20,8 +20,6 @@ namespace dart {
|
||||
|
||||
DEFINE_FLAG(bool, disassemble_stubs, false, "Disassemble generated stubs.");
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
|
||||
StubEntry* StubCode::entries_[kNumStubEntries] = {
|
||||
#define STUB_CODE_DECLARE(name) NULL,
|
||||
VM_STUB_CODE_LIST(STUB_CODE_DECLARE)
|
||||
@@ -92,30 +90,25 @@ bool StubCode::HasBeenInitialized() {
|
||||
bool StubCode::InInvocationStub(uword pc, bool is_interpreted_frame) {
|
||||
#if !defined(TARGET_ARCH_DBC)
|
||||
ASSERT(HasBeenInitialized());
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
if (FLAG_enable_interpreter) {
|
||||
if (is_interpreted_frame) {
|
||||
// Recognize special marker set up by interpreter in entry frame.
|
||||
return (pc & 2) != 0;
|
||||
}
|
||||
{
|
||||
uword entry = StubCode::InvokeDartCodeFromBytecode_entry()->EntryPoint();
|
||||
uword size = StubCode::InvokeDartCodeFromBytecodeSize();
|
||||
if ((pc >= entry) && (pc < (entry + size))) {
|
||||
return true;
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
if (is_interpreted_frame) {
|
||||
// Recognize special marker set up by interpreter in entry frame.
|
||||
return (pc & 2) != 0;
|
||||
}
|
||||
{
|
||||
uword entry = StubCode::InvokeDartCodeFromBytecode_entry()->EntryPoint();
|
||||
uword size = StubCode::InvokeDartCodeFromBytecodeSize();
|
||||
if ((pc >= entry) && (pc < (entry + size))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#endif
|
||||
uword entry = StubCode::InvokeDartCode_entry()->EntryPoint();
|
||||
uword size = StubCode::InvokeDartCodeSize();
|
||||
return (pc >= entry) && (pc < (entry + size));
|
||||
#elif defined(DART_USE_INTERPRETER)
|
||||
#error "Simultaneous usage of DBC simulator and interpreter not yet supported."
|
||||
#else
|
||||
if (FLAG_enable_interpreter) {
|
||||
FATAL(
|
||||
"Simultaneous usage of DBC simulator "
|
||||
"and interpreter not yet supported.");
|
||||
}
|
||||
// On DBC we use a special marker PC to signify entry frame because there is
|
||||
// no such thing as invocation stub.
|
||||
return (pc & 2) != 0;
|
||||
|
||||
@@ -116,9 +116,7 @@ class SnapshotWriter;
|
||||
V(SlowTypeTest) \
|
||||
V(LazySpecializeTypeTest) \
|
||||
V(FrameAwaitingMaterialization) \
|
||||
V(AsynchronousGapMarker) \
|
||||
V(InvokeDartCodeFromBytecode) \
|
||||
V(InterpretCall)
|
||||
V(AsynchronousGapMarker)
|
||||
|
||||
#endif // !defined(TARGET_ARCH_DBC)
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ DEFINE_FLAG(bool,
|
||||
false,
|
||||
"Set to true for debugging & verifying the slow paths.");
|
||||
DECLARE_FLAG(bool, trace_optimized_ic_calls);
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
|
||||
// Input parameters:
|
||||
// LR : return address.
|
||||
@@ -1052,13 +1051,7 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
|
||||
// R2 : address of first argument.
|
||||
// R3 : current thread.
|
||||
void StubCode::GenerateInvokeDartCodeFromBytecodeStub(Assembler* assembler) {
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
__ Stop("Not using interpreter");
|
||||
#else
|
||||
if (!FLAG_enable_interpreter) {
|
||||
__ Stop("Not using interpreter");
|
||||
return;
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// Copy the C stack pointer (R31) into the stack pointer we'll actually use
|
||||
// to access the stack.
|
||||
__ SetupDartSP();
|
||||
@@ -1179,7 +1172,9 @@ void StubCode::GenerateInvokeDartCodeFromBytecodeStub(Assembler* assembler) {
|
||||
__ LeaveFrame();
|
||||
__ RestoreCSP();
|
||||
__ ret();
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
#else
|
||||
__ Stop("Not using interpreter");
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
|
||||
// Called for inline allocation of contexts.
|
||||
@@ -1994,13 +1989,7 @@ void StubCode::GenerateLazyCompileStub(Assembler* assembler) {
|
||||
// R4: Arguments descriptor.
|
||||
// R0: Function.
|
||||
void StubCode::GenerateInterpretCallStub(Assembler* assembler) {
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
__ Stop("Not using interpreter")
|
||||
#else
|
||||
if (!FLAG_enable_interpreter) {
|
||||
__ Stop("Not using interpreter");
|
||||
return;
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
|
||||
__ SetPrologueOffset();
|
||||
__ EnterStubFrame();
|
||||
@@ -2071,7 +2060,9 @@ void StubCode::GenerateInterpretCallStub(Assembler* assembler) {
|
||||
|
||||
__ LeaveStubFrame();
|
||||
__ ret();
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
#else
|
||||
__ Stop("Not using interpreter");
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
|
||||
// R5: Contains an ICData.
|
||||
|
||||
@@ -121,14 +121,6 @@ void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) {
|
||||
__ Trap();
|
||||
}
|
||||
|
||||
void StubCode::GenerateInterpretCallStub(Assembler* assembler) {
|
||||
__ Trap();
|
||||
}
|
||||
|
||||
void StubCode::GenerateInvokeDartCodeFromBytecodeStub(Assembler* assembler) {
|
||||
__ Trap();
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // defined TARGET_ARCH_DBC
|
||||
|
||||
@@ -33,7 +33,6 @@ DEFINE_FLAG(bool,
|
||||
false,
|
||||
"Set to true for debugging & verifying the slow paths.");
|
||||
DECLARE_FLAG(bool, trace_optimized_ic_calls);
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
|
||||
// Input parameters:
|
||||
// RSP : points to return address.
|
||||
@@ -976,13 +975,7 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
|
||||
// RDX : address of first argument.
|
||||
// RCX : current thread.
|
||||
void StubCode::GenerateInvokeDartCodeFromBytecodeStub(Assembler* assembler) {
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
__ Stop("Not using interpreter");
|
||||
#else
|
||||
if (!FLAG_enable_interpreter) {
|
||||
__ Stop("Not using interpreter");
|
||||
return;
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
// Save frame pointer coming in.
|
||||
__ EnterFrame(0);
|
||||
|
||||
@@ -1110,7 +1103,9 @@ void StubCode::GenerateInvokeDartCodeFromBytecodeStub(Assembler* assembler) {
|
||||
__ LeaveFrame();
|
||||
|
||||
__ ret();
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
#else
|
||||
__ Stop("Not using interpreter");
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
|
||||
// Called for inline allocation of contexts.
|
||||
@@ -1990,13 +1985,7 @@ void StubCode::GenerateLazyCompileStub(Assembler* assembler) {
|
||||
// R10: Arguments descriptor.
|
||||
// RAX: Function.
|
||||
void StubCode::GenerateInterpretCallStub(Assembler* assembler) {
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
__ Stop("Not using interpreter");
|
||||
#else
|
||||
if (!FLAG_enable_interpreter) {
|
||||
__ Stop("Not using interpreter");
|
||||
return;
|
||||
}
|
||||
#if defined(DART_USE_INTERPRETER)
|
||||
__ EnterStubFrame();
|
||||
|
||||
#if defined(DEBUG)
|
||||
@@ -2061,7 +2050,9 @@ void StubCode::GenerateInterpretCallStub(Assembler* assembler) {
|
||||
|
||||
__ LeaveStubFrame();
|
||||
__ ret();
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
#else
|
||||
__ Stop("Not using interpreter");
|
||||
#endif // defined(DART_USE_INTERPRETER)
|
||||
}
|
||||
|
||||
// RBX: Contains an ICData.
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
|
||||
namespace dart {
|
||||
|
||||
DECLARE_FLAG(bool, enable_interpreter);
|
||||
|
||||
VM_UNIT_TEST_CASE(Mutex) {
|
||||
// This unit test case needs a running isolate.
|
||||
TestCase::CreateTestIsolate();
|
||||
@@ -498,11 +496,11 @@ TEST_CASE(SafepointTestDart) {
|
||||
// to get their verification done and exit. Use a specific UserTag
|
||||
// to enable the helpers to verify that the main thread is
|
||||
// successfully interrupted in the pure Dart loop.
|
||||
#if defined(USING_SIMULATOR)
|
||||
#if defined(USING_SIMULATOR) || defined(DART_USE_INTERPRETER)
|
||||
const intptr_t kLoopCount = 12345678;
|
||||
#else
|
||||
const intptr_t kLoopCount = FLAG_enable_interpreter ? 12345678 : 1234567890;
|
||||
#endif // defined(USING_SIMULATOR)
|
||||
const intptr_t kLoopCount = 1234567890;
|
||||
#endif // defined(USING_SIMULATOR) || defined(DART_USE_INTERPRETER)
|
||||
char buffer[1024];
|
||||
Utils::SNPrint(buffer, sizeof(buffer),
|
||||
"import 'dart:developer';\n"
|
||||
|
||||
@@ -126,7 +126,6 @@ vm_sources = [
|
||||
"instructions_x64.h",
|
||||
"interpreter.cc",
|
||||
"interpreter.h",
|
||||
"interpreter_unsupported.cc",
|
||||
"isolate.cc",
|
||||
"isolate.h",
|
||||
"isolate_reload.cc",
|
||||
|
||||
+6
-5
@@ -32,7 +32,7 @@ def BuildOptions():
|
||||
'simarm64,arm64,simdbc,armsimdbc]',
|
||||
default=utils.GuessArchitecture())
|
||||
result.add_option("-b", "--bytecode",
|
||||
help='Build with the kernel bytecode interpreter. DEPRECATED.',
|
||||
help='Build with the kernel bytecode interpreter',
|
||||
default=False,
|
||||
action='store_true')
|
||||
result.add_option("-j",
|
||||
@@ -228,9 +228,9 @@ def EnsureGomaStarted(out_dir):
|
||||
|
||||
|
||||
# Returns a tuple (build_config, command to run, whether goma is used)
|
||||
def BuildOneConfig(options, targets, target_os, mode, arch):
|
||||
build_config = utils.GetBuildConf(mode, arch, target_os)
|
||||
out_dir = utils.GetBuildRoot(HOST_OS, mode, arch, target_os)
|
||||
def BuildOneConfig(options, targets, target_os, mode, arch, kbc):
|
||||
build_config = utils.GetBuildConf(mode, arch, target_os, kbc=kbc)
|
||||
out_dir = utils.GetBuildRoot(HOST_OS, mode, arch, target_os, kbc=kbc)
|
||||
using_goma = False
|
||||
# TODO(zra): Remove auto-run of gn, replace with prompt for user to run
|
||||
# gn.py manually.
|
||||
@@ -295,7 +295,8 @@ def Main():
|
||||
for target_os in options.os:
|
||||
for mode in options.mode:
|
||||
for arch in options.arch:
|
||||
configs.append(BuildOneConfig(options, targets, target_os, mode, arch))
|
||||
configs.append(BuildOneConfig(options, targets, target_os, mode, arch,
|
||||
options.bytecode))
|
||||
|
||||
# Build regular configs.
|
||||
goma_builds = []
|
||||
|
||||
+10
-10
@@ -64,8 +64,8 @@ def GetGNArgs(args):
|
||||
return args.split()
|
||||
|
||||
|
||||
def GetOutDir(mode, arch, target_os):
|
||||
return utils.GetBuildRoot(HOST_OS, mode, arch, target_os)
|
||||
def GetOutDir(mode, arch, target_os, kbc):
|
||||
return utils.GetBuildRoot(HOST_OS, mode, arch, target_os, kbc=kbc)
|
||||
|
||||
|
||||
def ToCommandLine(gn_args):
|
||||
@@ -174,6 +174,9 @@ def ToGnArgs(args, mode, arch, target_os):
|
||||
gn_args['target_cpu'] = TargetCpuForArch(arch, target_os)
|
||||
gn_args['dart_target_arch'] = DartTargetCpuForArch(arch)
|
||||
|
||||
if args.bytecode:
|
||||
gn_args['dart_use_interpreter'] = True
|
||||
|
||||
if arch != HostCpuForArch(arch):
|
||||
# Training an app-jit snapshot under a simulator is slow. Use script
|
||||
# snapshots instead.
|
||||
@@ -186,9 +189,6 @@ def ToGnArgs(args, mode, arch, target_os):
|
||||
if gn_args['target_os'] in ['linux', 'win']:
|
||||
gn_args['dart_use_fallback_root_certificates'] = True
|
||||
|
||||
if args.bytecode:
|
||||
gn_args['dart_platform_bytecode'] = True
|
||||
|
||||
gn_args['dart_zlib_path'] = "//runtime/bin/zlib"
|
||||
|
||||
# Use tcmalloc only when targeting Linux and when not using ASAN.
|
||||
@@ -345,6 +345,10 @@ def parse_args(args):
|
||||
metavar='[all,ia32,x64,simarm,arm,simarmv6,armv6,simarmv5te,armv5te,'
|
||||
'simarm64,arm64,simdbc,armsimdbc]',
|
||||
default='x64')
|
||||
common_group.add_argument('--bytecode', '-b',
|
||||
help='Configure with the kernel bytecode interpreter',
|
||||
default=False,
|
||||
action="store_true")
|
||||
common_group.add_argument('--mode', '-m',
|
||||
type=str,
|
||||
help='Build variants (comma-separated).',
|
||||
@@ -373,10 +377,6 @@ def parse_args(args):
|
||||
help='Disable ASAN',
|
||||
dest='asan',
|
||||
action='store_false')
|
||||
other_group.add_argument('--bytecode', '-b',
|
||||
help='Include bytecode in the VMs platform dill',
|
||||
default=False,
|
||||
action="store_true")
|
||||
other_group.add_argument('--clang',
|
||||
help='Use Clang',
|
||||
default=True,
|
||||
@@ -488,7 +488,7 @@ def Main(argv):
|
||||
for target_os in args.os:
|
||||
for mode in args.mode:
|
||||
for arch in args.arch:
|
||||
out_dir = GetOutDir(mode, arch, target_os)
|
||||
out_dir = GetOutDir(mode, arch, target_os, args.bytecode)
|
||||
# TODO(infra): Re-enable --check. Many targets fail to use
|
||||
# public_deps to re-expose header files to their dependents.
|
||||
# See dartbug.com/32364
|
||||
|
||||
@@ -419,9 +419,10 @@ class TestConfiguration {
|
||||
var os = '';
|
||||
if (system == System.android) os = "Android";
|
||||
|
||||
var kbc = useKernelBytecode ? 'KBC' : '';
|
||||
var arch = architecture.name.toUpperCase();
|
||||
var normal = '$modeName$os$arch';
|
||||
var cross = '$modeName${os}X$arch';
|
||||
var normal = '$modeName$os$arch$kbc';
|
||||
var cross = '$modeName${os}X$arch$kbc';
|
||||
var outDir = system.outputDirectory;
|
||||
var normalDir = new Directory(new Path('$outDir$normal').toNativePath());
|
||||
var crossDir = new Directory(new Path('$outDir$cross').toNativePath());
|
||||
|
||||
@@ -219,7 +219,11 @@ class StandaloneDartRuntimeConfiguration extends DartVmRuntimeConfiguration {
|
||||
|
||||
List<String> args = arguments;
|
||||
if (suite.configuration.compiler == Compiler.dartkb) {
|
||||
args.add('--enable_interpreter');
|
||||
args.removeWhere(
|
||||
(String arg) => arg.startsWith('--optimization-counter-threshold'));
|
||||
args.removeWhere(
|
||||
(String arg) => arg.startsWith('--optimization_counter_threshold'));
|
||||
args = <String>['--optimization-counter-threshold=-1']..addAll(args);
|
||||
}
|
||||
|
||||
String executable = suite.dartVmBinaryFileName;
|
||||
|
||||
+10
-5
@@ -293,27 +293,32 @@ def IsCrossBuild(target_os, arch):
|
||||
(target_os != GuessOS()))
|
||||
|
||||
|
||||
def GetBuildConf(mode, arch, conf_os=None):
|
||||
def GetBuildConf(mode, arch, conf_os=None, kbc=False):
|
||||
kbc_suffix = ''
|
||||
if kbc:
|
||||
kbc_suffix = 'KBC'
|
||||
if conf_os == 'android':
|
||||
return '%s%s%s' % (GetBuildMode(mode), conf_os.title(), arch.upper())
|
||||
return '%s%s%s%s' % (GetBuildMode(mode), conf_os.title(), arch.upper(),
|
||||
kbc_suffix)
|
||||
else:
|
||||
# Ask for a cross build if the host and target architectures don't match.
|
||||
host_arch = ARCH_GUESS
|
||||
cross_build = ''
|
||||
if GetArchFamily(host_arch) != GetArchFamily(arch):
|
||||
cross_build = 'X'
|
||||
return '%s%s%s' % (GetBuildMode(mode), cross_build, arch.upper())
|
||||
return '%s%s%s%s' % (GetBuildMode(mode), cross_build, arch.upper(),
|
||||
kbc_suffix)
|
||||
|
||||
|
||||
def GetBuildDir(host_os):
|
||||
return BUILD_ROOT[host_os]
|
||||
|
||||
|
||||
def GetBuildRoot(host_os, mode=None, arch=None, target_os=None):
|
||||
def GetBuildRoot(host_os, mode=None, arch=None, target_os=None, kbc=False):
|
||||
build_root = GetBuildDir(host_os)
|
||||
if mode:
|
||||
build_root = os.path.join(build_root,
|
||||
GetBuildConf(mode, arch, target_os))
|
||||
GetBuildConf(mode, arch, target_os, kbc))
|
||||
return build_root
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user