| 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 DEFINE_RUNTIME_ENTRY(ResolveCompileInstanceFunction, 1) { | 462 DEFINE_RUNTIME_ENTRY(ResolveCompileInstanceFunction, 1) { |
| 463 ASSERT(arguments.Count() == | 463 ASSERT(arguments.Count() == |
| 464 kResolveCompileInstanceFunctionRuntimeEntry.argument_count()); | 464 kResolveCompileInstanceFunctionRuntimeEntry.argument_count()); |
| 465 const Instance& receiver = Instance::CheckedHandle(arguments.At(0)); | 465 const Instance& receiver = Instance::CheckedHandle(arguments.At(0)); |
| 466 const Code& code = Code::Handle( | 466 const Code& code = Code::Handle( |
| 467 ResolveCompileInstanceCallTarget(isolate, receiver)); | 467 ResolveCompileInstanceCallTarget(isolate, receiver)); |
| 468 arguments.SetReturn(Code::Handle(code.raw())); | 468 arguments.SetReturn(Code::Handle(code.raw())); |
| 469 } | 469 } |
| 470 | 470 |
| 471 | 471 |
| 472 // Gets called from debug stub when code reaches a breakpoint. |
| 473 DEFINE_RUNTIME_ENTRY(BreakpointHandler, 0) { |
| 474 ASSERT(arguments.Count() == kBreakpointHandlerRuntimeEntry.argument_count()); |
| 475 DartFrameIterator iterator; |
| 476 DartFrame* frame = iterator.NextFrame(); |
| 477 Function& func = Function::Handle(); |
| 478 ASSERT(frame != NULL); |
| 479 OS::Print(">>> Breakpoint at 0x%08x\n", frame->pc()); |
| 480 while (frame != NULL) { |
| 481 ASSERT(frame->IsValid()); |
| 482 ASSERT(frame->IsDartFrame()); |
| 483 func = frame->LookupDartFunction(); |
| 484 OS::Print(" func %s\n", String::Handle(func.name()).ToCString()); |
| 485 frame = iterator.NextFrame(); |
| 486 } |
| 487 } |
| 488 |
| 489 |
| 472 // Handles inline cache misses by updating the IC data array of the call | 490 // Handles inline cache misses by updating the IC data array of the call |
| 473 // site. | 491 // site. |
| 474 // Arg0: Receiver object. | 492 // Arg0: Receiver object. |
| 475 // Returns: target function with compiled code or 0. | 493 // Returns: target function with compiled code or 0. |
| 476 // Modifies the instance call to hold the updated IC data array. | 494 // Modifies the instance call to hold the updated IC data array. |
| 477 DEFINE_RUNTIME_ENTRY(InlineCacheMissHandler, 1) { | 495 DEFINE_RUNTIME_ENTRY(InlineCacheMissHandler, 1) { |
| 478 ASSERT(arguments.Count() == | 496 ASSERT(arguments.Count() == |
| 479 kInlineCacheMissHandlerRuntimeEntry.argument_count()); | 497 kInlineCacheMissHandlerRuntimeEntry.argument_count()); |
| 480 const Instance& receiver = Instance::CheckedHandle(arguments.At(0)); | 498 const Instance& receiver = Instance::CheckedHandle(arguments.At(0)); |
| 481 const Code& target_code = | 499 const Code& target_code = |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 } | 1030 } |
| 1013 } | 1031 } |
| 1014 } | 1032 } |
| 1015 // The cache is null terminated, therefore the loop above should never | 1033 // The cache is null terminated, therefore the loop above should never |
| 1016 // terminate by itself. | 1034 // terminate by itself. |
| 1017 UNREACHABLE(); | 1035 UNREACHABLE(); |
| 1018 return Code::null(); | 1036 return Code::null(); |
| 1019 } | 1037 } |
| 1020 | 1038 |
| 1021 } // namespace dart | 1039 } // namespace dart |
| OLD | NEW |