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

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

Issue 953973003: - Add a _fatal helper function into dart:core, so that we can (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
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/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 #include "vm/exceptions.h" 9 #include "vm/exceptions.h"
10 #include "vm/heap.h" 10 #include "vm/heap.h"
11 #include "vm/native_entry.h" 11 #include "vm/native_entry.h"
12 #include "vm/object.h" 12 #include "vm/object.h"
13 #include "vm/report.h" 13 #include "vm/report.h"
14 #include "vm/stack_frame.h" 14 #include "vm/stack_frame.h"
15 #include "vm/symbols.h" 15 #include "vm/symbols.h"
16 16
17 namespace dart { 17 namespace dart {
18 18
19 DECLARE_FLAG(bool, enable_type_checks); 19 DECLARE_FLAG(bool, enable_type_checks);
20 DECLARE_FLAG(bool, trace_type_checks); 20 DECLARE_FLAG(bool, trace_type_checks);
21 DECLARE_FLAG(bool, warn_on_javascript_compatibility); 21 DECLARE_FLAG(bool, warn_on_javascript_compatibility);
22 22
23 // Helper function in stacktrace.cc.
24 void _printCurrentStacktrace();
25
26 DEFINE_NATIVE_ENTRY(DartCore_fatal, 1) {
27 // The core library code entered an unrecoverable state.
28 const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0));
29 const char* msg = instance.ToCString();
30 OS::PrintErr("Fatal error in dart:core\n");
31 _printCurrentStacktrace();
32 FATAL(msg);
33 return Object::null();
34 }
35
23 36
24 DEFINE_NATIVE_ENTRY(Object_equals, 1) { 37 DEFINE_NATIVE_ENTRY(Object_equals, 1) {
25 // Implemented in the flow graph builder. 38 // Implemented in the flow graph builder.
26 UNREACHABLE(); 39 UNREACHABLE();
27 return Object::null(); 40 return Object::null();
28 } 41 }
29 42
30 43
31 DEFINE_NATIVE_ENTRY(Object_getHash, 1) { 44 DEFINE_NATIVE_ENTRY(Object_getHash, 1) {
32 const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0)); 45 const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0));
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 // Currently all errors are Dart instances, e.g. I/O errors 313 // Currently all errors are Dart instances, e.g. I/O errors
301 // created by deferred loading code. LanguageErrors from 314 // created by deferred loading code. LanguageErrors from
302 // failed loading or finalization attempts are propagated and result 315 // failed loading or finalization attempts are propagated and result
303 // in the isolate's death. 316 // in the isolate's death.
304 const Instance& error = Instance::Handle(prefix.LoadError()); 317 const Instance& error = Instance::Handle(prefix.LoadError());
305 return error.raw(); 318 return error.raw();
306 } 319 }
307 320
308 321
309 } // namespace dart 322 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698