| 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 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2594 // TODO(koda): Rename these methods SetHostUint64, etc. | 2594 // TODO(koda): Rename these methods SetHostUint64, etc. |
| 2595 message.SetUint64(0, Utils::HostToBigEndian64(meta_bytes)); | 2595 message.SetUint64(0, Utils::HostToBigEndian64(meta_bytes)); |
| 2596 offset += sizeof(uint64_t); | 2596 offset += sizeof(uint64_t); |
| 2597 { | 2597 { |
| 2598 NoGCScope no_gc; | 2598 NoGCScope no_gc; |
| 2599 meta.ToUTF8(static_cast<uint8_t*>(message.DataAddr(offset)), meta_bytes); | 2599 meta.ToUTF8(static_cast<uint8_t*>(message.DataAddr(offset)), meta_bytes); |
| 2600 offset += meta_bytes; | 2600 offset += meta_bytes; |
| 2601 } | 2601 } |
| 2602 // TODO(koda): It would be nice to avoid this copy (requires changes to | 2602 // TODO(koda): It would be nice to avoid this copy (requires changes to |
| 2603 // MessageWriter code). | 2603 // MessageWriter code). |
| 2604 memmove(message.DataAddr(offset), data, size); | 2604 { |
| 2605 offset += size; | 2605 NoGCScope no_gc; |
| 2606 memmove(message.DataAddr(offset), data, size); |
| 2607 offset += size; |
| 2608 } |
| 2606 ASSERT(offset == total_bytes); | 2609 ASSERT(offset == total_bytes); |
| 2607 SendEvent(eventId, message); | 2610 SendEvent(eventId, message); |
| 2608 } | 2611 } |
| 2609 | 2612 |
| 2610 | 2613 |
| 2611 void Service::HandleGCEvent(GCEvent* event) { | 2614 void Service::HandleGCEvent(GCEvent* event) { |
| 2612 JSONStream js; | 2615 JSONStream js; |
| 2613 event->PrintJSON(&js); | 2616 event->PrintJSON(&js); |
| 2614 const String& message = String::Handle(String::New(js.ToCString())); | 2617 const String& message = String::Handle(String::New(js.ToCString())); |
| 2615 SendEvent(kEventFamilyGC, message); | 2618 SendEvent(kEventFamilyGC, message); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2713 while (current != NULL) { | 2716 while (current != NULL) { |
| 2714 if (strcmp(name, current->name()) == 0) { | 2717 if (strcmp(name, current->name()) == 0) { |
| 2715 return current; | 2718 return current; |
| 2716 } | 2719 } |
| 2717 current = current->next(); | 2720 current = current->next(); |
| 2718 } | 2721 } |
| 2719 return NULL; | 2722 return NULL; |
| 2720 } | 2723 } |
| 2721 | 2724 |
| 2722 } // namespace dart | 2725 } // namespace dart |
| OLD | NEW |