OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/debugger.h" | 5 #include "vm/debugger.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "platform/address_sanitizer.h" | 9 #include "platform/address_sanitizer.h" |
10 | 10 |
11 #include "vm/code_patcher.h" | 11 #include "vm/code_patcher.h" |
12 #include "vm/compiler.h" | 12 #include "vm/compiler.h" |
13 #include "vm/dart_entry.h" | 13 #include "vm/dart_entry.h" |
14 #include "vm/deopt_instructions.h" | 14 #include "vm/deopt_instructions.h" |
15 #include "vm/disassembler.h" | 15 #include "vm/disassembler.h" |
16 #include "vm/flags.h" | 16 #include "vm/flags.h" |
17 #include "vm/globals.h" | 17 #include "vm/globals.h" |
18 #include "vm/json_stream.h" | 18 #include "vm/json_stream.h" |
19 #include "vm/kernel_to_il.h" | |
19 #include "vm/longjump.h" | 20 #include "vm/longjump.h" |
20 #include "vm/message_handler.h" | 21 #include "vm/message_handler.h" |
21 #include "vm/object.h" | 22 #include "vm/object.h" |
22 #include "vm/object_store.h" | 23 #include "vm/object_store.h" |
23 #include "vm/os.h" | 24 #include "vm/os.h" |
24 #include "vm/parser.h" | 25 #include "vm/parser.h" |
25 #include "vm/port.h" | 26 #include "vm/port.h" |
26 #include "vm/runtime_entry.h" | 27 #include "vm/runtime_entry.h" |
27 #include "vm/service.h" | 28 #include "vm/service.h" |
28 #include "vm/service_event.h" | 29 #include "vm/service_event.h" |
(...skipping 3738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3767 bool Debugger::IsAtAsyncJump(ActivationFrame* top_frame) { | 3768 bool Debugger::IsAtAsyncJump(ActivationFrame* top_frame) { |
3768 Zone* zone = Thread::Current()->zone(); | 3769 Zone* zone = Thread::Current()->zone(); |
3769 Object& closure_or_null = | 3770 Object& closure_or_null = |
3770 Object::Handle(zone, top_frame->GetAsyncOperation()); | 3771 Object::Handle(zone, top_frame->GetAsyncOperation()); |
3771 if (!closure_or_null.IsNull()) { | 3772 if (!closure_or_null.IsNull()) { |
3772 ASSERT(closure_or_null.IsInstance()); | 3773 ASSERT(closure_or_null.IsInstance()); |
3773 ASSERT(Instance::Cast(closure_or_null).IsClosure()); | 3774 ASSERT(Instance::Cast(closure_or_null).IsClosure()); |
3774 const Script& script = Script::Handle(zone, top_frame->SourceScript()); | 3775 const Script& script = Script::Handle(zone, top_frame->SourceScript()); |
3775 if (script.kind() == RawScript::kKernelTag) { | 3776 if (script.kind() == RawScript::kKernelTag) { |
3776 // Are we at a yield point (previous await)? | 3777 // Are we at a yield point (previous await)? |
3777 const Array& yields = Array::Handle(script.yield_positions()); | 3778 Array& yields = Array::Handle(script.yield_positions()); |
Kevin Millikin (Google)
2017/06/29 12:27:36
It can still be const, can't it?
jensj
2017/06/30 05:51:17
Yes.
In fact, this file no longer needs to change
| |
3778 intptr_t looking_for = top_frame->TokenPos().value(); | 3779 intptr_t looking_for = top_frame->TokenPos().value(); |
3779 Smi& value = Smi::Handle(zone); | 3780 Smi& value = Smi::Handle(zone); |
3780 for (int i = 0; i < yields.Length(); i++) { | 3781 for (int i = 0; i < yields.Length(); i++) { |
3781 value ^= yields.At(i); | 3782 value ^= yields.At(i); |
3782 if (value.Value() == looking_for) return true; | 3783 if (value.Value() == looking_for) return true; |
3783 } | 3784 } |
3784 return false; | 3785 return false; |
3785 } | 3786 } |
3786 const TokenStream& tokens = TokenStream::Handle(zone, script.tokens()); | 3787 const TokenStream& tokens = TokenStream::Handle(zone, script.tokens()); |
3787 TokenStream::Iterator iter(zone, tokens, top_frame->TokenPos()); | 3788 TokenStream::Iterator iter(zone, tokens, top_frame->TokenPos()); |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4529 | 4530 |
4530 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 4531 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
4531 ASSERT(bpt->next() == NULL); | 4532 ASSERT(bpt->next() == NULL); |
4532 bpt->set_next(code_breakpoints_); | 4533 bpt->set_next(code_breakpoints_); |
4533 code_breakpoints_ = bpt; | 4534 code_breakpoints_ = bpt; |
4534 } | 4535 } |
4535 | 4536 |
4536 #endif // !PRODUCT | 4537 #endif // !PRODUCT |
4537 | 4538 |
4538 } // namespace dart | 4539 } // namespace dart |
OLD | NEW |