| 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 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 return true; | 1534 return true; |
| 1535 } | 1535 } |
| 1536 if (obj.IsFunction()) { | 1536 if (obj.IsFunction()) { |
| 1537 const Function& func = Function::Cast(obj); | 1537 const Function& func = Function::Cast(obj); |
| 1538 const GrowableObjectArray& ics = | 1538 const GrowableObjectArray& ics = |
| 1539 GrowableObjectArray::Handle(func.CollectICsWithSourcePositions()); | 1539 GrowableObjectArray::Handle(func.CollectICsWithSourcePositions()); |
| 1540 JSONObject jsobj(js); | 1540 JSONObject jsobj(js); |
| 1541 jsobj.AddProperty("type", "_CallSiteData"); | 1541 jsobj.AddProperty("type", "_CallSiteData"); |
| 1542 jsobj.AddProperty("function", func); | 1542 jsobj.AddProperty("function", func); |
| 1543 JSONArray elements(&jsobj, "callSites"); | 1543 JSONArray elements(&jsobj, "callSites"); |
| 1544 Smi& line = Smi::Handle(); | |
| 1545 Smi& column = Smi::Handle(); | |
| 1546 ICData& ic_data = ICData::Handle(); | 1544 ICData& ic_data = ICData::Handle(); |
| 1545 Smi& token_pos = Smi::Handle(); |
| 1547 for (intptr_t i = 0; i < ics.Length();) { | 1546 for (intptr_t i = 0; i < ics.Length();) { |
| 1548 ic_data ^= ics.At(i++); | 1547 ic_data ^= ics.At(i++); |
| 1549 line ^= ics.At(i++); | 1548 token_pos ^= ics.At(i++); |
| 1550 column ^= ics.At(i++); | 1549 ic_data.PrintToJSONArray(&elements, token_pos.Value()); |
| 1551 ic_data.PrintToJSONArray(&elements, line.Value(), column.Value()); | |
| 1552 } | 1550 } |
| 1553 return true; | 1551 return true; |
| 1554 } | 1552 } |
| 1555 return false; | 1553 return false; |
| 1556 } | 1554 } |
| 1557 | 1555 |
| 1558 | 1556 |
| 1559 class GetInstancesVisitor : public ObjectGraph::Visitor { | 1557 class GetInstancesVisitor : public ObjectGraph::Visitor { |
| 1560 public: | 1558 public: |
| 1561 GetInstancesVisitor(const Class& cls, const Array& storage) | 1559 GetInstancesVisitor(const Class& cls, const Array& storage) |
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2570 ServiceMethodDescriptor& method = service_methods_[i]; | 2568 ServiceMethodDescriptor& method = service_methods_[i]; |
| 2571 if (strcmp(method_name, method.name) == 0) { | 2569 if (strcmp(method_name, method.name) == 0) { |
| 2572 return &method; | 2570 return &method; |
| 2573 } | 2571 } |
| 2574 } | 2572 } |
| 2575 return NULL; | 2573 return NULL; |
| 2576 } | 2574 } |
| 2577 | 2575 |
| 2578 | 2576 |
| 2579 } // namespace dart | 2577 } // namespace dart |
| OLD | NEW |