OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/code_generator.h" | 5 #include "vm/code_generator.h" |
6 | 6 |
7 #include "vm/code_index_table.h" | 7 #include "vm/code_index_table.h" |
8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 caller_frame->pc(), | 432 caller_frame->pc(), |
433 target_function.ToFullyQualifiedCString(), | 433 target_function.ToFullyQualifiedCString(), |
434 new_target); | 434 new_target); |
435 } | 435 } |
436 } | 436 } |
437 | 437 |
438 | 438 |
439 // Resolves and compiles the target function of an instance call, updates | 439 // Resolves and compiles the target function of an instance call, updates |
440 // function cache of the receiver's class and returns the compiled code or null. | 440 // function cache of the receiver's class and returns the compiled code or null. |
441 // Only the number of named arguments is checked, but not the actual names. | 441 // Only the number of named arguments is checked, but not the actual names. |
442 static RawCode* ResolveCompileInstanceCallTarget(Isolate* isolate, | 442 RawCode* ResolveCompileInstanceCallTarget(Isolate* isolate, |
443 const Instance& receiver) { | 443 const Instance& receiver) { |
444 DartFrameIterator iterator; | 444 DartFrameIterator iterator; |
445 DartFrame* caller_frame = iterator.NextFrame(); | 445 DartFrame* caller_frame = iterator.NextFrame(); |
446 ASSERT(caller_frame != NULL); | 446 ASSERT(caller_frame != NULL); |
447 int num_arguments = -1; | 447 int num_arguments = -1; |
448 int num_named_arguments = -1; | 448 int num_named_arguments = -1; |
449 uword target = 0; | 449 uword target = 0; |
450 String& function_name = String::Handle(); | 450 String& function_name = String::Handle(); |
451 CodePatcher::GetInstanceCallAt(caller_frame->pc(), | 451 CodePatcher::GetInstanceCallAt(caller_frame->pc(), |
452 &function_name, | 452 &function_name, |
453 &num_arguments, | 453 &num_arguments, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 const Function& function = Function::CheckedHandle(arguments.At(0)); | 531 const Function& function = Function::CheckedHandle(arguments.At(0)); |
532 if (!function.HasCode()) { | 532 if (!function.HasCode()) { |
533 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 533 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
534 if (!error.IsNull()) { | 534 if (!error.IsNull()) { |
535 Exceptions::PropagateError(error); | 535 Exceptions::PropagateError(error); |
536 } | 536 } |
537 } | 537 } |
538 } | 538 } |
539 | 539 |
540 | 540 |
| 541 // Gets called from debug stub when code reaches a breakpoint at a return |
| 542 // in Dart code. |
| 543 DEFINE_RUNTIME_ENTRY(BreakpointReturnHandler, 0) { |
| 544 ASSERT(arguments.Count() == |
| 545 kBreakpointReturnHandlerRuntimeEntry.argument_count()); |
| 546 ASSERT(isolate->debugger() != NULL); |
| 547 isolate->debugger()->BreakpointCallback(); |
| 548 } |
| 549 |
| 550 |
541 // Gets called from debug stub when code reaches a breakpoint. | 551 // Gets called from debug stub when code reaches a breakpoint. |
542 DEFINE_RUNTIME_ENTRY(BreakpointDynamicHandler, 0) { | 552 DEFINE_RUNTIME_ENTRY(BreakpointDynamicHandler, 0) { |
543 ASSERT(arguments.Count() == | 553 ASSERT(arguments.Count() == |
544 kBreakpointDynamicHandlerRuntimeEntry.argument_count()); | 554 kBreakpointDynamicHandlerRuntimeEntry.argument_count()); |
545 ASSERT(isolate->debugger() != NULL); | 555 ASSERT(isolate->debugger() != NULL); |
546 isolate->debugger()->BreakpointCallback(); | 556 isolate->debugger()->BreakpointCallback(); |
547 } | 557 } |
548 | 558 |
549 | 559 |
550 static RawFunction* InlineCacheMissHandler( | 560 static RawFunction* InlineCacheMissHandler( |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 } | 1187 } |
1178 } | 1188 } |
1179 } | 1189 } |
1180 // The cache is null terminated, therefore the loop above should never | 1190 // The cache is null terminated, therefore the loop above should never |
1181 // terminate by itself. | 1191 // terminate by itself. |
1182 UNREACHABLE(); | 1192 UNREACHABLE(); |
1183 return Code::null(); | 1193 return Code::null(); |
1184 } | 1194 } |
1185 | 1195 |
1186 } // namespace dart | 1196 } // namespace dart |
OLD | NEW |