Index: runtime/vm/runtime_entry.cc |
diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc |
index 3504e78830f6893a95ed14df30445eecf325dced..53db05703ff88e3a23ed3f24bf9e00ff94ec3f64 100644 |
--- a/runtime/vm/runtime_entry.cc |
+++ b/runtime/vm/runtime_entry.cc |
@@ -14,9 +14,9 @@ |
#include "vm/deopt_instructions.h" |
#include "vm/exceptions.h" |
#include "vm/flags.h" |
-#include "vm/object_store.h" |
#include "vm/message.h" |
#include "vm/message_handler.h" |
+#include "vm/object_store.h" |
#include "vm/parser.h" |
#include "vm/resolver.h" |
#include "vm/service_isolate.h" |
@@ -92,7 +92,6 @@ DEFINE_FLAG(charp, |
"the specified class"); |
#endif |
- |
#if defined(TESTING) || defined(DEBUG) |
void VerifyOnTransition() { |
Thread* thread = Thread::Current(); |
@@ -104,7 +103,6 @@ void VerifyOnTransition() { |
} |
#endif |
- |
// Add function to a class and that class to the class dictionary so that |
// frame walking can be used. |
const Function& RegisterFakeFunction(const char* name, const Code& code) { |
@@ -126,7 +124,6 @@ const Function& RegisterFakeFunction(const char* name, const Code& code) { |
return function; |
} |
- |
DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) { |
const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); |
const String& function_name = String::Handle(function.name()); |
@@ -136,7 +133,6 @@ DEFINE_RUNTIME_ENTRY(TraceFunctionEntry, 1) { |
function_name.ToCString()); |
} |
- |
DEFINE_RUNTIME_ENTRY(TraceFunctionExit, 1) { |
const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); |
const String& function_name = String::Handle(function.name()); |
@@ -146,7 +142,6 @@ DEFINE_RUNTIME_ENTRY(TraceFunctionExit, 1) { |
function_name.ToCString()); |
} |
- |
DEFINE_RUNTIME_ENTRY(RangeError, 2) { |
const Instance& length = Instance::CheckedHandle(arguments.ArgAt(0)); |
const Instance& index = Instance::CheckedHandle(arguments.ArgAt(1)); |
@@ -175,7 +170,6 @@ DEFINE_RUNTIME_ENTRY(RangeError, 2) { |
Exceptions::ThrowByType(Exceptions::kRange, args); |
} |
- |
// Allocation of a fixed length array of given element type. |
// This runtime entry is never called for allocating a List of a generic type, |
// because a prior run time call instantiates the element type if necessary. |
@@ -217,7 +211,6 @@ DEFINE_RUNTIME_ENTRY(AllocateArray, 2) { |
Exceptions::ThrowByType(Exceptions::kRange, args); |
} |
- |
// Helper returning the token position of the Dart caller. |
static TokenPosition GetCallerLocation() { |
DartFrameIterator iterator(Thread::Current(), |
@@ -227,7 +220,6 @@ static TokenPosition GetCallerLocation() { |
return caller_frame->GetTokenPos(); |
} |
- |
// Allocate a new object. |
// Arg0: class of the object that needs to be allocated. |
// Arg1: type arguments of the object that needs to be allocated. |
@@ -265,7 +257,6 @@ DEFINE_RUNTIME_ENTRY(AllocateObject, 2) { |
instance.SetTypeArguments(type_arguments); |
} |
- |
// Instantiate type. |
// Arg0: uninstantiated type. |
// Arg1: instantiator type arguments. |
@@ -305,7 +296,6 @@ DEFINE_RUNTIME_ENTRY(InstantiateType, 3) { |
arguments.SetReturn(type); |
} |
- |
// Instantiate type arguments. |
// Arg0: uninstantiated type arguments. |
// Arg1: instantiator type arguments. |
@@ -348,7 +338,6 @@ DEFINE_RUNTIME_ENTRY(InstantiateTypeArguments, 3) { |
arguments.SetReturn(type_arguments); |
} |
- |
// Allocate a new context large enough to hold the given number of variables. |
// Arg0: number of variables. |
// Return value: newly allocated context. |
@@ -357,7 +346,6 @@ DEFINE_RUNTIME_ENTRY(AllocateContext, 1) { |
arguments.SetReturn(Context::Handle(Context::New(num_variables.Value()))); |
} |
- |
// Make a copy of the given context, including the values of the captured |
// variables. |
// Arg0: the context to be cloned. |
@@ -375,7 +363,6 @@ DEFINE_RUNTIME_ENTRY(CloneContext, 1) { |
arguments.SetReturn(cloned_ctx); |
} |
- |
// Helper routine for tracing a type check. |
static void PrintTypeCheck(const char* message, |
const Instance& instance, |
@@ -420,7 +407,6 @@ static void PrintTypeCheck(const char* message, |
OS::PrintErr(" -> Function %s\n", function.ToFullyQualifiedCString()); |
} |
- |
// This updates the type test cache, an array containing 5-value elements |
// (instance class (or function if the instance is a closure), instance type |
// arguments, instantiator type arguments, function type arguments, |
@@ -570,7 +556,6 @@ static void UpdateTypeTestCache( |
} |
} |
- |
// Check that the given instance is an instance of the given type. |
// Tested instance may not be null, because the null test is inlined. |
// Arg0: instance being checked. |
@@ -616,7 +601,6 @@ DEFINE_RUNTIME_ENTRY(Instanceof, 5) { |
arguments.SetReturn(result); |
} |
- |
// Check that the type of the given instance is a subtype of the given type and |
// can therefore be assigned. |
// Arg0: instance being assigned. |
@@ -679,7 +663,6 @@ DEFINE_RUNTIME_ENTRY(TypeCheck, 6) { |
arguments.SetReturn(src_instance); |
} |
- |
// Report that the type of the given object is not bool in conditional context. |
// Throw assertion error if the object is null. (cf. Boolean Conversion |
// in language Spec.) |
@@ -719,7 +702,6 @@ DEFINE_RUNTIME_ENTRY(NonBoolTypeError, 1) { |
UNREACHABLE(); |
} |
- |
// Report that the type of the type check is malformed or malbounded. |
// Arg0: src value. |
// Arg1: name of destination being assigned to. |
@@ -738,13 +720,11 @@ DEFINE_RUNTIME_ENTRY(BadTypeError, 3) { |
UNREACHABLE(); |
} |
- |
DEFINE_RUNTIME_ENTRY(Throw, 1) { |
const Instance& exception = Instance::CheckedHandle(zone, arguments.ArgAt(0)); |
Exceptions::Throw(thread, exception); |
} |
- |
DEFINE_RUNTIME_ENTRY(ReThrow, 2) { |
const Instance& exception = Instance::CheckedHandle(zone, arguments.ArgAt(0)); |
const Instance& stacktrace = |
@@ -752,7 +732,6 @@ DEFINE_RUNTIME_ENTRY(ReThrow, 2) { |
Exceptions::ReThrow(thread, exception, stacktrace); |
} |
- |
// Patches static call in optimized code with the target's entry point. |
// Compiles target if necessary. |
DEFINE_RUNTIME_ENTRY(PatchStaticCall, 0) { |
@@ -783,7 +762,6 @@ DEFINE_RUNTIME_ENTRY(PatchStaticCall, 0) { |
arguments.SetReturn(target_code); |
} |
- |
// Result of an invoke may be an unhandled exception, in which case we |
// rethrow it. |
static void CheckResultError(const Object& result) { |
@@ -792,7 +770,6 @@ static void CheckResultError(const Object& result) { |
} |
} |
- |
#if !defined(TARGET_ARCH_DBC) |
// Gets called from debug stub when code reaches a breakpoint |
// set on a runtime stub call. |
@@ -830,7 +807,6 @@ DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) { |
} |
#endif // !defined(TARGET_ARCH_DBC) |
- |
DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) { |
if (!FLAG_support_debugger) { |
UNREACHABLE(); |
@@ -844,7 +820,6 @@ DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) { |
} |
} |
- |
// An instance call of the form o.f(...) could not be resolved. Check if |
// there is a getter with the same name. If so, invoke it. If the value is |
// a closure, invoke it with the given arguments. If the value is a |
@@ -881,7 +856,6 @@ static bool ResolveCallThroughGetter(const Instance& receiver, |
return true; |
} |
- |
// Handle other invocations (implicit closures, noSuchMethod). |
RawFunction* InlineCacheMissHelper(const Instance& receiver, |
const Array& args_descriptor, |
@@ -910,7 +884,6 @@ RawFunction* InlineCacheMissHelper(const Instance& receiver, |
return result.raw(); |
} |
- |
// Perform the subtype and return constant function based on the result. |
static RawFunction* ComputeTypeCheckTarget(const Instance& receiver, |
const AbstractType& type, |
@@ -927,7 +900,6 @@ static RawFunction* ComputeTypeCheckTarget(const Instance& receiver, |
return target.raw(); |
} |
- |
static RawFunction* InlineCacheMissHandler( |
const GrowableArray<const Instance*>& args, // Checked arguments only. |
const ICData& ic_data) { |
@@ -998,7 +970,6 @@ static RawFunction* InlineCacheMissHandler( |
return target_function.raw(); |
} |
- |
// Handles inline cache misses by updating the IC data array of the call site. |
// Arg0: Receiver object. |
// Arg1: IC data object. |
@@ -1014,7 +985,6 @@ DEFINE_RUNTIME_ENTRY(InlineCacheMissHandlerOneArg, 2) { |
arguments.SetReturn(result); |
} |
- |
// Handles inline cache misses by updating the IC data array of the call site. |
// Arg0: Receiver object. |
// Arg1: Argument after receiver. |
@@ -1033,7 +1003,6 @@ DEFINE_RUNTIME_ENTRY(InlineCacheMissHandlerTwoArgs, 3) { |
arguments.SetReturn(result); |
} |
- |
// Handles a static call in unoptimized code that has one argument type not |
// seen before. Compile the target if necessary and update the ICData. |
// Arg0: argument. |
@@ -1058,7 +1027,6 @@ DEFINE_RUNTIME_ENTRY(StaticCallMissHandlerOneArg, 2) { |
arguments.SetReturn(target); |
} |
- |
// Handles a static call in unoptimized code that has two argument types not |
// seen before. Compile the target if necessary and update the ICData. |
// Arg0: argument 0. |
@@ -1088,7 +1056,6 @@ DEFINE_RUNTIME_ENTRY(StaticCallMissHandlerTwoArgs, 3) { |
arguments.SetReturn(target); |
} |
- |
#if !defined(TARGET_ARCH_DBC) |
static bool IsSingleTarget(Isolate* isolate, |
Zone* zone, |
@@ -1114,7 +1081,6 @@ static bool IsSingleTarget(Isolate* isolate, |
} |
#endif |
- |
// Handle a miss of a single target cache. |
// Arg0: Receiver. |
// Returns: the ICData used to continue with a polymorphic call. |
@@ -1205,7 +1171,6 @@ DEFINE_RUNTIME_ENTRY(SingleTargetMiss, 1) { |
#endif |
} |
- |
DEFINE_RUNTIME_ENTRY(UnlinkedCall, 2) { |
#if defined(TARGET_ARCH_DBC) |
// DBC does not use switchable calls. |
@@ -1272,7 +1237,6 @@ DEFINE_RUNTIME_ENTRY(UnlinkedCall, 2) { |
#endif // !DBC |
} |
- |
// Handle a miss of a megamorphic cache. |
// Arg0: Receiver. |
// Returns: the ICData used to continue with a polymorphic call. |
@@ -1371,7 +1335,6 @@ DEFINE_RUNTIME_ENTRY(MonomorphicMiss, 1) { |
#endif // !defined(TARGET_ARCH_DBC) |
} |
- |
// Handle a miss of a megamorphic cache. |
// Arg0: Receiver. |
// Arg1: ICData or MegamorphicCache. |
@@ -1473,7 +1436,6 @@ DEFINE_RUNTIME_ENTRY(MegamorphicCacheMissHandler, 3) { |
#endif // !defined(TARGET_ARCH_DBC) |
} |
- |
// Invoke appropriate noSuchMethod or closure from getter. |
// Arg0: receiver |
// Arg1: ICData or MegamorphicCache |
@@ -1617,7 +1579,6 @@ DEFINE_RUNTIME_ENTRY(InvokeNoSuchMethodDispatcher, 4) { |
#undef CLOSURIZE |
} |
- |
// Invoke appropriate noSuchMethod function. |
// Arg0: receiver (closure object) |
// Arg1: arguments descriptor array. |
@@ -1639,7 +1600,6 @@ DEFINE_RUNTIME_ENTRY(InvokeClosureNoSuchMethod, 3) { |
arguments.SetReturn(result); |
} |
- |
DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
#if defined(USING_SIMULATOR) |
uword stack_pos = Simulator::Current()->get_sp(); |
@@ -1828,7 +1788,6 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { |
} |
} |
- |
DEFINE_RUNTIME_ENTRY(TraceICCall, 2) { |
const ICData& ic_data = ICData::CheckedHandle(arguments.ArgAt(0)); |
const Function& function = Function::CheckedHandle(arguments.ArgAt(1)); |
@@ -1842,7 +1801,6 @@ DEFINE_RUNTIME_ENTRY(TraceICCall, 2) { |
ic_data.NumberOfChecks(), function.ToFullyQualifiedCString()); |
} |
- |
// This is called from function that needs to be optimized. |
// The requesting function can be already optimized (reoptimization). |
// Returns the Code object where to continue execution. |
@@ -1909,7 +1867,6 @@ DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) { |
#endif // !DART_PRECOMPILED_RUNTIME |
} |
- |
// The caller must be a static call in a Dart frame, or an entry frame. |
// Patch static call to point to valid code's entry point. |
DEFINE_RUNTIME_ENTRY(FixCallersTarget, 0) { |
@@ -1947,7 +1904,6 @@ DEFINE_RUNTIME_ENTRY(FixCallersTarget, 0) { |
arguments.SetReturn(current_target_code); |
} |
- |
// The caller tried to allocate an instance via an invalidated allocation |
// stub. |
DEFINE_RUNTIME_ENTRY(FixAllocationStubTarget, 0) { |
@@ -1991,7 +1947,6 @@ DEFINE_RUNTIME_ENTRY(FixAllocationStubTarget, 0) { |
#endif |
} |
- |
const char* DeoptReasonToCString(ICData::DeoptReasonId deopt_reason) { |
switch (deopt_reason) { |
#define DEOPT_REASON_TO_TEXT(name) \ |
@@ -2005,7 +1960,6 @@ const char* DeoptReasonToCString(ICData::DeoptReasonId deopt_reason) { |
} |
} |
- |
void DeoptimizeAt(const Code& optimized_code, StackFrame* frame) { |
ASSERT(optimized_code.is_optimized()); |
Thread* thread = Thread::Current(); |
@@ -2077,7 +2031,6 @@ void DeoptimizeAt(const Code& optimized_code, StackFrame* frame) { |
optimized_code.set_is_alive(false); |
} |
- |
// Currently checks only that all optimized frames have kDeoptIndex |
// and unoptimized code has the kDeoptAfter. |
void DeoptimizeFunctionsOnStack() { |
@@ -2129,7 +2082,6 @@ static void CopySavedRegisters(uword saved_registers_address, |
} |
#endif |
- |
// Copies saved registers and caller's frame into temporary buffers. |
// Returns the stack size of unoptimized frame. |
// The calling code must be optimized, but its function may not have |
@@ -2213,7 +2165,6 @@ DEFINE_LEAF_RUNTIME_ENTRY(intptr_t, |
} |
END_LEAF_RUNTIME_ENTRY |
- |
// The stack has been adjusted to fit all values for unoptimized frame. |
// Fill the unoptimized frame. |
DEFINE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, 1, uword last_fp) { |
@@ -2256,7 +2207,6 @@ DEFINE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, 1, uword last_fp) { |
} |
END_LEAF_RUNTIME_ENTRY |
- |
// This is the last step in the deoptimization, GC can occur. |
// Returns number of bytes to remove from the expression stack of the |
// bottom-most deoptimized frame. Those arguments were artificially injected |
@@ -2284,7 +2234,6 @@ DEFINE_RUNTIME_ENTRY(DeoptimizeMaterialize, 0) { |
#endif // !DART_PRECOMPILED_RUNTIME |
} |
- |
DEFINE_RUNTIME_ENTRY(RewindPostDeopt, 0) { |
#if !defined(DART_PRECOMPILED_RUNTIME) |
#if !defined(PRODUCT) |
@@ -2308,7 +2257,6 @@ DEFINE_LEAF_RUNTIME_ENTRY(intptr_t, |
} |
END_LEAF_RUNTIME_ENTRY |
- |
double DartModulo(double left, double right) { |
double remainder = fmod_ieee(left, right); |
if (remainder == 0.0) { |
@@ -2324,7 +2272,6 @@ double DartModulo(double left, double right) { |
return remainder; |
} |
- |
// Update global type feedback recorded for a field recording the assignment |
// of the given value. |
// Arg0: Field object; |
@@ -2335,7 +2282,6 @@ DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { |
field.RecordStore(value); |
} |
- |
DEFINE_RUNTIME_ENTRY(InitStaticField, 1) { |
const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
field.EvaluateInitializer(); |