OLD | NEW |
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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 reader->offset() - 1; // -1 to include tag byte. | 514 reader->offset() - 1; // -1 to include tag byte. |
515 return invalid_expression; | 515 return invalid_expression; |
516 } | 516 } |
517 | 517 |
518 | 518 |
519 VariableGet* VariableGet::ReadFrom(Reader* reader) { | 519 VariableGet* VariableGet::ReadFrom(Reader* reader) { |
520 TRACE_READ_OFFSET(); | 520 TRACE_READ_OFFSET(); |
521 VariableGet* get = new VariableGet(); | 521 VariableGet* get = new VariableGet(); |
522 get->kernel_offset_ = reader->offset() - 1; // -1 to include tag byte. | 522 get->kernel_offset_ = reader->offset() - 1; // -1 to include tag byte. |
523 get->position_ = reader->ReadPosition(); | 523 get->position_ = reader->ReadPosition(); |
| 524 get->variable_kernel_offset_ = reader->ReadUInt(); |
524 get->variable_ = reader->helper()->variables().Lookup(reader->ReadUInt()); | 525 get->variable_ = reader->helper()->variables().Lookup(reader->ReadUInt()); |
| 526 ASSERT(get->variable_->kernel_offset() == get->variable_kernel_offset_); |
525 reader->ReadOptional<DartType>(); // Unused promoted type. | 527 reader->ReadOptional<DartType>(); // Unused promoted type. |
526 return get; | 528 return get; |
527 } | 529 } |
528 | 530 |
529 | 531 |
530 VariableGet* VariableGet::ReadFrom(Reader* reader, uint8_t payload) { | 532 VariableGet* VariableGet::ReadFrom(Reader* reader, uint8_t payload) { |
531 TRACE_READ_OFFSET(); | 533 TRACE_READ_OFFSET(); |
532 VariableGet* get = new VariableGet(); | 534 VariableGet* get = new VariableGet(); |
533 get->kernel_offset_ = reader->offset() - 1; // -1 to include tag byte. | 535 get->kernel_offset_ = reader->offset() - 1; // -1 to include tag byte. |
534 get->position_ = reader->ReadPosition(); | 536 get->position_ = reader->ReadPosition(); |
| 537 get->variable_kernel_offset_ = reader->ReadUInt(); |
535 get->variable_ = reader->helper()->variables().Lookup(payload); | 538 get->variable_ = reader->helper()->variables().Lookup(payload); |
| 539 ASSERT(get->variable_->kernel_offset() == get->variable_kernel_offset_); |
536 return get; | 540 return get; |
537 } | 541 } |
538 | 542 |
539 | 543 |
540 VariableSet* VariableSet::ReadFrom(Reader* reader) { | 544 VariableSet* VariableSet::ReadFrom(Reader* reader) { |
541 TRACE_READ_OFFSET(); | 545 TRACE_READ_OFFSET(); |
542 VariableSet* set = new VariableSet(); | 546 VariableSet* set = new VariableSet(); |
543 set->kernel_offset_ = reader->offset() - 1; // -1 to include tag byte. | 547 set->kernel_offset_ = reader->offset() - 1; // -1 to include tag byte. |
544 set->position_ = reader->ReadPosition(); | 548 set->position_ = reader->ReadPosition(); |
545 set->variable_ = reader->helper()->variables().Lookup(reader->ReadUInt()); | 549 set->variable_ = reader->helper()->variables().Lookup(reader->ReadUInt()); |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 | 1462 |
1459 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 1463 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
1460 intptr_t buffer_length) { | 1464 intptr_t buffer_length) { |
1461 kernel::Reader reader(buffer, buffer_length); | 1465 kernel::Reader reader(buffer, buffer_length); |
1462 return kernel::Program::ReadFrom(&reader); | 1466 return kernel::Program::ReadFrom(&reader); |
1463 } | 1467 } |
1464 | 1468 |
1465 | 1469 |
1466 } // namespace dart | 1470 } // namespace dart |
1467 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1471 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |