| 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 13276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13287 Function& function = Function::ZoneHandle(); | 13287 Function& function = Function::ZoneHandle(); |
| 13288 function ^= id_map.At(inlining_id); | 13288 function ^= id_map.At(inlining_id); |
| 13289 fs->Add(&function); | 13289 fs->Add(&function); |
| 13290 inlining_id = caller_id; | 13290 inlining_id = caller_id; |
| 13291 caller_id = GetCallerId(inlining_id); | 13291 caller_id = GetCallerId(inlining_id); |
| 13292 } | 13292 } |
| 13293 } | 13293 } |
| 13294 | 13294 |
| 13295 | 13295 |
| 13296 void Code::DumpInlinedIntervals() const { | 13296 void Code::DumpInlinedIntervals() const { |
| 13297 OS::Print("Inlined intervals:\n"); | 13297 LogBlock lb(Isolate::Current()); |
| 13298 ISL_Print("Inlined intervals:\n"); |
| 13298 const Array& intervals = Array::Handle(GetInlinedIntervals()); | 13299 const Array& intervals = Array::Handle(GetInlinedIntervals()); |
| 13299 if (intervals.IsNull() || (intervals.Length() == 0)) return; | 13300 if (intervals.IsNull() || (intervals.Length() == 0)) return; |
| 13300 Smi& start = Smi::Handle(); | 13301 Smi& start = Smi::Handle(); |
| 13301 Smi& inlining_id = Smi::Handle(); | 13302 Smi& inlining_id = Smi::Handle(); |
| 13302 Smi& caller_id = Smi::Handle(); | 13303 Smi& caller_id = Smi::Handle(); |
| 13304 GrowableArray<Function*> inlined_functions; |
| 13305 const Function& inliner = Function::Handle(function()); |
| 13303 for (intptr_t i = 0; i < intervals.Length(); i += Code::kInlIntNumEntries) { | 13306 for (intptr_t i = 0; i < intervals.Length(); i += Code::kInlIntNumEntries) { |
| 13304 start ^= intervals.At(i + Code::kInlIntStart); | 13307 start ^= intervals.At(i + Code::kInlIntStart); |
| 13305 ASSERT(!start.IsNull()); | 13308 ASSERT(!start.IsNull()); |
| 13306 if (start.IsNull()) continue; | 13309 if (start.IsNull()) continue; |
| 13307 inlining_id ^= intervals.At(i + Code::kInlIntInliningId); | 13310 inlining_id ^= intervals.At(i + Code::kInlIntInliningId); |
| 13308 caller_id ^= intervals.At(i + Code::kInlIntCallerId); | 13311 caller_id ^= intervals.At(i + Code::kInlIntCallerId); |
| 13309 OS::Print(" %" Px " id: %" Pd " caller-id: %" Pd " \n", | 13312 ISL_Print(" %" Px " id: %" Pd " caller-id: %" Pd " \n", |
| 13310 start.Value(), inlining_id.Value(), caller_id.Value()); | 13313 start.Value(), inlining_id.Value(), caller_id.Value()); |
| 13314 inlined_functions.Clear(); |
| 13315 ISL_Print("Inlined functions at: %" Px "\n", start.Value()); |
| 13316 GetInlinedFunctionsAt(start.Value(), &inlined_functions); |
| 13317 for (intptr_t j = 0; j < inlined_functions.length(); j++) { |
| 13318 Function* function = inlined_functions[j]; |
| 13319 if (j == inlined_functions.length() - 1) { |
| 13320 if (function->raw() != inliner.raw()) { |
| 13321 ISL_Print("!!! INLINER: %s\n", inliner.ToCString()); |
| 13322 Isolate::Current()->Log()->Flush(); |
| 13323 } |
| 13324 ASSERT(function->raw() == inliner.raw()); |
| 13325 } |
| 13326 ISL_Print("%" Pd ": %s\n", j, function->ToCString()); |
| 13327 } |
| 13328 ISL_Print("INLINER: %s\n", inliner.ToCString()); |
| 13311 } | 13329 } |
| 13312 OS::Print("Inlined ids:\n"); | 13330 ISL_Print("Inlined ids:\n"); |
| 13313 const Array& id_map = Array::Handle(GetInlinedIdToFunction()); | 13331 const Array& id_map = Array::Handle(GetInlinedIdToFunction()); |
| 13314 Function& function = Function::Handle(); | 13332 Function& function = Function::Handle(); |
| 13315 for (intptr_t i = 0; i < id_map.Length(); i++) { | 13333 for (intptr_t i = 0; i < id_map.Length(); i++) { |
| 13316 function ^= id_map.At(i); | 13334 function ^= id_map.At(i); |
| 13317 if (!function.IsNull()) { | 13335 if (!function.IsNull()) { |
| 13318 OS::Print(" %" Pd ": %s\n", i, function.ToQualifiedCString()); | 13336 ISL_Print(" %" Pd ": %s\n", i, function.ToQualifiedCString()); |
| 13319 } | 13337 } |
| 13320 } | 13338 } |
| 13321 } | 13339 } |
| 13322 | 13340 |
| 13323 | 13341 |
| 13324 RawContext* Context::New(intptr_t num_variables, Heap::Space space) { | 13342 RawContext* Context::New(intptr_t num_variables, Heap::Space space) { |
| 13325 ASSERT(num_variables >= 0); | 13343 ASSERT(num_variables >= 0); |
| 13326 ASSERT(Object::context_class() != Class::null()); | 13344 ASSERT(Object::context_class() != Class::null()); |
| 13327 | 13345 |
| 13328 if (num_variables < 0 || num_variables > kMaxElements) { | 13346 if (num_variables < 0 || num_variables > kMaxElements) { |
| (...skipping 7945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21274 return tag_label.ToCString(); | 21292 return tag_label.ToCString(); |
| 21275 } | 21293 } |
| 21276 | 21294 |
| 21277 | 21295 |
| 21278 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21296 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 21279 Instance::PrintJSONImpl(stream, ref); | 21297 Instance::PrintJSONImpl(stream, ref); |
| 21280 } | 21298 } |
| 21281 | 21299 |
| 21282 | 21300 |
| 21283 } // namespace dart | 21301 } // namespace dart |
| OLD | NEW |