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 9510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9521 NoGCScope no_gc; | 9521 NoGCScope no_gc; |
9522 result ^= raw; | 9522 result ^= raw; |
9523 result.set_num_variables(num_variables); | 9523 result.set_num_variables(num_variables); |
9524 } | 9524 } |
9525 result.set_isolate(Isolate::Current()); | 9525 result.set_isolate(Isolate::Current()); |
9526 return result.raw(); | 9526 return result.raw(); |
9527 } | 9527 } |
9528 | 9528 |
9529 | 9529 |
9530 const char* Context::ToCString() const { | 9530 const char* Context::ToCString() const { |
| 9531 if (IsNull()) { |
| 9532 return "Context (Null)"; |
| 9533 } |
9531 const Context& parent_ctx = Context::Handle(parent()); | 9534 const Context& parent_ctx = Context::Handle(parent()); |
9532 if (parent_ctx.IsNull()) { | 9535 if (parent_ctx.IsNull()) { |
9533 const char* kFormat = "Context num_variables:% " Pd ""; | 9536 const char* kFormat = "Context num_variables:% " Pd ""; |
9534 intptr_t len = OS::SNPrint(NULL, 0, kFormat, num_variables()) + 1; | 9537 intptr_t len = OS::SNPrint(NULL, 0, kFormat, num_variables()) + 1; |
9535 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 9538 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
9536 OS::SNPrint(chars, len, kFormat, num_variables()); | 9539 OS::SNPrint(chars, len, kFormat, num_variables()); |
9537 return chars; | 9540 return chars; |
9538 } else { | 9541 } else { |
9539 const char* parent_str = parent_ctx.ToCString(); | 9542 const char* parent_str = parent_ctx.ToCString(); |
9540 const char* kFormat = "Context num_variables:% " Pd " parent:{ %s }"; | 9543 const char* kFormat = "Context num_variables:% " Pd " parent:{ %s }"; |
(...skipping 5942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15483 return "_MirrorReference"; | 15486 return "_MirrorReference"; |
15484 } | 15487 } |
15485 | 15488 |
15486 | 15489 |
15487 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 15490 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
15488 JSONObject jsobj(stream); | 15491 JSONObject jsobj(stream); |
15489 } | 15492 } |
15490 | 15493 |
15491 | 15494 |
15492 } // namespace dart | 15495 } // namespace dart |
OLD | NEW |