Chromium Code Reviews| Index: runtime/vm/object.cc |
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
| index 382dac2ca16413e891813f1c8e353508f8d3b2e1..41d0be986f8d5dcf06c889452505ecb33828e2f7 100644 |
| --- a/runtime/vm/object.cc |
| +++ b/runtime/vm/object.cc |
| @@ -6111,13 +6111,14 @@ void Function::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| jsobj.AddPropertyF("id", "classes/%" Pd "/%s/%" Pd "", cid, selector, id); |
| jsobj.AddProperty("name", internal_name); |
| jsobj.AddProperty("user_name", user_name); |
| + jsobj.AddProperty("class", cls); |
| + const char* kind_string = Function::KindToCString(kind()); |
| + jsobj.AddProperty("kind", kind_string); |
| if (ref) return; |
| jsobj.AddProperty("is_static", is_static()); |
| jsobj.AddProperty("is_const", is_const()); |
| jsobj.AddProperty("is_optimizable", is_optimizable()); |
| jsobj.AddProperty("is_inlinable", IsInlineable()); |
| - const char* kind_string = Function::KindToCString(kind()); |
| - jsobj.AddProperty("kind", kind_string); |
| jsobj.AddProperty("unoptimized_code", Object::Handle(unoptimized_code())); |
| jsobj.AddProperty("usage_counter", usage_counter()); |
| jsobj.AddProperty("optimized_call_site_count", optimized_call_site_count()); |
| @@ -6874,7 +6875,8 @@ RawString* TokenStream::GenerateSource(intptr_t start_pos, |
| curr = next; |
| } |
| const Array& source = Array::Handle(Array::MakeArray(literals)); |
| - return String::ConcatAll(source); |
| + const String& s = String::Handle(String::ConcatAll(source)); |
| + return s.raw(); |
|
turnidge
2014/03/10 21:03:28
Why this delta?
Cutch
2014/03/11 03:17:48
Removed.
|
| } |
| @@ -10470,6 +10472,14 @@ void Code::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| const Object& obj = Object::Handle(owner()); |
| if (obj.IsFunction()) { |
| jsobj.AddProperty("function", obj); |
| + } else { |
| + // Generate a fake function reference. |
| + JSONObject func(&jsobj, "function"); |
| + func.AddProperty("type", "@Function"); |
| + func.AddProperty("kind", "Stub"); |
| + func.AddPropertyF("id", "stub/functions/%" Pd "", EntryPoint()); |
| + func.AddProperty("user_name", user_name.ToCString()); |
| + func.AddProperty("name", name.ToCString()); |
| } |
| if (ref) { |
| return; |
| @@ -15402,6 +15412,7 @@ const char* String::ToCString() const { |
| uint8_t* result = zone->Alloc<uint8_t>(len + 1); |
| ToUTF8(result, len); |
| result[len] = 0; |
| + ASSERT(Utf8::IsValid(result, len)); |
|
turnidge
2014/03/10 21:03:28
Is this expensive for our debug builds?
Cutch
2014/03/11 03:17:48
I haven't noticed but I've removed it.
|
| return reinterpret_cast<const char*>(result); |
| } |