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

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

Issue 1389353004: Remove isolate argument from handle allocation: Part II (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: c Created 5 years, 2 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/flow_graph_inliner.cc ('k') | runtime/vm/message.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) 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 "platform/assert.h" 5 #include "platform/assert.h"
6 6
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/debugger.h" 8 #include "vm/debugger.h"
9 #include "vm/json_stream.h" 9 #include "vm/json_stream.h"
10 #include "vm/message.h" 10 #include "vm/message.h"
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 location.AddProperty("tokenPos", token_pos); 728 location.AddProperty("tokenPos", token_pos);
729 if (end_token_pos >= 0) { 729 if (end_token_pos >= 0) {
730 location.AddProperty("endTokenPos", end_token_pos); 730 location.AddProperty("endTokenPos", end_token_pos);
731 } 731 }
732 } 732 }
733 733
734 734
735 void JSONObject::AddLocation(const BreakpointLocation* bpt_loc) const { 735 void JSONObject::AddLocation(const BreakpointLocation* bpt_loc) const {
736 ASSERT(bpt_loc->IsResolved()); 736 ASSERT(bpt_loc->IsResolved());
737 737
738 Isolate* isolate = Isolate::Current(); 738 Zone* zone = Thread::Current()->zone();
739 Library& library = Library::Handle(isolate); 739 Library& library = Library::Handle(zone);
740 Script& script = Script::Handle(isolate); 740 Script& script = Script::Handle(zone);
741 intptr_t token_pos; 741 intptr_t token_pos;
742 bpt_loc->GetCodeLocation(&library, &script, &token_pos); 742 bpt_loc->GetCodeLocation(&library, &script, &token_pos);
743 AddLocation(script, token_pos); 743 AddLocation(script, token_pos);
744 } 744 }
745 745
746 746
747 void JSONObject::AddUnresolvedLocation( 747 void JSONObject::AddUnresolvedLocation(
748 const BreakpointLocation* bpt_loc) const { 748 const BreakpointLocation* bpt_loc) const {
749 ASSERT(!bpt_loc->IsResolved()); 749 ASSERT(!bpt_loc->IsResolved());
750 750
751 Isolate* isolate = Isolate::Current(); 751 Zone* zone = Thread::Current()->zone();
752 Library& library = Library::Handle(isolate); 752 Library& library = Library::Handle(zone);
753 Script& script = Script::Handle(isolate); 753 Script& script = Script::Handle(zone);
754 intptr_t token_pos; 754 intptr_t token_pos;
755 bpt_loc->GetCodeLocation(&library, &script, &token_pos); 755 bpt_loc->GetCodeLocation(&library, &script, &token_pos);
756 756
757 JSONObject location(this, "location"); 757 JSONObject location(this, "location");
758 location.AddProperty("type", "UnresolvedSourceLocation"); 758 location.AddProperty("type", "UnresolvedSourceLocation");
759 if (!script.IsNull()) { 759 if (!script.IsNull()) {
760 location.AddProperty("script", script); 760 location.AddProperty("script", script);
761 } else { 761 } else {
762 const String& scriptUri = String::Handle(isolate, bpt_loc->url()); 762 const String& scriptUri = String::Handle(zone, bpt_loc->url());
763 location.AddPropertyStr("scriptUri", scriptUri); 763 location.AddPropertyStr("scriptUri", scriptUri);
764 } 764 }
765 if (bpt_loc->requested_line_number() >= 0) { 765 if (bpt_loc->requested_line_number() >= 0) {
766 // This unresolved breakpoint was specified at a particular line. 766 // This unresolved breakpoint was specified at a particular line.
767 location.AddProperty("line", bpt_loc->requested_line_number()); 767 location.AddProperty("line", bpt_loc->requested_line_number());
768 if (bpt_loc->requested_column_number() >= 0) { 768 if (bpt_loc->requested_column_number() >= 0) {
769 location.AddProperty("column", 769 location.AddProperty("column",
770 bpt_loc->requested_column_number()); 770 bpt_loc->requested_column_number());
771 } 771 }
772 } else { 772 } else {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); 806 intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
807 va_end(args); 807 va_end(args);
808 ASSERT(len == len2); 808 ASSERT(len == len2);
809 stream_->buffer_.AddChar('"'); 809 stream_->buffer_.AddChar('"');
810 stream_->AddEscapedUTF8String(p); 810 stream_->AddEscapedUTF8String(p);
811 stream_->buffer_.AddChar('"'); 811 stream_->buffer_.AddChar('"');
812 free(p); 812 free(p);
813 } 813 }
814 814
815 } // namespace dart 815 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698