1325 {
1328 StackZone stack_zone(
thread);
1329 Zone* zone = stack_zone.GetZone();
1330 HandleScope handle_scope(
thread);
1331#if defined(SUPPORT_TIMELINE)
1332 TimelineBeginEndScope tbes(
1333 thread, Timeline::GetIsolateStream(),
1334 message->IsOOB() ?
"HandleOOBMessage" :
"HandleMessage");
1335 tbes.SetNumArguments(1);
1336 tbes.CopyArgument(0,
"isolateName",
I->name());
1337#endif
1338
1339
1341 if (msg_obj.IsError()) {
1342
1343 return ProcessUnhandledException(Error::Cast(msg_obj));
1344 }
1345 if (!msg_obj.IsNull() && !msg_obj.IsInstance()) {
1346
1347
1348
1349
1350
1352 }
1354 msg ^= msg_obj.ptr();
1355
1358
1359
1360
1361 if (msg.IsArray()) {
1362 const Array& oob_msg = Array::Cast(msg);
1363 if (oob_msg.Length() > 0) {
1365 if (oob_tag.IsSmi()) {
1366 switch (Smi::Cast(oob_tag).
Value()) {
1368#ifndef PRODUCT
1369 const Error&
error =
1371 if (!
error.IsNull()) {
1372 status = ProcessUnhandledException(
error);
1373 }
1374#else
1376#endif
1377 break;
1378 }
1381 if (!
error.IsNull()) {
1382 status = ProcessUnhandledException(
error);
1383 }
1384 break;
1385 }
1386#if defined(DEBUG)
1387
1388 default: {
1390 break;
1391 }
1392#endif
1393 }
1394 }
1395 }
1396 }
1397 }
else if (
message->IsFinalizerInvocationRequest()) {
1399 zone,
1401 if (msg_handler.IsError()) {
1402 status = ProcessUnhandledException(Error::Cast(msg_handler));
1403 } else {
1404
1405 }
1407
1408
1409
1410 if (msg.IsArray()) {
1411 const Array& msg_arr = Array::Cast(msg);
1412 if (msg_arr.Length() > 0) {
1414 if (oob_tag.IsSmi() &&
1417 if (!
error.IsNull()) {
1418 status = ProcessUnhandledException(
error);
1419 }
1420 }
1421 }
1422 }
1423 } else {
1426 if (msg_handler.IsError()) {
1427 status = ProcessUnhandledException(Error::Cast(msg_handler));
1428 } else if (msg_handler.IsNull()) {
1429
1430
1431 } else {
1432
1433 }
1434 }
1435 return status;
1436}
static ObjectPtr HandleMessage(Dart_Port port_id, const Instance &message)
static ObjectPtr HandleFinalizerMessage(const FinalizerBase &finalizer)
bool IsCurrentIsolate() const
@ kDelayedIsolateLibOOBMsg
static const Dart_Port kIllegalPort
static ErrorPtr HandleIsolateMessage(Isolate *isolate, const Array &message)
static Thread * Current()
const uint8_t uint32_t uint32_t GError ** error
ObjectPtr ReadMessage(Thread *thread, Message *message)