Chromium Code Reviews| Index: runtime/vm/code_generator.cc |
| =================================================================== |
| --- runtime/vm/code_generator.cc (revision 24288) |
| +++ runtime/vm/code_generator.cc (working copy) |
| @@ -730,7 +730,7 @@ |
| // Patches static call with the target's entry point. Compiles target if |
| -// necessary. |
| +// necessary. Only static calls in optimized code need to be patched. |
|
siva
2013/06/21 23:24:55
Why not change the comment to:
// Patches static
srdjan
2013/06/21 23:32:20
Done.
|
| DEFINE_RUNTIME_ENTRY(PatchStaticCall, 0) { |
| ASSERT(arguments.ArgCount() == kPatchStaticCallRuntimeEntry.argument_count()); |
| DartFrameIterator iterator; |
| @@ -738,6 +738,7 @@ |
| ASSERT(caller_frame != NULL); |
| const Code& caller_code = Code::Handle(caller_frame->LookupDartCode()); |
| ASSERT(!caller_code.IsNull()); |
| + ASSERT(caller_code.is_optimized()); |
| const Function& target_function = Function::Handle( |
| caller_code.GetStaticCallTargetFunctionAt(caller_frame->pc())); |
| if (!target_function.HasCode()) { |
| @@ -835,8 +836,10 @@ |
| StackFrame* caller_frame = iterator.NextFrame(); |
| ASSERT(caller_frame != NULL); |
| const Code& code = Code::Handle(caller_frame->LookupDartCode()); |
| + ASSERT(!code.is_optimized()); |
| const Function& function = |
| - Function::Handle(code.GetStaticCallTargetFunctionAt(caller_frame->pc())); |
| + Function::Handle(CodePatcher::GetUnoptimizedStaticCallTargetAt( |
| + caller_frame->pc(), code)); |
| if (!function.HasCode()) { |
| const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
| @@ -1403,6 +1406,7 @@ |
| } |
| ASSERT(frame->IsDartFrame()); |
| const Code& caller_code = Code::Handle(frame->LookupDartCode()); |
| + ASSERT(caller_code.is_optimized()); |
| const Function& target_function = Function::Handle( |
| caller_code.GetStaticCallTargetFunctionAt(frame->pc())); |
| const Code& target_code = Code::Handle(target_function.CurrentCode()); |