| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/service.h" | 5 #include "vm/service.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 | 1578 |
| 1579 class ContainsAddressVisitor : public FindObjectVisitor { | 1579 class ContainsAddressVisitor : public FindObjectVisitor { |
| 1580 public: | 1580 public: |
| 1581 ContainsAddressVisitor(Isolate* isolate, uword addr) | 1581 ContainsAddressVisitor(Isolate* isolate, uword addr) |
| 1582 : FindObjectVisitor(isolate), addr_(addr) { } | 1582 : FindObjectVisitor(isolate), addr_(addr) { } |
| 1583 virtual ~ContainsAddressVisitor() { } | 1583 virtual ~ContainsAddressVisitor() { } |
| 1584 | 1584 |
| 1585 virtual uword filter_addr() const { return addr_; } | 1585 virtual uword filter_addr() const { return addr_; } |
| 1586 | 1586 |
| 1587 virtual bool FindObject(RawObject* obj) const { | 1587 virtual bool FindObject(RawObject* obj) const { |
| 1588 // Free list elements are not real objects, so skip them. |
| 1589 if (obj->IsFreeListElement()) { |
| 1590 return false; |
| 1591 } |
| 1588 uword obj_begin = RawObject::ToAddr(obj); | 1592 uword obj_begin = RawObject::ToAddr(obj); |
| 1589 uword obj_end = obj_begin + obj->Size(); | 1593 uword obj_end = obj_begin + obj->Size(); |
| 1590 return obj_begin <= addr_ && addr_ < obj_end; | 1594 return obj_begin <= addr_ && addr_ < obj_end; |
| 1591 } | 1595 } |
| 1592 private: | 1596 private: |
| 1593 uword addr_; | 1597 uword addr_; |
| 1594 }; | 1598 }; |
| 1595 | 1599 |
| 1596 | 1600 |
| 1597 static bool HandleAddress(Isolate* isolate, JSONStream* js) { | 1601 static bool HandleAddress(Isolate* isolate, JSONStream* js) { |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1899 while (current != NULL) { | 1903 while (current != NULL) { |
| 1900 if (strcmp(name, current->name()) == 0) { | 1904 if (strcmp(name, current->name()) == 0) { |
| 1901 return current; | 1905 return current; |
| 1902 } | 1906 } |
| 1903 current = current->next(); | 1907 current = current->next(); |
| 1904 } | 1908 } |
| 1905 return NULL; | 1909 return NULL; |
| 1906 } | 1910 } |
| 1907 | 1911 |
| 1908 } // namespace dart | 1912 } // namespace dart |
| OLD | NEW |