OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 9529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9540 NoGCScope no_gc; | 9540 NoGCScope no_gc; |
9541 result ^= raw; | 9541 result ^= raw; |
9542 result.set_num_variables(num_variables); | 9542 result.set_num_variables(num_variables); |
9543 } | 9543 } |
9544 result.set_isolate(Isolate::Current()); | 9544 result.set_isolate(Isolate::Current()); |
9545 return result.raw(); | 9545 return result.raw(); |
9546 } | 9546 } |
9547 | 9547 |
9548 | 9548 |
9549 const char* Context::ToCString() const { | 9549 const char* Context::ToCString() const { |
| 9550 if (IsNull()) { |
| 9551 return "Context (Null)"; |
| 9552 } |
9550 const Context& parent_ctx = Context::Handle(parent()); | 9553 const Context& parent_ctx = Context::Handle(parent()); |
9551 if (parent_ctx.IsNull()) { | 9554 if (parent_ctx.IsNull()) { |
9552 const char* kFormat = "Context num_variables:% " Pd ""; | 9555 const char* kFormat = "Context num_variables:% " Pd ""; |
9553 intptr_t len = OS::SNPrint(NULL, 0, kFormat, num_variables()) + 1; | 9556 intptr_t len = OS::SNPrint(NULL, 0, kFormat, num_variables()) + 1; |
9554 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 9557 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
9555 OS::SNPrint(chars, len, kFormat, num_variables()); | 9558 OS::SNPrint(chars, len, kFormat, num_variables()); |
9556 return chars; | 9559 return chars; |
9557 } else { | 9560 } else { |
9558 const char* parent_str = parent_ctx.ToCString(); | 9561 const char* parent_str = parent_ctx.ToCString(); |
9559 const char* kFormat = "Context num_variables:% " Pd " parent:{ %s }"; | 9562 const char* kFormat = "Context num_variables:% " Pd " parent:{ %s }"; |
(...skipping 5942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15502 return "_MirrorReference"; | 15505 return "_MirrorReference"; |
15503 } | 15506 } |
15504 | 15507 |
15505 | 15508 |
15506 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 15509 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
15507 JSONObject jsobj(stream); | 15510 JSONObject jsobj(stream); |
15508 } | 15511 } |
15509 | 15512 |
15510 | 15513 |
15511 } // namespace dart | 15514 } // namespace dart |
OLD | NEW |