Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: runtime/vm/code_generator.cc

Issue 1168933002: Fixes crashes in VM isolate shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/bin/dbg_message.cc ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 static void CheckResultError(const Object& result) { 691 static void CheckResultError(const Object& result) {
692 if (result.IsError()) { 692 if (result.IsError()) {
693 Exceptions::PropagateError(Error::Cast(result)); 693 Exceptions::PropagateError(Error::Cast(result));
694 } 694 }
695 } 695 }
696 696
697 697
698 // Gets called from debug stub when code reaches a breakpoint 698 // Gets called from debug stub when code reaches a breakpoint
699 // set on a runtime stub call. 699 // set on a runtime stub call.
700 DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) { 700 DEFINE_RUNTIME_ENTRY(BreakpointRuntimeHandler, 0) {
701 ASSERT(isolate->debugger() != NULL);
702 DartFrameIterator iterator; 701 DartFrameIterator iterator;
703 StackFrame* caller_frame = iterator.NextFrame(); 702 StackFrame* caller_frame = iterator.NextFrame();
704 ASSERT(caller_frame != NULL); 703 ASSERT(caller_frame != NULL);
705 uword orig_stub = 704 uword orig_stub =
706 isolate->debugger()->GetPatchedStubAddress(caller_frame->pc()); 705 isolate->debugger()->GetPatchedStubAddress(caller_frame->pc());
707 isolate->debugger()->SignalBpReached(); 706 isolate->debugger()->SignalBpReached();
708 ASSERT((orig_stub & kSmiTagMask) == kSmiTag); 707 ASSERT((orig_stub & kSmiTagMask) == kSmiTag);
709 arguments.SetReturn(Smi::Handle(reinterpret_cast<RawSmi*>(orig_stub))); 708 arguments.SetReturn(Smi::Handle(reinterpret_cast<RawSmi*>(orig_stub)));
710 } 709 }
711 710
712 711
713 DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) { 712 DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) {
714 ASSERT(isolate->debugger() != NULL);
715 isolate->debugger()->DebuggerStepCallback(); 713 isolate->debugger()->DebuggerStepCallback();
716 } 714 }
717 715
718 716
719 // An instance call of the form o.f(...) could not be resolved. Check if 717 // An instance call of the form o.f(...) could not be resolved. Check if
720 // there is a getter with the same name. If so, invoke it. If the value is 718 // there is a getter with the same name. If so, invoke it. If the value is
721 // a closure, invoke it with the given arguments. If the value is a 719 // a closure, invoke it with the given arguments. If the value is a
722 // non-closure, attempt to invoke "call" on it. 720 // non-closure, attempt to invoke "call" on it.
723 static bool ResolveCallThroughGetter(const Instance& receiver, 721 static bool ResolveCallThroughGetter(const Instance& receiver,
724 const Class& receiver_class, 722 const Class& receiver_class,
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 const intptr_t elm_size = old_data.ElementSizeInBytes(); 1682 const intptr_t elm_size = old_data.ElementSizeInBytes();
1685 const TypedData& new_data = 1683 const TypedData& new_data =
1686 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); 1684 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld));
1687 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); 1685 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size);
1688 typed_data_cell.SetAt(0, new_data); 1686 typed_data_cell.SetAt(0, new_data);
1689 arguments.SetReturn(new_data); 1687 arguments.SetReturn(new_data);
1690 } 1688 }
1691 1689
1692 1690
1693 } // namespace dart 1691 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/dbg_message.cc ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698