1361 {
1364 StackZone stack_zone(
thread);
1365 Zone* zone = stack_zone.GetZone();
1366 HandleScope handle_scope(
thread);
1367#if defined(SUPPORT_TIMELINE)
1368 TimelineBeginEndScope tbes(
1369 thread, Timeline::GetIsolateStream(),
1370 message->IsOOB() ?
"HandleOOBMessage" :
"HandleMessage");
1371 tbes.SetNumArguments(1);
1372 tbes.CopyArgument(0,
"isolateName",
I->name());
1373#endif
1374
1375
1377 if (msg_obj.IsError()) {
1378
1379 return ProcessUnhandledException(Error::Cast(msg_obj));
1380 }
1381 if (!msg_obj.IsNull() && !msg_obj.IsInstance()) {
1382
1383
1384
1385
1386
1388 }
1390 msg ^= msg_obj.ptr();
1391
1394
1395
1396
1397 if (msg.IsArray()) {
1398 const Array& oob_msg = Array::Cast(msg);
1399 if (oob_msg.Length() > 0) {
1401 if (oob_tag.IsSmi()) {
1402 switch (Smi::Cast(oob_tag).
Value()) {
1404#ifndef PRODUCT
1405 const Error&
error =
1407 if (!
error.IsNull()) {
1408 status = ProcessUnhandledException(
error);
1409 }
1410#else
1412#endif
1413 break;
1414 }
1417 if (!
error.IsNull()) {
1418 status = ProcessUnhandledException(
error);
1419 }
1420 break;
1421 }
1422#if defined(DEBUG)
1423
1424 default: {
1426 break;
1427 }
1428#endif
1429 }
1430 }
1431 }
1432 }
1433 }
else if (
message->IsFinalizerInvocationRequest()) {
1435 zone,
1437 if (msg_handler.IsError()) {
1438 status = ProcessUnhandledException(Error::Cast(msg_handler));
1439 } else {
1440
1441 }
1443
1444
1445
1446 if (msg.IsArray()) {
1447 const Array& msg_arr = Array::Cast(msg);
1448 if (msg_arr.Length() > 0) {
1450 if (oob_tag.IsSmi() &&
1453 if (!
error.IsNull()) {
1454 status = ProcessUnhandledException(
error);
1455 }
1456 }
1457 }
1458 }
1459 } else {
1462 if (msg_handler.IsError()) {
1463 status = ProcessUnhandledException(Error::Cast(msg_handler));
1464 } else if (msg_handler.IsNull()) {
1465
1466
1467 } else {
1468
1469 }
1470 }
1471 return status;
1472}
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)