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

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

Issue 1864143002: Add instruction tags to saved ICData (debug mode only). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « runtime/vm/raw_object.h ('k') | 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) 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/native_entry.h" 5 #include "vm/native_entry.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/stub_code.h" 9 #include "vm/stub_code.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after
1965 intptr_t tags, 1965 intptr_t tags,
1966 Snapshot::Kind kind, 1966 Snapshot::Kind kind,
1967 bool as_reference) { 1967 bool as_reference) {
1968 ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull)); 1968 ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
1969 1969
1970 ICData& result = ICData::ZoneHandle(reader->zone(), NEW_OBJECT(ICData)); 1970 ICData& result = ICData::ZoneHandle(reader->zone(), NEW_OBJECT(ICData));
1971 reader->AddBackRef(object_id, &result, kIsDeserialized); 1971 reader->AddBackRef(object_id, &result, kIsDeserialized);
1972 1972
1973 result.set_deopt_id(reader->Read<int32_t>()); 1973 result.set_deopt_id(reader->Read<int32_t>());
1974 result.set_state_bits(reader->Read<uint32_t>()); 1974 result.set_state_bits(reader->Read<uint32_t>());
1975 #if defined(TAG_IC_DATA)
1976 result.set_tag(reader->Read<int16_t>());
1977 #endif
1975 1978
1976 // Set all the object fields. 1979 // Set all the object fields.
1977 RawObject** toobj = reader->snapshot_code() 1980 RawObject** toobj = reader->snapshot_code()
1978 ? result.raw()->to_precompiled_snapshot() 1981 ? result.raw()->to_precompiled_snapshot()
1979 : result.raw()->to(); 1982 : result.raw()->to();
1980 READ_OBJECT_FIELDS(result, 1983 READ_OBJECT_FIELDS(result,
1981 result.raw()->from(), toobj, 1984 result.raw()->from(), toobj,
1982 kAsReference); 1985 kAsReference);
1983 if (reader->snapshot_code()) { 1986 if (reader->snapshot_code()) {
1984 result.set_owner(Function::Handle(reader->zone())); 1987 result.set_owner(Function::Handle(reader->zone()));
(...skipping 12 matching lines...) Expand all
1997 // Write out the serialization header value for this object. 2000 // Write out the serialization header value for this object.
1998 writer->WriteInlinedObjectHeader(object_id); 2001 writer->WriteInlinedObjectHeader(object_id);
1999 2002
2000 // Write out the class and tags information. 2003 // Write out the class and tags information.
2001 writer->WriteVMIsolateObject(kICDataCid); 2004 writer->WriteVMIsolateObject(kICDataCid);
2002 writer->WriteTags(writer->GetObjectTags(this)); 2005 writer->WriteTags(writer->GetObjectTags(this));
2003 2006
2004 // Write out all the non object fields. 2007 // Write out all the non object fields.
2005 writer->Write<int32_t>(ptr()->deopt_id_); 2008 writer->Write<int32_t>(ptr()->deopt_id_);
2006 writer->Write<uint32_t>(ptr()->state_bits_); 2009 writer->Write<uint32_t>(ptr()->state_bits_);
2010 #if defined(TAG_IC_DATA)
2011 writer->Write<int16_t>(ptr()->tag_);
2012 #endif
2007 2013
2008 // Write out all the object pointer fields. 2014 // Write out all the object pointer fields.
2009 // In precompiled snapshots, omit the owner field. The owner field may 2015 // In precompiled snapshots, omit the owner field. The owner field may
2010 // refer to a function which was always inlined and no longer needed. 2016 // refer to a function which was always inlined and no longer needed.
2011 SnapshotWriterVisitor visitor(writer, kAsReference); 2017 SnapshotWriterVisitor visitor(writer, kAsReference);
2012 RawObject** toobj = writer->snapshot_code() ? to_precompiled_snapshot() 2018 RawObject** toobj = writer->snapshot_code() ? to_precompiled_snapshot()
2013 : to(); 2019 : to();
2014 visitor.VisitPointers(from(), toobj); 2020 visitor.VisitPointers(from(), toobj);
2015 } 2021 }
2016 2022
(...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after
3694 // We do not allow objects with native fields in an isolate message. 3700 // We do not allow objects with native fields in an isolate message.
3695 writer->SetWriteException(Exceptions::kArgument, 3701 writer->SetWriteException(Exceptions::kArgument,
3696 "Illegal argument in isolate message" 3702 "Illegal argument in isolate message"
3697 " : (object is a UserTag)"); 3703 " : (object is a UserTag)");
3698 } else { 3704 } else {
3699 UNREACHABLE(); 3705 UNREACHABLE();
3700 } 3706 }
3701 } 3707 }
3702 3708
3703 } // namespace dart 3709 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698