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

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

Issue 1410643008: Get rid of deprecated methods accessing mutator_thread_ instead of current thread (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/vm/dart_api_impl.cc ('k') | runtime/vm/heap.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) 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/exceptions.h" 5 #include "vm/exceptions.h"
6 6
7 #include "platform/address_sanitizer.h" 7 #include "platform/address_sanitizer.h"
8 8
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 void Exceptions::ReThrow(Thread* thread, 495 void Exceptions::ReThrow(Thread* thread,
496 const Instance& exception, 496 const Instance& exception,
497 const Instance& stacktrace) { 497 const Instance& stacktrace) {
498 // Null object is a valid exception object. 498 // Null object is a valid exception object.
499 ThrowExceptionHelper(thread, exception, stacktrace, true); 499 ThrowExceptionHelper(thread, exception, stacktrace, true);
500 } 500 }
501 501
502 502
503 void Exceptions::PropagateError(const Error& error) { 503 void Exceptions::PropagateError(const Error& error) {
504 Thread* thread = Thread::Current(); 504 Thread* thread = Thread::Current();
505 Isolate* isolate = thread->isolate();
506 Zone* zone = thread->zone(); 505 Zone* zone = thread->zone();
507 ASSERT(isolate->top_exit_frame_info() != 0); 506 ASSERT(thread->top_exit_frame_info() != 0);
508 if (error.IsUnhandledException()) { 507 if (error.IsUnhandledException()) {
509 // If the error object represents an unhandled exception, then 508 // If the error object represents an unhandled exception, then
510 // rethrow the exception in the normal fashion. 509 // rethrow the exception in the normal fashion.
511 const UnhandledException& uhe = UnhandledException::Cast(error); 510 const UnhandledException& uhe = UnhandledException::Cast(error);
512 const Instance& exc = Instance::Handle(zone, uhe.exception()); 511 const Instance& exc = Instance::Handle(zone, uhe.exception());
513 const Instance& stk = Instance::Handle(zone, uhe.stacktrace()); 512 const Instance& stk = Instance::Handle(zone, uhe.stacktrace());
514 Exceptions::ReThrow(thread, exc, stk); 513 Exceptions::ReThrow(thread, exc, stk);
515 } else { 514 } else {
516 // Return to the invocation stub and return this error object. The 515 // Return to the invocation stub and return this error object. The
517 // C++ code which invoked this dart sequence can check and do the 516 // C++ code which invoked this dart sequence can check and do the
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 675
677 // Throw JavascriptCompatibilityError exception. 676 // Throw JavascriptCompatibilityError exception.
678 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { 677 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) {
679 const Array& exc_args = Array::Handle(Array::New(1)); 678 const Array& exc_args = Array::Handle(Array::New(1));
680 const String& msg_str = String::Handle(String::New(msg)); 679 const String& msg_str = String::Handle(String::New(msg));
681 exc_args.SetAt(0, msg_str); 680 exc_args.SetAt(0, msg_str);
682 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); 681 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args);
683 } 682 }
684 683
685 } // namespace dart 684 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698