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

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

Issue 2863493002: Support BottomType in the VM Kernel reader (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 #if !defined(DART_PRECOMPILED_RUNTIME) 4 #if !defined(DART_PRECOMPILED_RUNTIME)
5 5
6 #include "vm/kernel_binary.h" 6 #include "vm/kernel_binary.h"
7 #include "platform/globals.h" 7 #include "platform/globals.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 #include "vm/kernel.h" 10 #include "vm/kernel.h"
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 DartType* DartType::ReadFrom(Reader* reader) { 1374 DartType* DartType::ReadFrom(Reader* reader) {
1375 TRACE_READ_OFFSET(); 1375 TRACE_READ_OFFSET();
1376 Tag tag = reader->ReadTag(); 1376 Tag tag = reader->ReadTag();
1377 switch (tag) { 1377 switch (tag) {
1378 case kInvalidType: 1378 case kInvalidType:
1379 return InvalidType::ReadFrom(reader); 1379 return InvalidType::ReadFrom(reader);
1380 case kDynamicType: 1380 case kDynamicType:
1381 return DynamicType::ReadFrom(reader); 1381 return DynamicType::ReadFrom(reader);
1382 case kVoidType: 1382 case kVoidType:
1383 return VoidType::ReadFrom(reader); 1383 return VoidType::ReadFrom(reader);
1384 case kBottomType:
1385 return BottomType::ReadFrom(reader);
1384 case kInterfaceType: 1386 case kInterfaceType:
1385 return InterfaceType::ReadFrom(reader); 1387 return InterfaceType::ReadFrom(reader);
1386 case kSimpleInterfaceType: 1388 case kSimpleInterfaceType:
1387 return InterfaceType::ReadFrom(reader, true); 1389 return InterfaceType::ReadFrom(reader, true);
1388 case kFunctionType: 1390 case kFunctionType:
1389 return FunctionType::ReadFrom(reader); 1391 return FunctionType::ReadFrom(reader);
1390 case kSimpleFunctionType: 1392 case kSimpleFunctionType:
1391 return FunctionType::ReadFrom(reader, true); 1393 return FunctionType::ReadFrom(reader, true);
1392 case kTypeParameterType: 1394 case kTypeParameterType:
1393 return TypeParameterType::ReadFrom(reader); 1395 return TypeParameterType::ReadFrom(reader);
(...skipping 20 matching lines...) Expand all
1414 return new DynamicType(); 1416 return new DynamicType();
1415 } 1417 }
1416 1418
1417 1419
1418 VoidType* VoidType::ReadFrom(Reader* reader) { 1420 VoidType* VoidType::ReadFrom(Reader* reader) {
1419 TRACE_READ_OFFSET(); 1421 TRACE_READ_OFFSET();
1420 return new VoidType(); 1422 return new VoidType();
1421 } 1423 }
1422 1424
1423 1425
1426 BottomType* BottomType::ReadFrom(Reader* reader) {
1427 TRACE_READ_OFFSET();
1428 return new BottomType();
1429 }
1430
1431
1424 InterfaceType* InterfaceType::ReadFrom(Reader* reader) { 1432 InterfaceType* InterfaceType::ReadFrom(Reader* reader) {
1425 TRACE_READ_OFFSET(); 1433 TRACE_READ_OFFSET();
1426 intptr_t klass_name = Reference::ReadClassFrom(reader); 1434 intptr_t klass_name = Reference::ReadClassFrom(reader);
1427 InterfaceType* type = new InterfaceType(klass_name); 1435 InterfaceType* type = new InterfaceType(klass_name);
1428 type->type_arguments().ReadFromStatic<DartType>(reader); 1436 type->type_arguments().ReadFromStatic<DartType>(reader);
1429 return type; 1437 return type;
1430 } 1438 }
1431 1439
1432 1440
1433 InterfaceType* InterfaceType::ReadFrom(Reader* reader, 1441 InterfaceType* InterfaceType::ReadFrom(Reader* reader,
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 1588
1581 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, 1589 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer,
1582 intptr_t buffer_length) { 1590 intptr_t buffer_length) {
1583 kernel::Reader reader(buffer, buffer_length); 1591 kernel::Reader reader(buffer, buffer_length);
1584 return kernel::Program::ReadFrom(&reader); 1592 return kernel::Program::ReadFrom(&reader);
1585 } 1593 }
1586 1594
1587 1595
1588 } // namespace dart 1596 } // namespace dart
1589 #endif // !defined(DART_PRECOMPILED_RUNTIME) 1597 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698