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

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

Issue 2981573002: [vm] Get a reference backtrace if we encounter disabled code when writing an AOT snapshot. (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4
5 #include "vm/clustered_snapshot.h" 5 #include "vm/clustered_snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 intptr_t count = objects_.length(); 1592 intptr_t count = objects_.length();
1593 for (intptr_t i = 0; i < count; i++) { 1593 for (intptr_t i = 0; i < count; i++) {
1594 RawCode* code = objects_[i]; 1594 RawCode* code = objects_[i];
1595 1595
1596 intptr_t pointer_offsets_length = 1596 intptr_t pointer_offsets_length =
1597 Code::PtrOffBits::decode(code->ptr()->state_bits_); 1597 Code::PtrOffBits::decode(code->ptr()->state_bits_);
1598 if (pointer_offsets_length != 0) { 1598 if (pointer_offsets_length != 0) {
1599 FATAL("Cannot serialize code with embedded pointers"); 1599 FATAL("Cannot serialize code with embedded pointers");
1600 } 1600 }
1601 if (kind == Snapshot::kFullAOT) { 1601 if (kind == Snapshot::kFullAOT) {
1602 // No disabled code in precompilation. 1602 if (code->ptr()->instructions_ != code->ptr()->active_instructions_) {
1603 NOT_IN_PRECOMPILED(ASSERT(code->ptr()->instructions_ == 1603 s->UnexpectedObject(code, "Disabled code");
1604 code->ptr()->active_instructions_)); 1604 }
1605 } 1605 }
1606 1606
1607 RawInstructions* instr = code->ptr()->instructions_; 1607 RawInstructions* instr = code->ptr()->instructions_;
1608 int32_t text_offset = s->GetTextOffset(instr, code); 1608 int32_t text_offset = s->GetTextOffset(instr, code);
1609 s->Write<int32_t>(text_offset); 1609 s->Write<int32_t>(text_offset);
1610 if (s->kind() == Snapshot::kFullJIT) { 1610 if (s->kind() == Snapshot::kFullJIT) {
1611 // TODO(rmacnak): Fix references to disabled code before serializing. 1611 // TODO(rmacnak): Fix references to disabled code before serializing.
1612 if (code->ptr()->active_instructions_ != code->ptr()->instructions_) { 1612 if (code->ptr()->active_instructions_ != code->ptr()->instructions_) {
1613 instr = code->ptr()->active_instructions_; 1613 instr = code->ptr()->active_instructions_;
1614 text_offset = s->GetTextOffset(instr, code); 1614 text_offset = s->GetTextOffset(instr, code);
(...skipping 4027 matching lines...) Expand 10 before | Expand all | Expand 10 after
5642 thread_->isolate()->SetupImagePage(data_buffer_, 5642 thread_->isolate()->SetupImagePage(data_buffer_,
5643 /* is_executable */ false); 5643 /* is_executable */ false);
5644 } 5644 }
5645 5645
5646 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); 5646 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store());
5647 5647
5648 return ApiError::null(); 5648 return ApiError::null();
5649 } 5649 }
5650 5650
5651 } // namespace dart 5651 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698