Index: runtime/vm/native_entry.cc |
diff --git a/runtime/vm/native_entry.cc b/runtime/vm/native_entry.cc |
index e56bfa8eb73409f4f19d10af3a145845b4baa911..7e1655e5867e358be33009a579ac6e5141b94ddd 100644 |
--- a/runtime/vm/native_entry.cc |
+++ b/runtime/vm/native_entry.cc |
@@ -21,7 +21,9 @@ |
namespace dart { |
-DEFINE_FLAG(bool, trace_natives, false, |
+DEFINE_FLAG(bool, |
+ trace_natives, |
+ false, |
"Trace invocation of natives (debug mode only)"); |
@@ -149,13 +151,11 @@ void NativeEntry::NativeCallWrapperNoStackCheck(Dart_NativeArguments args, |
TRACE_NATIVE_CALL("0x%" Px "", reinterpret_cast<uintptr_t>(func)); |
TransitionGeneratedToNative transition(thread); |
if (scope == NULL) { |
- scope = new ApiLocalScope(current_top_scope, |
- thread->top_exit_frame_info()); |
+ scope = |
+ new ApiLocalScope(current_top_scope, thread->top_exit_frame_info()); |
ASSERT(scope != NULL); |
} else { |
- scope->Reinit(thread, |
- current_top_scope, |
- thread->top_exit_frame_info()); |
+ scope->Reinit(thread, current_top_scope, thread->top_exit_frame_info()); |
thread->set_api_reusable_scope(NULL); |
} |
thread->set_api_top_scope(scope); // New scope is now the top scope. |
@@ -197,8 +197,8 @@ static NativeFunction ResolveNativeFunction(Zone* zone, |
const int num_params = NativeArguments::ParameterCountForResolution(func); |
bool auto_setup_scope = true; |
- return NativeEntry::ResolveNative( |
- library, native_name, num_params, &auto_setup_scope); |
+ return NativeEntry::ResolveNative(library, native_name, num_params, |
+ &auto_setup_scope); |
} |
@@ -238,27 +238,25 @@ void NativeEntry::LinkNativeCall(Dart_NativeArguments args) { |
} |
bool is_bootstrap_native = false; |
- target_function = ResolveNativeFunction( |
- arguments->thread()->zone(), func, &is_bootstrap_native); |
+ target_function = ResolveNativeFunction(arguments->thread()->zone(), func, |
+ &is_bootstrap_native); |
ASSERT(target_function != NULL); |
#if defined(DEBUG) |
{ |
NativeFunction current_function = NULL; |
- const Code& current_trampoline = Code::Handle( |
- CodePatcher::GetNativeCallAt(caller_frame->pc(), |
- code, |
- ¤t_function)); |
+ const Code& current_trampoline = |
+ Code::Handle(CodePatcher::GetNativeCallAt(caller_frame->pc(), code, |
+ ¤t_function)); |
#if !defined(USING_SIMULATOR) |
ASSERT(current_function == |
reinterpret_cast<NativeFunction>(LinkNativeCall)); |
#else |
- ASSERT(current_function == |
- reinterpret_cast<NativeFunction>( |
- Simulator::RedirectExternalReference( |
- reinterpret_cast<uword>(LinkNativeCall), |
- Simulator::kBootstrapNativeCall, |
- NativeEntry::kNumArguments))); |
+ ASSERT( |
+ current_function == |
+ reinterpret_cast<NativeFunction>(Simulator::RedirectExternalReference( |
+ reinterpret_cast<uword>(LinkNativeCall), |
+ Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments))); |
#endif |
ASSERT(current_trampoline.raw() == |
StubCode::CallBootstrapCFunction_entry()->code()); |
@@ -267,26 +265,25 @@ void NativeEntry::LinkNativeCall(Dart_NativeArguments args) { |
call_through_wrapper = !is_bootstrap_native; |
const Code& trampoline = |
- Code::Handle(call_through_wrapper ? |
- StubCode::CallNativeCFunction_entry()->code() : |
- StubCode::CallBootstrapCFunction_entry()->code()); |
+ Code::Handle(call_through_wrapper |
+ ? StubCode::CallNativeCFunction_entry()->code() |
+ : StubCode::CallBootstrapCFunction_entry()->code()); |
NativeFunction patch_target_function = target_function; |
#if defined(USING_SIMULATOR) |
if (!call_through_wrapper) { |
- patch_target_function = reinterpret_cast<NativeFunction>( |
- Simulator::RedirectExternalReference( |
+ patch_target_function = |
+ reinterpret_cast<NativeFunction>(Simulator::RedirectExternalReference( |
reinterpret_cast<uword>(patch_target_function), |
Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments)); |
} |
#endif |
- CodePatcher::PatchNativeCallAt( |
- caller_frame->pc(), code, patch_target_function, trampoline); |
+ CodePatcher::PatchNativeCallAt(caller_frame->pc(), code, |
+ patch_target_function, trampoline); |
if (FLAG_trace_natives) { |
- OS::Print(" -> %p (%s)\n", |
- target_function, |
+ OS::Print(" -> %p (%s)\n", target_function, |
is_bootstrap_native ? "bootstrap" : "non-bootstrap"); |
} |
} |