Revised "Eliminate dependencies on assemblers and code stubs in precompiled runtime."

Explicitly clear unbox_numeric_fields flag in PRODUCT builds. Fixes code bloat introduced by previous CL. New changes in Patch Set 2.

BUG= https://github.com/dart-lang/sdk/issues/30045
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/3006923002 .
This commit is contained in:
Aske Simon Christensen 2017-09-04 13:13:21 +02:00
parent aa1a9ef686
commit 8cb752f73b
70 changed files with 295 additions and 183 deletions

View file

@ -14,15 +14,15 @@ namespace dart {
// Scan the stack until we hit the first function in the _AssertionError
// class. We then return the next frame's script taking inlining into account.
static RawScript* FindScript(DartFrameIterator* iterator) {
if (FLAG_precompiled_runtime) {
// The precompiled runtime faces two issues in recovering the correct
// assertion text. First, the precompiled runtime does not include
// the inlining meta-data so we cannot walk the inline-aware stack trace.
// Second, the script text itself is missing so whatever script is returned
// from here will be missing the assertion expression text.
iterator->NextFrame(); // Skip _AssertionError._evaluateAssertion frame
return Exceptions::GetCallerScript(iterator);
}
#if defined(DART_PRECOMPILED_RUNTIME)
// The precompiled runtime faces two issues in recovering the correct
// assertion text. First, the precompiled runtime does not include
// the inlining meta-data so we cannot walk the inline-aware stack trace.
// Second, the script text itself is missing so whatever script is returned
// from here will be missing the assertion expression text.
iterator->NextFrame(); // Skip _AssertionError._evaluateAssertion frame
return Exceptions::GetCallerScript(iterator);
#else
StackFrame* stack_frame = iterator->NextFrame();
Code& code = Code::Handle();
Function& func = Function::Handle();
@ -56,6 +56,7 @@ static RawScript* FindScript(DartFrameIterator* iterator) {
}
UNREACHABLE();
return Script::null();
#endif // defined(DART_PRECOMPILED_RUNTIME)
}
// Allocate and throw a new AssertionError.

View file

@ -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/assembler.h"
#include "platform/utils.h"
@ -306,3 +308,5 @@ RawObjectPool* ObjectPoolWrapper::MakeObjectPool() {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // NOLINT
#if defined(TARGET_ARCH_ARM)
#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/assembler.h"
#include "vm/cpu.h"
@ -3435,4 +3435,4 @@ const char* Assembler::FpuRegisterName(FpuRegister reg) {
} // namespace dart
#endif // defined TARGET_ARCH_ARM
#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // NOLINT
#if defined(TARGET_ARCH_ARM64)
#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/assembler.h"
#include "vm/cpu.h"
@ -1489,4 +1489,4 @@ void Assembler::StoreUnaligned(Register src,
} // namespace dart
#endif // defined TARGET_ARCH_ARM64
#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // NOLINT
#if defined(TARGET_ARCH_IA32)
#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/assembler.h"
#include "vm/cpu.h"
@ -2709,4 +2709,4 @@ const char* Assembler::FpuRegisterName(FpuRegister reg) {
} // namespace dart
#endif // defined TARGET_ARCH_IA32
#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // NOLINT
#if defined(TARGET_ARCH_X64)
#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/assembler.h"
#include "vm/cpu.h"
@ -3466,4 +3466,4 @@ const char* Assembler::FpuRegisterName(FpuRegister reg) {
} // namespace dart
#endif // defined TARGET_ARCH_X64
#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/ast.h"
#include "vm/compiler.h"
#include "vm/dart_entry.h"
@ -744,3 +746,5 @@ const Instance* StaticGetterNode::EvalConstExpr() const {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -10,7 +10,7 @@
#include "vm/os.h"
#include "vm/parser.h"
#if !defined(PRODUCT)
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
namespace dart {
@ -511,4 +511,4 @@ void AstPrinter::PrintFunctionNodes(const ParsedFunction& parsed_function) {
} // namespace dart
#endif // !defined(PRODUCT)
#endif // !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/ast_transformer.h"
#include "vm/object_store.h"
@ -496,3 +498,5 @@ void AwaitTransformer::VisitThrowNode(ThrowNode* node) {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/block_scheduler.h"
#include "vm/allocation.h"
@ -209,3 +211,5 @@ void BlockScheduler::ReorderBlocks() const {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/branch_optimizer.h"
#include "vm/flow_graph.h"
@ -340,3 +342,5 @@ void IfConverter::Simplify(FlowGraph* flow_graph) {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/cha.h"
#include "vm/class_table.h"
#include "vm/flags.h"
@ -172,3 +174,5 @@ void CHA::RegisterDependencies(const Code& code) const {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -107,6 +107,48 @@ DEFINE_FLAG(bool,
DECLARE_FLAG(bool, huge_method_cutoff_in_code_size);
DECLARE_FLAG(bool, trace_failed_optimization_attempts);
DECLARE_FLAG(bool, unbox_numeric_fields);
static void PrecompilationModeHandler(bool value) {
if (value) {
#if defined(TARGET_ARCH_IA32)
FATAL("Precompilation not supported on IA32");
#endif
FLAG_background_compilation = false;
FLAG_enable_mirrors = false;
FLAG_fields_may_be_reset = true;
FLAG_interpret_irregexp = true;
FLAG_lazy_dispatchers = false;
FLAG_link_natives_lazily = true;
FLAG_optimization_counter_threshold = -1;
FLAG_polymorphic_with_deopt = false;
FLAG_precompiled_mode = true;
FLAG_reorder_basic_blocks = false;
FLAG_use_field_guards = false;
FLAG_use_cha_deopt = false;
#if !defined(DART_PRECOMPILED_RUNTIME)
// Not present with DART_PRECOMPILED_RUNTIME
FLAG_unbox_numeric_fields = false;
#endif
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
// Set flags affecting runtime accordingly for dart_bootstrap.
// These flags are constants with PRODUCT and DART_PRECOMPILED_RUNTIME.
FLAG_collect_code = false;
FLAG_deoptimize_alot = false; // Used in some tests.
FLAG_deoptimize_every = 0; // Used in some tests.
FLAG_load_deferred_eagerly = true;
FLAG_print_stop_message = false;
FLAG_use_osr = false;
#endif
}
}
DEFINE_FLAG_HANDLER(PrecompilationModeHandler,
precompilation,
"Precompilation mode");
#ifndef DART_PRECOMPILED_RUNTIME

View file

@ -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/constant_propagator.h"
#include "vm/bit_vector.h"
@ -1579,3 +1581,5 @@ void ConstantPropagator::Transform() {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -204,9 +204,6 @@ char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
if (vm_snapshot_kind_ == Snapshot::kFullAOT) {
#if defined(DART_PRECOMPILED_RUNTIME)
vm_isolate_->set_compilation_allowed(false);
if (!FLAG_precompiled_runtime) {
return strdup("Flag --precompilation was not specified");
}
#else
return strdup("JIT runtime cannot run a precompiled snapshot");
#endif

View file

@ -671,8 +671,10 @@ void ActivationFrame::PrintDescriptorsError(const char* message) {
OS::PrintErr("pc_ %" Px "\n", pc_);
OS::PrintErr("deopt_id_ %" Px "\n", deopt_id_);
OS::PrintErr("context_level_ %" Px "\n", context_level_);
#if !defined(DART_PRECOMPILED_RUNTIME)
DisassembleToStdout formatter;
code().Disassemble(&formatter);
#endif // !defined(DART_PRECOMPILED_RUNTIME)
PcDescriptors::Handle(code().pc_descriptors()).Print();
StackFrameIterator frames(StackFrameIterator::kDontValidateFrames,
Thread::Current(),
@ -1779,6 +1781,7 @@ ActivationFrame* Debugger::CollectDartFrame(Isolate* isolate,
return activation;
}
#if !defined(DART_PRECOMPILED_RUNTIME)
RawArray* Debugger::DeoptimizeToArray(Thread* thread,
StackFrame* frame,
const Code& code) {
@ -1800,6 +1803,7 @@ RawArray* Debugger::DeoptimizeToArray(Thread* thread,
return dest_frame.raw();
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
DebuggerStackTrace* Debugger::CollectStackTrace() {
Thread* thread = Thread::Current();
@ -1837,7 +1841,8 @@ void Debugger::AppendCodeFrames(Thread* thread,
Code* code,
Code* inlined_code,
Array* deopt_frame) {
if (code->is_optimized() && !FLAG_precompiled_runtime) {
#if !defined(DART_PRECOMPILED_RUNTIME)
if (code->is_optimized()) {
// TODO(rmacnak): Use CodeSourceMap
*deopt_frame = DeoptimizeToArray(thread, frame, *code);
for (InlinedFunctionsIterator it(*code, frame->pc()); !it.Done();
@ -1854,10 +1859,11 @@ void Debugger::AppendCodeFrames(Thread* thread,
*inlined_code, *deopt_frame,
deopt_frame_offset));
}
} else {
stack_trace->AddActivation(CollectDartFrame(
isolate, frame->pc(), frame, *code, Object::null_array(), 0));
return;
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
stack_trace->AddActivation(CollectDartFrame(isolate, frame->pc(), frame,
*code, Object::null_array(), 0));
}
DebuggerStackTrace* Debugger::CollectAsyncCausalStackTrace() {
@ -1946,11 +1952,14 @@ DebuggerStackTrace* Debugger::CollectAsyncCausalStackTrace() {
}
DebuggerStackTrace* Debugger::CollectAwaiterReturnStackTrace() {
#if defined(DART_PRECOMPILED_RUNTIME)
// Causal async stacks are not supported in the AOT runtime.
ASSERT(!FLAG_async_debugger);
return NULL;
#else
if (!FLAG_async_debugger) {
return NULL;
}
// Causal async stacks are not supported in the AOT runtime.
ASSERT(!FLAG_precompiled_runtime);
Thread* thread = Thread::Current();
Zone* zone = thread->zone();
@ -2089,6 +2098,7 @@ DebuggerStackTrace* Debugger::CollectAwaiterReturnStackTrace() {
}
return stack_trace;
#endif // defined(DART_PRECOMPILED_RUNTIME)
}
ActivationFrame* Debugger::TopDartFrame() const {

View file

@ -674,9 +674,11 @@ class Debugger {
const Array& deopt_frame,
intptr_t deopt_frame_offset,
ActivationFrame::Kind kind = ActivationFrame::kRegular);
#if !defined(DART_PRECOMPILED_RUNTIME)
static RawArray* DeoptimizeToArray(Thread* thread,
StackFrame* frame,
const Code& code);
#endif
// Appends at least one stack frame. Multiple frames will be appended
// if |code| at the frame's pc contains inlined functions.
static void AppendCodeFrames(Thread* thread,

View file

@ -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/deferred_objects.h"
#include "vm/code_patcher.h"
@ -316,3 +318,5 @@ void DeferredObject::Fill() {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/deopt_instructions.h"
#include "vm/assembler.h"
@ -1431,3 +1433,5 @@ bool DeoptInfo::VerifyDecompression(const GrowableArray<DeoptInstr*>& original,
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/disassembler.h"
#include "vm/assembler.h"
@ -306,3 +308,5 @@ void Disassembler::DisassembleCode(const Function& function,
#endif // !PRODUCT
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -99,7 +99,7 @@ class Disassembler : public AllStatic {
}
static void Disassemble(uword start, uword end, const Code& code) {
#ifndef PRODUCT
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
DisassembleToStdout stdout_formatter;
LogBlock lb;
Disassemble(start, end, &stdout_formatter, code);
@ -109,7 +109,7 @@ class Disassembler : public AllStatic {
}
static void Disassemble(uword start, uword end) {
#ifndef PRODUCT
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
DisassembleToStdout stdout_formatter;
LogBlock lb;
Disassemble(start, end, &stdout_formatter);

View file

@ -2,10 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/disassembler.h"
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
#if defined(TARGET_ARCH_ARM)
#include "platform/assert.h"
#include "vm/cpu.h"
#include "vm/instructions.h"
@ -1511,4 +1512,4 @@ void Disassembler::DecodeInstruction(char* hex_buffer,
} // namespace dart
#endif // defined TARGET_ARCH_ARM
#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -2,10 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/disassembler.h"
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
#if defined(TARGET_ARCH_ARM64)
#include "platform/assert.h"
#include "vm/instructions.h"
@ -1448,4 +1449,4 @@ void Disassembler::DecodeInstruction(char* hex_buffer,
} // namespace dart
#endif // defined TARGET_ARCH_ARM
#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -2,10 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/disassembler.h"
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
#if defined(TARGET_ARCH_IA32)
#include "platform/utils.h"
#include "vm/allocation.h"
#include "vm/heap.h"
@ -1904,4 +1905,4 @@ void Disassembler::DecodeInstruction(char* hex_buffer,
} // namespace dart
#endif // defined TARGET_ARCH_IA32
#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -2,10 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/disassembler.h"
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
#if defined(TARGET_ARCH_X64)
#include "platform/utils.h"
#include "vm/allocation.h"
#include "vm/heap.h"
@ -1941,4 +1942,4 @@ void Disassembler::DecodeInstruction(char* hex_buffer,
} // namespace dart
#endif // defined TARGET_ARCH_X64
#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -128,7 +128,6 @@
P(polymorphic_with_deopt, bool, true, \
"Polymorphic calls with deoptimization / megamorphic call") \
P(precompiled_mode, bool, false, "Precompilation compiler mode") \
C(precompiled_runtime, true, false, bool, false, "Precompiled runtime mode") \
P(print_snapshot_sizes, bool, false, "Print sizes of generated snapshots.") \
P(print_benchmarking_metrics, bool, false, \
"Print additional memory and latency metrics for benchmarking.") \

View file

@ -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/flow_graph.h"
#include "vm/bit_vector.h"
@ -2166,3 +2168,5 @@ void FlowGraph::AppendExtractNthOutputForMerged(Definition* instr,
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/flow_graph_allocator.h"
#include "vm/bit_vector.h"
@ -3025,3 +3027,5 @@ void FlowGraphAllocator::AllocateRegisters() {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/flow_graph_builder.h"
#include "lib/invocation_mirror.h"
@ -4419,3 +4421,5 @@ bool FlowGraphBuilder::SimpleInstanceOfType(const AbstractType& type) {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/globals.h" // Needed here to get TARGET_ARCH_XXX.
#include "vm/flow_graph_compiler.h"
@ -54,57 +56,16 @@ DEFINE_FLAG(bool,
DECLARE_FLAG(bool, code_comments);
DECLARE_FLAG(charp, deoptimize_filter);
DECLARE_FLAG(bool, intrinsify);
DECLARE_FLAG(bool, propagate_ic_data);
DECLARE_FLAG(int, regexp_optimization_counter_threshold);
DECLARE_FLAG(int, reoptimization_counter_threshold);
DECLARE_FLAG(int, stacktrace_every);
DECLARE_FLAG(charp, stacktrace_filter);
DECLARE_FLAG(bool, trace_compiler);
DECLARE_FLAG(int, reload_every);
DECLARE_FLAG(bool, unbox_numeric_fields);
static void PrecompilationModeHandler(bool value) {
if (value) {
#if defined(TARGET_ARCH_IA32)
FATAL("Precompilation not supported on IA32");
#endif
FLAG_background_compilation = false;
FLAG_fields_may_be_reset = true;
FLAG_interpret_irregexp = true;
FLAG_lazy_dispatchers = false;
FLAG_link_natives_lazily = true;
FLAG_optimization_counter_threshold = -1;
FLAG_polymorphic_with_deopt = false;
FLAG_precompiled_mode = true;
FLAG_reorder_basic_blocks = false;
FLAG_use_field_guards = false;
FLAG_use_cha_deopt = false;
FLAG_unbox_numeric_fields = false;
FLAG_enable_mirrors = false;
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
// Set flags affecting runtime accordingly for dart_bootstrap.
// These flags are constants with PRODUCT and DART_PRECOMPILED_RUNTIME.
FLAG_collect_code = false;
FLAG_deoptimize_alot = false; // Used in some tests.
FLAG_deoptimize_every = 0; // Used in some tests.
FLAG_load_deferred_eagerly = true;
FLAG_print_stop_message = false;
FLAG_use_osr = false;
#endif
}
}
DEFINE_FLAG_HANDLER(PrecompilationModeHandler,
precompilation,
"Precompilation mode");
#ifdef DART_PRECOMPILED_RUNTIME
COMPILE_ASSERT(!FLAG_collect_code);
COMPILE_ASSERT(!FLAG_deoptimize_alot); // Used in some tests.
COMPILE_ASSERT(FLAG_precompiled_runtime);
COMPILE_ASSERT(!FLAG_print_stop_message);
COMPILE_ASSERT(!FLAG_use_osr);
COMPILE_ASSERT(FLAG_deoptimize_every == 0); // Used in some tests.
@ -1964,3 +1925,5 @@ void FlowGraphCompiler::FrameStateClear() {
#endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC)
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
#if defined(TARGET_ARCH_ARM)
#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/flow_graph_compiler.h"
@ -1808,4 +1808,4 @@ void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
} // namespace dart
#endif // defined TARGET_ARCH_ARM
#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
#if defined(TARGET_ARCH_ARM64)
#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/flow_graph_compiler.h"
@ -1749,4 +1749,4 @@ void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
} // namespace dart
#endif // defined TARGET_ARCH_ARM64
#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
#if defined(TARGET_ARCH_IA32)
#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/flow_graph_compiler.h"
@ -1707,4 +1707,4 @@ void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
} // namespace dart
#endif // defined TARGET_ARCH_IA32
#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
#if defined(TARGET_ARCH_X64)
#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/flow_graph_compiler.h"
@ -1685,4 +1685,4 @@ void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
} // namespace dart
#endif // defined TARGET_ARCH_X64
#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -1,7 +1,9 @@
// Copyright (c) 2013, 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/flow_graph_inliner.h"
#include "vm/aot_optimizer.h"
@ -3735,4 +3737,5 @@ bool FlowGraphInliner::TryInlineRecognizedMethod(FlowGraph* flow_graph,
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/flow_graph_range_analysis.h"
#include "vm/bit_vector.h"
@ -2964,3 +2966,5 @@ bool CheckArrayBoundInstr::IsRedundant(const RangeBoundary& length) {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/flow_graph_type_propagator.h"
#include "vm/bit_vector.h"
@ -1520,3 +1522,5 @@ CompileType ExtractNthOutputInstr::ComputeType() const {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/il_printer.h"
#include "vm/flow_graph_range_analysis.h"
@ -1296,3 +1298,5 @@ bool FlowGraphPrinter::ShouldPrint(const Function& function) {
#endif // !PRODUCT
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/intermediate_language.h"
#include "vm/bit_vector.h"
@ -4027,3 +4029,5 @@ void NativeCallInstr::SetupNative() {
#undef __
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
#if defined(TARGET_ARCH_ARM)
#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/intermediate_language.h"
@ -6873,4 +6873,4 @@ void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
} // namespace dart
#endif // defined TARGET_ARCH_ARM
#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
#if defined(TARGET_ARCH_ARM64)
#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/intermediate_language.h"
@ -5685,4 +5685,4 @@ void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
} // namespace dart
#endif // defined TARGET_ARCH_ARM64
#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
#if defined(TARGET_ARCH_IA32)
#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/intermediate_language.h"
@ -6504,4 +6504,4 @@ void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
#undef __
#endif // defined TARGET_ARCH_IA32
#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
#if defined(TARGET_ARCH_X64)
#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/intermediate_language.h"
@ -6371,4 +6371,4 @@ void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
#undef __
#endif // defined TARGET_ARCH_X64
#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,10 @@
// BSD-style license that can be found in the LICENSE file.
// Class for intrinsifying functions.
#if !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/intrinsifier.h"
#include "vm/assembler.h"
#include "vm/compiler.h"
#include "vm/cpu.h"
@ -1138,3 +1141,5 @@ void Intrinsifier::RegExp_ExecuteMatchSticky(Assembler* assembler) {
#endif // !defined(TARGET_ARCH_DBC)
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
#if defined(TARGET_ARCH_ARM)
#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/intrinsifier.h"
@ -2224,4 +2224,4 @@ void Intrinsifier::SetAsyncThreadStackTrace(Assembler* assembler) {
} // namespace dart
#endif // defined TARGET_ARCH_ARM
#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
#if defined(TARGET_ARCH_ARM64)
#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/intrinsifier.h"
@ -2304,4 +2304,4 @@ void Intrinsifier::SetAsyncThreadStackTrace(Assembler* assembler) {
} // namespace dart
#endif // defined TARGET_ARCH_ARM64
#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -9,7 +9,7 @@
// Dart method was intrinsified.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
#if defined(TARGET_ARCH_IA32)
#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/intrinsifier.h"
@ -2245,4 +2245,4 @@ void Intrinsifier::SetAsyncThreadStackTrace(Assembler* assembler) {
} // namespace dart
#endif // defined TARGET_ARCH_IA32
#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
#if defined(TARGET_ARCH_X64)
#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/intrinsifier.h"
@ -2225,4 +2225,4 @@ void Intrinsifier::SetAsyncThreadStackTrace(Assembler* assembler) {
} // namespace dart
#endif // defined TARGET_ARCH_X64
#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/locations.h"
#include "vm/assembler.h"
@ -347,3 +349,5 @@ void LocationSummary::CheckWritableInputs() {
#endif
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -48,6 +48,7 @@ RawFunction* MegamorphicCacheTable::miss_handler(Isolate* isolate) {
return isolate->object_store()->megamorphic_miss_function();
}
#if !defined(DART_PRECOMPILED_RUNTIME)
void MegamorphicCacheTable::InitMissHandler(Isolate* isolate) {
// The miss handler for a class ID not found in the table is invoked as a
// normal Dart function.
@ -78,6 +79,7 @@ void MegamorphicCacheTable::InitMissHandler(Isolate* isolate) {
Function::null());
isolate->object_store()->SetMegamorphicMissHandler(code, function);
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
void MegamorphicCacheTable::PrintSizes(Isolate* isolate) {
StackZone zone(Thread::Current());

View file

@ -23,7 +23,7 @@ class String;
class MegamorphicCacheTable : public AllStatic {
public:
static RawFunction* miss_handler(Isolate* isolate);
static void InitMissHandler(Isolate* isolate);
NOT_IN_PRECOMPILED(static void InitMissHandler(Isolate* isolate));
static RawMegamorphicCache* Lookup(Isolate* isolate,
const String& name,

View file

@ -14000,7 +14000,7 @@ void Code::SetStubCallTargetCodeAt(uword pc, const Code& code) const {
}
void Code::Disassemble(DisassemblyFormatter* formatter) const {
#ifndef PRODUCT
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
if (!FLAG_support_disassembler) {
return;
}
@ -14089,6 +14089,7 @@ RawCode* Code::New(intptr_t pointer_offsets_length) {
return result.raw();
}
#if !defined(DART_PRECOMPILED_RUNTIME)
RawCode* Code::FinalizeCode(const char* name,
Assembler* assembler,
bool optimized) {
@ -14189,6 +14190,7 @@ RawCode* Code::FinalizeCode(const Function& function,
#endif // !PRODUCT
return FinalizeCode("", assembler, optimized);
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
bool Code::SlowFindRawCodeVisitor::FindObject(RawObject* raw_obj) const {
return RawCode::ContainsPC(raw_obj, pc_);

View file

@ -4753,12 +4753,14 @@ class Code : public Object {
ASSERT(0 <= len && len <= kMaxElements);
return RoundedAllocationSize(sizeof(RawCode) + (len * kBytesPerElement));
}
#if !defined(DART_PRECOMPILED_RUNTIME)
static RawCode* FinalizeCode(const Function& function,
Assembler* assembler,
bool optimized = false);
static RawCode* FinalizeCode(const char* name,
Assembler* assembler,
bool optimized);
#endif
static RawCode* LookupCode(uword pc);
static RawCode* LookupCodeInVmIsolate(uword pc);
static RawCode* FindCode(uword pc, int64_t timestamp);

View file

@ -838,11 +838,13 @@ void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
jsobj.AddProperty("_objectPool", object_pool);
{
JSONArray jsarr(&jsobj, "_disassembly");
#if !defined(DART_PRECOMPILED_RUNTIME)
if (is_alive()) {
// Only disassemble alive code objects.
DisassembleToJSONStream formatter(jsarr);
Disassemble(&formatter);
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
}
const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors());
if (!descriptors.IsNull()) {

View file

@ -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/redundancy_elimination.h"
#include "vm/bit_vector.h"
@ -3301,3 +3303,5 @@ void DeadCodeElimination::EliminateDeadPhis(FlowGraph* flow_graph) {
}
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -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/regexp_assembler_ir.h"
#include "vm/bit_vector.h"
@ -1732,3 +1734,5 @@ Value* IRRegExpMacroAssembler::LoadCodeUnitsAt(LocalVariable* index,
#undef __
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -1718,10 +1718,11 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
#ifndef DART_PRECOMPILED_RUNTIME
// Ensure that we have unoptimized code.
frame->function().EnsureHasCompiledUnoptimizedCode();
#endif
const int num_vars = frame->NumLocalVariables();
#else
// Variable locations and number are unknown when precompiling.
const int num_vars =
FLAG_precompiled_runtime ? 0 : frame->NumLocalVariables();
const int num_vars = 0;
#endif
TokenPosition unused = TokenPosition::kNoSource;
for (intptr_t v = 0; v < num_vars; v++) {
frame->VariableAt(v, &var_name, &unused, &unused, &unused, &var_value);
@ -2305,6 +2306,12 @@ DEFINE_RUNTIME_ENTRY(InitStaticField, 1) {
field.EvaluateInitializer();
}
// Print the stop message.
DEFINE_LEAF_RUNTIME_ENTRY(void, PrintStopMessage, 1, const char* message) {
OS::Print("Stop message: %s\n", message);
}
END_LEAF_RUNTIME_ENTRY
// Use expected function signatures to help MSVC compiler resolve overloading.
typedef double (*UnaryMathCFunction)(double x);
typedef double (*BinaryMathCFunction)(double x, double y);

View file

@ -58,7 +58,8 @@ class RuntimeEntry : public ValueObject {
uword GetEntryPoint() const;
// Generate code to call the runtime entry.
void Call(Assembler* assembler, intptr_t argument_count) const;
NOT_IN_PRECOMPILED(void Call(Assembler* assembler, intptr_t argument_count)
const);
void set_next(const RuntimeEntry* next) { next_ = next; }
const RuntimeEntry* next() const { return next_; }

View file

@ -36,6 +36,7 @@ uword RuntimeEntry::GetEntryPoint() const {
return entry;
}
#if !defined(DART_PRECOMPILED_RUNTIME)
// Generate code to call into the stub which will call the runtime
// function. Input for the stub is as follows:
// SP : points to the arguments and return value array.
@ -53,6 +54,7 @@ void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
__ BranchLinkToRuntime();
}
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
} // namespace dart

View file

@ -36,6 +36,7 @@ uword RuntimeEntry::GetEntryPoint() const {
return entry;
}
#if !defined(DART_PRECOMPILED_RUNTIME)
// Generate code to call into the stub which will call the runtime
// function. Input for the stub is as follows:
// SP : points to the arguments and return value array.
@ -71,6 +72,7 @@ void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
__ BranchLinkToRuntime();
}
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
} // namespace dart

View file

@ -18,6 +18,7 @@ uword RuntimeEntry::GetEntryPoint() const {
return reinterpret_cast<uword>(function());
}
#if !defined(DART_PRECOMPILED_RUNTIME)
// Generate code to call into the stub which will call the runtime
// function. Input for the stub is as follows:
// For regular runtime calls -
@ -39,6 +40,7 @@ void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
__ CallToRuntime();
}
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
} // namespace dart

View file

@ -18,6 +18,7 @@ uword RuntimeEntry::GetEntryPoint() const {
return reinterpret_cast<uword>(function());
}
#if !defined(DART_PRECOMPILED_RUNTIME)
// Generate code to call into the stub which will call the runtime
// function. Input for the stub is as follows:
// RSP : points to the arguments and return value array.
@ -37,6 +38,7 @@ void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
__ CallToRuntime();
}
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
} // namespace dart

View file

@ -39,23 +39,46 @@ void StubEntry::VisitObjectPointers(ObjectPointerVisitor* visitor) {
visitor->VisitPointer(reinterpret_cast<RawObject**>(&code_));
}
#if defined(DART_PRECOMPILED_RUNTIME)
void StubCode::InitOnce() {
// Stubs will be loaded from the snapshot.
UNREACHABLE();
}
#else
#define STUB_CODE_GENERATE(name) \
code ^= Generate("_stub_" #name, StubCode::Generate##name##Stub); \
entries_[k##name##Index] = new StubEntry(code);
void StubCode::InitOnce() {
#if defined(DART_PRECOMPILED_RUNTIME)
// Stubs will be loaded from the snapshot.
UNREACHABLE();
#else
// Generate all the stubs.
Code& code = Code::Handle();
VM_STUB_CODE_LIST(STUB_CODE_GENERATE);
#endif // DART_PRECOMPILED_RUNTIME
}
#undef STUB_CODE_GENERATE
RawCode* StubCode::Generate(const char* name,
void (*GenerateStub)(Assembler* assembler)) {
Assembler assembler;
GenerateStub(&assembler);
const Code& code =
Code::Handle(Code::FinalizeCode(name, &assembler, false /* optimized */));
#ifndef PRODUCT
if (FLAG_support_disassembler && FLAG_disassemble_stubs) {
LogBlock lb;
THR_Print("Code for stub '%s': {\n", name);
DisassembleToStdout formatter;
code.Disassemble(&formatter);
THR_Print("}\n");
const ObjectPool& object_pool = ObjectPool::Handle(code.object_pool());
object_pool.DebugPrint();
}
#endif // !PRODUCT
return code.raw();
}
#endif // defined(DART_PRECOMPILED_RUNTIME)
void StubCode::Init(Isolate* isolate) {}
void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) {}
@ -107,6 +130,7 @@ RawCode* StubCode::GetAllocationStubForClass(const Class& cls) {
return AllocateArray_entry()->code();
}
Code& stub = Code::Handle(zone, cls.allocation_stub());
#if !defined(DART_PRECOMPILED_RUNTIME)
if (stub.IsNull()) {
Assembler assembler;
const char* name = cls.ToCString();
@ -158,6 +182,7 @@ RawCode* StubCode::GetAllocationStubForClass(const Class& cls) {
}
#endif // !PRODUCT
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
return stub.raw();
#endif // !DBC
UNIMPLEMENTED();
@ -184,26 +209,6 @@ const StubEntry* StubCode::UnoptimizedStaticCallEntry(
#endif
}
RawCode* StubCode::Generate(const char* name,
void (*GenerateStub)(Assembler* assembler)) {
Assembler assembler;
GenerateStub(&assembler);
const Code& code =
Code::Handle(Code::FinalizeCode(name, &assembler, false /* optimized */));
#ifndef PRODUCT
if (FLAG_support_disassembler && FLAG_disassemble_stubs) {
LogBlock lb;
THR_Print("Code for stub '%s': {\n", name);
DisassembleToStdout formatter;
code.Disassemble(&formatter);
THR_Print("}\n");
const ObjectPool& object_pool = ObjectPool::Handle(code.object_pool());
object_pool.DebugPrint();
}
#endif // !PRODUCT
return code.raw();
}
const char* StubCode::NameOfStub(uword entry_point) {
#define VM_STUB_CODE_TESTER(name) \
if ((name##_entry() != NULL) && \

View file

@ -169,11 +169,6 @@ class StubCode : public AllStatic {
static const intptr_t kStubCodeSize = 4 * KB;
#define STUB_CODE_GENERATE(name) \
static void Generate##name##Stub(Assembler* assembler);
VM_STUB_CODE_LIST(STUB_CODE_GENERATE)
#undef STUB_CODE_GENERATE
enum {
#define STUB_CODE_ENTRY(name) k##name##Index,
VM_STUB_CODE_LIST(STUB_CODE_ENTRY)
@ -183,6 +178,12 @@ class StubCode : public AllStatic {
static StubEntry* entries_[kNumStubEntries];
#if !defined(DART_PRECOMPILED_RUNTIME)
#define STUB_CODE_GENERATE(name) \
static void Generate##name##Stub(Assembler* assembler);
VM_STUB_CODE_LIST(STUB_CODE_GENERATE)
#undef STUB_CODE_GENERATE
// Generate the stub and finalize the generated code into the stub
// code executable area.
static RawCode* Generate(const char* name,
@ -200,6 +201,7 @@ class StubCode : public AllStatic {
static void GenerateUsageCounterIncrement(Assembler* assembler,
Register temp_reg);
static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler);
#endif // !defined(DART_PRECOMPILED_RUNTIME)
};
enum DeoptStubKind { kLazyDeoptFromReturn, kLazyDeoptFromThrow, kEagerDeopt };

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
#if defined(TARGET_ARCH_ARM)
#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/assembler.h"
#include "vm/compiler.h"
@ -103,12 +103,6 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
__ Ret();
}
// Print the stop message.
DEFINE_LEAF_RUNTIME_ENTRY(void, PrintStopMessage, 1, const char* message) {
OS::Print("Stop message: %s\n", message);
}
END_LEAF_RUNTIME_ENTRY
// Input parameters:
// R0 : stop message (const char*).
// Must preserve all registers.
@ -2271,4 +2265,4 @@ void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) {
} // namespace dart
#endif // defined TARGET_ARCH_ARM
#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
#if defined(TARGET_ARCH_ARM64)
#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/assembler.h"
#include "vm/compiler.h"
@ -123,12 +123,6 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
__ ret();
}
// Print the stop message.
DEFINE_LEAF_RUNTIME_ENTRY(void, PrintStopMessage, 1, const char* message) {
OS::Print("Stop message: %s\n", message);
}
END_LEAF_RUNTIME_ENTRY
void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) {
__ Stop("GeneratePrintStopMessageStub");
}
@ -2322,4 +2316,4 @@ void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) {
} // namespace dart
#endif // defined TARGET_ARCH_ARM64
#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -87,12 +87,6 @@ void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) {
__ Trap();
}
// Print the stop message.
DEFINE_LEAF_RUNTIME_ENTRY(void, PrintStopMessage, 1, const char* message) {
OS::Print("Stop message: %s\n", message);
}
END_LEAF_RUNTIME_ENTRY
} // namespace dart
#endif // defined TARGET_ARCH_DBC

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
#if defined(TARGET_ARCH_IA32)
#if defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/assembler.h"
#include "vm/compiler.h"
@ -92,12 +92,6 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
__ ret();
}
// Print the stop message.
DEFINE_LEAF_RUNTIME_ENTRY(void, PrintStopMessage, 1, const char* message) {
OS::Print("Stop message: %s\n", message);
}
END_LEAF_RUNTIME_ENTRY
// Input parameters:
// ESP : points to return address.
// EAX : stop message (const char*).
@ -2081,4 +2075,4 @@ void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) {
} // namespace dart
#endif // defined TARGET_ARCH_IA32
#endif // defined(TARGET_ARCH_IA32) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/globals.h"
#if defined(TARGET_ARCH_X64)
#if defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/assembler.h"
#include "vm/compiler.h"
@ -96,12 +96,6 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
__ ret();
}
// Print the stop message.
DEFINE_LEAF_RUNTIME_ENTRY(void, PrintStopMessage, 1, const char* message) {
OS::Print("Stop message: %s\n", message);
}
END_LEAF_RUNTIME_ENTRY
// Input parameters:
// RSP : points to return address.
// RDI : stop message (const char*).
@ -2266,4 +2260,4 @@ void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) {
} // namespace dart
#endif // defined TARGET_ARCH_X64
#endif // defined(TARGET_ARCH_X64) && !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -60,10 +60,14 @@ bool WeakCodeReferences::IsOptimizedCode(const Array& dependent_code,
void WeakCodeReferences::DisableCode() {
Thread* thread = Thread::Current();
const Array& code_objects = Array::Handle(thread->zone(), array_.raw());
#if defined(DART_PRECOMPILED_RUNTIME)
ASSERT(code_objects.IsNull());
return;
#else
if (code_objects.IsNull()) {
return;
}
ASSERT(!FLAG_precompiled_runtime);
UpdateArrayTo(Object::null_array());
// Disable all code on stack.
Code& code = Code::Handle();
@ -129,6 +133,7 @@ void WeakCodeReferences::DisableCode() {
}
}
}
#endif // defined(DART_PRECOMPILED_RUNTIME)
}
} // namespace dart