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 20832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20843 const String& str = String::Handle(pattern()); | 20843 const String& str = String::Handle(pattern()); |
20844 const char* format = "JSRegExp: pattern=%s flags=%s"; | 20844 const char* format = "JSRegExp: pattern=%s flags=%s"; |
20845 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 20845 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
20846 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1); | 20846 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1); |
20847 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 20847 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
20848 return chars; | 20848 return chars; |
20849 } | 20849 } |
20850 | 20850 |
20851 | 20851 |
20852 void JSRegExp::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20852 void JSRegExp::PrintJSONImpl(JSONStream* stream, bool ref) const { |
20853 Instance::PrintJSONImpl(stream, ref); | 20853 JSONObject jsobj(stream); |
| 20854 PrintSharedInstanceJSON(&jsobj, ref); |
| 20855 jsobj.AddProperty("kind", "RegExp"); |
| 20856 jsobj.AddServiceId(*this); |
| 20857 |
| 20858 jsobj.AddProperty("pattern", String::Handle(pattern())); |
| 20859 |
| 20860 if (ref) { |
| 20861 return; |
| 20862 } |
| 20863 |
| 20864 Function& func = Function::Handle(); |
| 20865 func = function(kOneByteStringCid); |
| 20866 jsobj.AddProperty("_oneByteFunction", func); |
| 20867 func = function(kTwoByteStringCid); |
| 20868 jsobj.AddProperty("_twoByteFunction", func); |
| 20869 func = function(kExternalOneByteStringCid); |
| 20870 jsobj.AddProperty("_externalOneByteFunction", func); |
| 20871 func = function(kExternalTwoByteStringCid); |
| 20872 jsobj.AddProperty("_externalTwoByteFunction", func); |
20854 } | 20873 } |
20855 | 20874 |
20856 | 20875 |
20857 RawWeakProperty* WeakProperty::New(Heap::Space space) { | 20876 RawWeakProperty* WeakProperty::New(Heap::Space space) { |
20858 ASSERT(Isolate::Current()->object_store()->weak_property_class() | 20877 ASSERT(Isolate::Current()->object_store()->weak_property_class() |
20859 != Class::null()); | 20878 != Class::null()); |
20860 RawObject* raw = Object::Allocate(WeakProperty::kClassId, | 20879 RawObject* raw = Object::Allocate(WeakProperty::kClassId, |
20861 WeakProperty::InstanceSize(), | 20880 WeakProperty::InstanceSize(), |
20862 space); | 20881 space); |
20863 return reinterpret_cast<RawWeakProperty*>(raw); | 20882 return reinterpret_cast<RawWeakProperty*>(raw); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21082 return tag_label.ToCString(); | 21101 return tag_label.ToCString(); |
21083 } | 21102 } |
21084 | 21103 |
21085 | 21104 |
21086 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21105 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21087 Instance::PrintJSONImpl(stream, ref); | 21106 Instance::PrintJSONImpl(stream, ref); |
21088 } | 21107 } |
21089 | 21108 |
21090 | 21109 |
21091 } // namespace dart | 21110 } // namespace dart |
OLD | NEW |