| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// This library defines runtime operations on objects used by the code | 5 /// This library defines runtime operations on objects used by the code |
| 6 /// generator. | 6 /// generator. |
| 7 part of dart._runtime; | 7 part of dart._runtime; |
| 8 | 8 |
| 9 class InvocationImpl extends Invocation { | 9 class InvocationImpl extends Invocation { |
| 10 final Symbol memberName; | 10 final Symbol memberName; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 _trackCall(obj, name) { | 207 _trackCall(obj, name) { |
| 208 if (JS('bool', '!#', trackProfile)) return; | 208 if (JS('bool', '!#', trackProfile)) return; |
| 209 | 209 |
| 210 var actual = getReifiedType(obj); | 210 var actual = getReifiedType(obj); |
| 211 String stackStr = JS('String', "new Error().stack"); | 211 String stackStr = JS('String', "new Error().stack"); |
| 212 var stack = stackStr.split('\n at '); | 212 var stack = stackStr.split('\n at '); |
| 213 var src = ''; | 213 var src = ''; |
| 214 for (int i = 2; i < stack.length; ++i) { | 214 for (int i = 2; i < stack.length; ++i) { |
| 215 var frame = stack[i]; | 215 var frame = stack[i]; |
| 216 if (!frame.contains('dev_compiler/lib/runtime/dart_sdk.js')) { | 216 if (!frame.contains('dart_sdk.js')) { |
| 217 src = frame; | 217 src = frame; |
| 218 break; | 218 break; |
| 219 } | 219 } |
| 220 } | 220 } |
| 221 | 221 |
| 222 name = "${typeName(actual)}.$name <$src>"; | 222 name = "${typeName(actual)}.$name <$src>"; |
| 223 if (_callMethodStats.containsKey(name)) { | 223 if (_callMethodStats.containsKey(name)) { |
| 224 _callMethodStats[name] = _callMethodStats[name] + 1; | 224 _callMethodStats[name] = _callMethodStats[name] + 1; |
| 225 } else { | 225 } else { |
| 226 _callMethodStats[name] = 1; | 226 _callMethodStats[name] = 1; |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 if (obj != null && getExtensionType(obj) != null) { | 733 if (obj != null && getExtensionType(obj) != null) { |
| 734 return JS('', 'dartx.#', name); | 734 return JS('', 'dartx.#', name); |
| 735 } | 735 } |
| 736 | 736 |
| 737 // Check for certain names that we can't use in JS | 737 // Check for certain names that we can't use in JS |
| 738 if (name == 'constructor' || name == 'prototype') { | 738 if (name == 'constructor' || name == 'prototype') { |
| 739 name = '+' + name; | 739 name = '+' + name; |
| 740 } | 740 } |
| 741 return name; | 741 return name; |
| 742 } | 742 } |
| OLD | NEW |