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

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

Issue 132163005: Version 1.1.0-dev.5.7 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/disassembler.h ('k') | runtime/vm/disassembler_ia32.cc » ('j') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/disassembler.h" 5 #include "vm/disassembler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/json_stream.h" 10 #include "vm/json_stream.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (p[i] == '\n' || p[i] == '\r') { 66 if (p[i] == '\n' || p[i] == '\r') {
67 p[i] = ' '; 67 p[i] = ' ';
68 } 68 }
69 } 69 }
70 JSONObject jsobj(&jsarr_); 70 JSONObject jsobj(&jsarr_);
71 jsobj.AddProperty("type", "DisassembledInstructionComment"); 71 jsobj.AddProperty("type", "DisassembledInstructionComment");
72 jsobj.AddProperty("comment", p); 72 jsobj.AddProperty("comment", p);
73 free(p); 73 free(p);
74 } 74 }
75 75
76
77 class FindAddrVisitor : public FindObjectVisitor {
78 public:
79 explicit FindAddrVisitor(uword addr)
80 : FindObjectVisitor(Isolate::Current()), addr_(addr) { }
81 virtual ~FindAddrVisitor() { }
82
83 virtual uword filter_addr() const { return addr_; }
84
85 // Check if object matches find condition.
86 virtual bool FindObject(RawObject* obj) const {
87 return obj == reinterpret_cast<RawObject*>(addr_);
88 }
89
90 private:
91 const uword addr_;
92
93 DISALLOW_COPY_AND_ASSIGN(FindAddrVisitor);
94 };
95
96
97 bool Disassembler::CanFindOldObject(uword addr) {
98 FindAddrVisitor visitor(addr);
99 return Isolate::Current()->heap()->FindOldObject(&visitor) != Object::null();
100 }
101
76 } // namespace dart 102 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/disassembler.h ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698