| OLD | NEW |
| 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/bigint_operations.h" | 5 #include "vm/bigint_operations.h" |
| 6 #include "vm/object.h" | 6 #include "vm/object.h" |
| 7 #include "vm/object_store.h" | 7 #include "vm/object_store.h" |
| 8 #include "vm/snapshot.h" | 8 #include "vm/snapshot.h" |
| 9 #include "vm/visitor.h" | 9 #include "vm/visitor.h" |
| 10 | 10 |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 func.set_token_index(reader->ReadIntptrValue()); | 425 func.set_token_index(reader->ReadIntptrValue()); |
| 426 func.set_end_token_index(reader->ReadIntptrValue()); | 426 func.set_end_token_index(reader->ReadIntptrValue()); |
| 427 func.set_num_fixed_parameters(reader->ReadIntptrValue()); | 427 func.set_num_fixed_parameters(reader->ReadIntptrValue()); |
| 428 func.set_num_optional_parameters(reader->ReadIntptrValue()); | 428 func.set_num_optional_parameters(reader->ReadIntptrValue()); |
| 429 func.set_usage_counter(reader->ReadIntptrValue()); | 429 func.set_usage_counter(reader->ReadIntptrValue()); |
| 430 func.set_deoptimization_counter(reader->ReadIntptrValue()); | 430 func.set_deoptimization_counter(reader->ReadIntptrValue()); |
| 431 func.set_kind(static_cast<RawFunction::Kind >(reader->ReadIntptrValue())); | 431 func.set_kind(static_cast<RawFunction::Kind >(reader->ReadIntptrValue())); |
| 432 func.set_is_static(reader->Read<bool>()); | 432 func.set_is_static(reader->Read<bool>()); |
| 433 func.set_is_const(reader->Read<bool>()); | 433 func.set_is_const(reader->Read<bool>()); |
| 434 func.set_is_optimizable(reader->Read<bool>()); | 434 func.set_is_optimizable(reader->Read<bool>()); |
| 435 func.set_is_native(reader->Read<bool>()); |
| 435 | 436 |
| 436 // Set all the object fields. | 437 // Set all the object fields. |
| 437 // TODO(5411462): Need to assert No GC can happen here, even though | 438 // TODO(5411462): Need to assert No GC can happen here, even though |
| 438 // allocations may happen. | 439 // allocations may happen. |
| 439 intptr_t num_flds = (func.raw()->to() - func.raw()->from()); | 440 intptr_t num_flds = (func.raw()->to() - func.raw()->from()); |
| 440 for (intptr_t i = 0; i <= num_flds; i++) { | 441 for (intptr_t i = 0; i <= num_flds; i++) { |
| 441 *(func.raw()->from() + i) = reader->ReadObjectRef(); | 442 *(func.raw()->from() + i) = reader->ReadObjectRef(); |
| 442 } | 443 } |
| 443 | 444 |
| 444 return func.raw(); | 445 return func.raw(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 463 writer->WriteIntptrValue(ptr()->token_index_); | 464 writer->WriteIntptrValue(ptr()->token_index_); |
| 464 writer->WriteIntptrValue(ptr()->end_token_index_); | 465 writer->WriteIntptrValue(ptr()->end_token_index_); |
| 465 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); | 466 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); |
| 466 writer->WriteIntptrValue(ptr()->num_optional_parameters_); | 467 writer->WriteIntptrValue(ptr()->num_optional_parameters_); |
| 467 writer->WriteIntptrValue(ptr()->usage_counter_); | 468 writer->WriteIntptrValue(ptr()->usage_counter_); |
| 468 writer->WriteIntptrValue(ptr()->deoptimization_counter_); | 469 writer->WriteIntptrValue(ptr()->deoptimization_counter_); |
| 469 writer->WriteIntptrValue(ptr()->kind_); | 470 writer->WriteIntptrValue(ptr()->kind_); |
| 470 writer->Write<bool>(ptr()->is_static_); | 471 writer->Write<bool>(ptr()->is_static_); |
| 471 writer->Write<bool>(ptr()->is_const_); | 472 writer->Write<bool>(ptr()->is_const_); |
| 472 writer->Write<bool>(ptr()->is_optimizable_); | 473 writer->Write<bool>(ptr()->is_optimizable_); |
| 474 writer->Write<bool>(ptr()->is_native_); |
| 473 | 475 |
| 474 // Write out all the object pointer fields. | 476 // Write out all the object pointer fields. |
| 475 SnapshotWriterVisitor visitor(writer); | 477 SnapshotWriterVisitor visitor(writer); |
| 476 visitor.VisitPointers(from(), to()); | 478 visitor.VisitPointers(from(), to()); |
| 477 } | 479 } |
| 478 | 480 |
| 479 | 481 |
| 480 RawField* Field::ReadFrom(SnapshotReader* reader, | 482 RawField* Field::ReadFrom(SnapshotReader* reader, |
| 481 intptr_t object_id, | 483 intptr_t object_id, |
| 482 intptr_t tags, | 484 intptr_t tags, |
| (...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1967 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); | 1969 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); |
| 1968 writer->WriteObjectImpl(ptr()->pattern_); | 1970 writer->WriteObjectImpl(ptr()->pattern_); |
| 1969 writer->WriteIntptrValue(ptr()->type_); | 1971 writer->WriteIntptrValue(ptr()->type_); |
| 1970 writer->WriteIntptrValue(ptr()->flags_); | 1972 writer->WriteIntptrValue(ptr()->flags_); |
| 1971 | 1973 |
| 1972 // Do not write out the data part which is native. | 1974 // Do not write out the data part which is native. |
| 1973 } | 1975 } |
| 1974 | 1976 |
| 1975 | 1977 |
| 1976 } // namespace dart | 1978 } // namespace dart |
| OLD | NEW |