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

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

Issue 2359283002: Address Siva's DBCs on https://codereview.chromium.org/2350633003/ (Closed)
Patch Set: Created 4 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 | « no previous file | no next file » | 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "lib/stacktrace.h" 10 #include "lib/stacktrace.h"
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 if (!::Dart_IsUnhandledExceptionError(error) && !::Dart_IsNull(error)) { 1479 if (!::Dart_IsUnhandledExceptionError(error) && !::Dart_IsNull(error)) {
1480 FATAL1("%s expects the error to be an unhandled exception error or null.", 1480 FATAL1("%s expects the error to be an unhandled exception error or null.",
1481 CURRENT_FUNC); 1481 CURRENT_FUNC);
1482 } 1482 }
1483 isolate->SetStickyError( 1483 isolate->SetStickyError(
1484 Api::UnwrapErrorHandle(Z, error).raw()); 1484 Api::UnwrapErrorHandle(Z, error).raw());
1485 } 1485 }
1486 1486
1487 1487
1488 DART_EXPORT bool Dart_HasStickyError() { 1488 DART_EXPORT bool Dart_HasStickyError() {
1489 Isolate* isolate = Isolate::Current(); 1489 Thread* T = Thread::Current();
1490 Isolate* isolate = T->isolate();
1490 CHECK_ISOLATE(isolate); 1491 CHECK_ISOLATE(isolate);
1491 NoSafepointScope no_safepoint_scope; 1492 NoSafepointScope no_safepoint_scope;
1492 return isolate->sticky_error() != Error::null(); 1493 return isolate->sticky_error() != Error::null();
1493 } 1494 }
1494 1495
1495 1496
1496 DART_EXPORT Dart_Handle Dart_GetStickyError() { 1497 DART_EXPORT Dart_Handle Dart_GetStickyError() {
1497 Isolate* I = Isolate::Current(); 1498 Thread* T = Thread::Current();
1499 Isolate* I = T->isolate();
1498 CHECK_ISOLATE(I); 1500 CHECK_ISOLATE(I);
1499 NoSafepointScope no_safepoint_scope; 1501 NoSafepointScope no_safepoint_scope;
1500 if (I->sticky_error() != Object::null()) { 1502 if (I->sticky_error() != Error::null()) {
1501 Dart_Handle error = 1503 Dart_Handle error =
1502 Api::NewHandle(Thread::Current(), I->sticky_error()); 1504 Api::NewHandle(T, I->sticky_error());
1503 return error; 1505 return error;
1504 } 1506 }
1505 return Dart_Null(); 1507 return Dart_Null();
1506 } 1508 }
1507 1509
1508 1510
1509 DART_EXPORT void Dart_ExitIsolate() { 1511 DART_EXPORT void Dart_ExitIsolate() {
1510 Thread* T = Thread::Current(); 1512 Thread* T = Thread::Current();
1511 CHECK_ISOLATE(T->isolate()); 1513 CHECK_ISOLATE(T->isolate());
1512 // The Thread structure is disassociated from the isolate, we do the 1514 // The Thread structure is disassociated from the isolate, we do the
(...skipping 5106 matching lines...) Expand 10 before | Expand all | Expand 10 after
6619 6621
6620 DART_EXPORT bool Dart_IsPrecompiledRuntime() { 6622 DART_EXPORT bool Dart_IsPrecompiledRuntime() {
6621 #if defined(DART_PRECOMPILED_RUNTIME) 6623 #if defined(DART_PRECOMPILED_RUNTIME)
6622 return true; 6624 return true;
6623 #else 6625 #else
6624 return false; 6626 return false;
6625 #endif 6627 #endif
6626 } 6628 }
6627 6629
6628 } // namespace dart 6630 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698