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

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

Issue 2825043002: VM: Prohibit reload when throwing or processing language errors. (Closed)
Patch Set: Created 3 years, 8 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/isolate.cc ('k') | tests/language/language.status » ('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) 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/become.h" 10 #include "vm/become.h"
(...skipping 15350 matching lines...) Expand 10 before | Expand all | Expand 10 after
15361 if (!prev_error.IsNull()) { 15361 if (!prev_error.IsNull()) {
15362 result = String::Concat( 15362 result = String::Concat(
15363 String::Handle(String::New(prev_error.ToErrorCString())), result); 15363 String::Handle(String::New(prev_error.ToErrorCString())), result);
15364 } 15364 }
15365 set_formatted_message(result); 15365 set_formatted_message(result);
15366 return result.raw(); 15366 return result.raw();
15367 } 15367 }
15368 15368
15369 15369
15370 const char* LanguageError::ToErrorCString() const { 15370 const char* LanguageError::ToErrorCString() const {
15371 Thread* thread = Thread::Current();
15372 NoReloadScope no_reload_scope(thread->isolate(), thread);
15371 const String& msg_str = String::Handle(FormatMessage()); 15373 const String& msg_str = String::Handle(FormatMessage());
15372 return msg_str.ToCString(); 15374 return msg_str.ToCString();
15373 } 15375 }
15374 15376
15375 15377
15376 const char* LanguageError::ToCString() const { 15378 const char* LanguageError::ToCString() const {
15377 return "LanguageError"; 15379 return "LanguageError";
15378 } 15380 }
15379 15381
15380 15382
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
15418 15420
15419 15421
15420 void UnhandledException::set_stacktrace(const Instance& stacktrace) const { 15422 void UnhandledException::set_stacktrace(const Instance& stacktrace) const {
15421 StorePointer(&raw_ptr()->stacktrace_, stacktrace.raw()); 15423 StorePointer(&raw_ptr()->stacktrace_, stacktrace.raw());
15422 } 15424 }
15423 15425
15424 15426
15425 const char* UnhandledException::ToErrorCString() const { 15427 const char* UnhandledException::ToErrorCString() const {
15426 Thread* thread = Thread::Current(); 15428 Thread* thread = Thread::Current();
15427 Isolate* isolate = thread->isolate(); 15429 Isolate* isolate = thread->isolate();
15430 NoReloadScope no_reload_scope(isolate, thread);
15428 HANDLESCOPE(thread); 15431 HANDLESCOPE(thread);
15429 Object& strtmp = Object::Handle(); 15432 Object& strtmp = Object::Handle();
15430 const char* exc_str; 15433 const char* exc_str;
15431 if (exception() == isolate->object_store()->out_of_memory()) { 15434 if (exception() == isolate->object_store()->out_of_memory()) {
15432 exc_str = "Out of Memory"; 15435 exc_str = "Out of Memory";
15433 } else if (exception() == isolate->object_store()->stack_overflow()) { 15436 } else if (exception() == isolate->object_store()->stack_overflow()) {
15434 exc_str = "Stack Overflow"; 15437 exc_str = "Stack Overflow";
15435 } else { 15438 } else {
15436 const Instance& exc = Instance::Handle(exception()); 15439 const Instance& exc = Instance::Handle(exception());
15437 strtmp = DartLibraryCalls::ToString(exc); 15440 strtmp = DartLibraryCalls::ToString(exc);
(...skipping 7745 matching lines...) Expand 10 before | Expand all | Expand 10 after
23183 return UserTag::null(); 23186 return UserTag::null();
23184 } 23187 }
23185 23188
23186 23189
23187 const char* UserTag::ToCString() const { 23190 const char* UserTag::ToCString() const {
23188 const String& tag_label = String::Handle(label()); 23191 const String& tag_label = String::Handle(label());
23189 return tag_label.ToCString(); 23192 return tag_label.ToCString();
23190 } 23193 }
23191 23194
23192 } // namespace dart 23195 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698