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

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

Issue 93873014: Update isolate documentation. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add isolateMessageException Created 7 years 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) 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/snapshot.h" 5 #include "vm/snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 // Write out the individual object ids. 1358 // Write out the individual object ids.
1359 for (intptr_t i = 0; i < len; i++) { 1359 for (intptr_t i = 0; i < len; i++) {
1360 WriteObjectRef(data[i]); 1360 WriteObjectRef(data[i]);
1361 } 1361 }
1362 } 1362 }
1363 1363
1364 1364
1365 void SnapshotWriter::CheckIfSerializable(RawClass* cls) { 1365 void SnapshotWriter::CheckIfSerializable(RawClass* cls) {
1366 if (Class::IsSignatureClass(cls)) { 1366 if (Class::IsSignatureClass(cls)) {
1367 // We do not allow closure objects in an isolate message. 1367 // We do not allow closure objects in an isolate message.
1368 SetWriteException(Exceptions::kArgument, 1368 SetWriteException(Exceptions::kIsolateMessage,
1369 "Illegal argument in isolate message" 1369 "Illegal argument in isolate message"
1370 " : (object is a closure)"); 1370 " : (object is a closure)");
1371 } 1371 }
1372 if (cls->ptr()->num_native_fields_ != 0) { 1372 if (cls->ptr()->num_native_fields_ != 0) {
1373 // We do not allow objects with native fields in an isolate message. 1373 // We do not allow objects with native fields in an isolate message.
1374 SetWriteException(Exceptions::kArgument, 1374 SetWriteException(Exceptions::kIsolateMessage,
1375 "Illegal argument in isolate message" 1375 "Illegal argument in isolate message"
1376 " : (object extends NativeWrapper)"); 1376 " : (object extends NativeWrapper)");
1377 } 1377 }
1378 } 1378 }
1379 1379
1380 1380
1381 void SnapshotWriter::SetWriteException(Exceptions::ExceptionType type, 1381 void SnapshotWriter::SetWriteException(Exceptions::ExceptionType type,
1382 const char* msg) { 1382 const char* msg) {
1383 set_exception_type(type); 1383 set_exception_type(type);
1384 set_exception_msg(msg); 1384 set_exception_msg(msg);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 UnmarkAll(); 1516 UnmarkAll();
1517 isolate->set_long_jump_base(base); 1517 isolate->set_long_jump_base(base);
1518 } else { 1518 } else {
1519 isolate->set_long_jump_base(base); 1519 isolate->set_long_jump_base(base);
1520 ThrowException(exception_type(), exception_msg()); 1520 ThrowException(exception_type(), exception_msg());
1521 } 1521 }
1522 } 1522 }
1523 1523
1524 1524
1525 } // namespace dart 1525 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698