Index: pkg/dev_compiler/lib/js/legacy/dart_sdk.js |
diff --git a/pkg/dev_compiler/lib/js/legacy/dart_sdk.js b/pkg/dev_compiler/lib/js/legacy/dart_sdk.js |
index 1736862a3e08e750bc2853488c552cc2655dc5e3..367d234aacb8c36fc4896caa1a0a0bf9708f8f82 100644 |
--- a/pkg/dev_compiler/lib/js/legacy/dart_sdk.js |
+++ b/pkg/dev_compiler/lib/js/legacy/dart_sdk.js |
@@ -35,7 +35,7 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
let JSArrayOfListOfObject = () => (JSArrayOfListOfObject = dart.constFn(_interceptors.JSArray$(ListOfObject())))(); |
let JSArrayOfObject = () => (JSArrayOfObject = dart.constFn(_interceptors.JSArray$(core.Object)))(); |
let MapOfSymbol$dynamic = () => (MapOfSymbol$dynamic = dart.constFn(core.Map$(core.Symbol, dart.dynamic)))(); |
- let MapOfString$int = () => (MapOfString$int = dart.constFn(core.Map$(core.String, core.int)))(); |
+ let MapOfString$_MethodStats = () => (MapOfString$_MethodStats = dart.constFn(core.Map$(core.String, dart._MethodStats)))(); |
let ListOfString = () => (ListOfString = dart.constFn(core.List$(core.String)))(); |
let SetOfNameValuePair = () => (SetOfNameValuePair = dart.constFn(core.Set$(_debugger.NameValuePair)))(); |
let JSArrayOfNameValuePair = () => (JSArrayOfNameValuePair = dart.constFn(_interceptors.JSArray$(_debugger.NameValuePair)))(); |
@@ -514,6 +514,7 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
let MapOfString$Function = () => (MapOfString$Function = dart.constFn(core.Map$(core.String, core.Function)))(); |
let JSArrayOfKeyEvent = () => (JSArrayOfKeyEvent = dart.constFn(_interceptors.JSArray$(html$.KeyEvent)))(); |
let ListOfKeyEvent = () => (ListOfKeyEvent = dart.constFn(core.List$(html$.KeyEvent)))(); |
+ let MapOfString$int = () => (MapOfString$int = dart.constFn(core.Map$(core.String, core.int)))(); |
let JSArrayOfNodeValidator = () => (JSArrayOfNodeValidator = dart.constFn(_interceptors.JSArray$(html$.NodeValidator)))(); |
let ListOfNodeValidator = () => (ListOfNodeValidator = dart.constFn(core.List$(html$.NodeValidator)))(); |
let _WrappedList = () => (_WrappedList = dart.constFn(html$._WrappedList$()))(); |
@@ -532,6 +533,7 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
let CompleterOfAudioBuffer = () => (CompleterOfAudioBuffer = dart.constFn(async.Completer$(web_audio.AudioBuffer)))(); |
let EventStreamProviderOfAudioProcessingEvent = () => (EventStreamProviderOfAudioProcessingEvent = dart.constFn(html$.EventStreamProvider$(web_audio.AudioProcessingEvent)))(); |
let StringAndStringToint = () => (StringAndStringToint = dart.constFn(dart.definiteFunctionType(core.int, [core.String, core.String])))(); |
+ let VoidTo_MethodStats = () => (VoidTo_MethodStats = dart.constFn(dart.definiteFunctionType(dart._MethodStats, [])))(); |
let dynamicTodynamic$ = () => (dynamicTodynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))(); |
let dynamicToString = () => (dynamicToString = dart.constFn(dart.definiteFunctionType(core.String, [dart.dynamic])))(); |
let dynamicToListOfString = () => (dynamicToListOfString = dart.constFn(dart.definiteFunctionType(ListOfString(), [dart.dynamic])))(); |
@@ -1449,7 +1451,7 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
}; |
dart.dload = function(obj, field) { |
let f = dart._canonicalMember(obj, field); |
- dart._trackCall(obj, f); |
+ dart._trackCall(obj); |
if (f != null) { |
if (dart.test(dart.hasMethod(obj, f))) return dart.bind(obj, f, void 0); |
return obj[f]; |
@@ -1458,7 +1460,7 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
}; |
dart.dput = function(obj, field, value) { |
let f = dart._canonicalMember(obj, field); |
- dart._trackCall(obj, f); |
+ dart._trackCall(obj); |
if (f != null) { |
return obj[f] = value; |
} |
@@ -1506,7 +1508,7 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
return null; |
}; |
dart._checkAndCall = function(f, ftype, obj, typeArgs, args, name) { |
- dart._trackCall(obj, name); |
+ dart._trackCall(obj); |
let originalTarget = obj === void 0 ? f : obj; |
function callNSM() { |
return dart.noSuchMethod(originalTarget, new dart.InvocationImpl(name, args, {namedArguments: dart.extractNamedArgs(args), isMethod: true})); |
@@ -1557,17 +1559,17 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
dart.getDynamicStats = function() { |
let ret = JSArrayOfListOfObject().of([]); |
let keys = dart._callMethodStats[dartx.keys][dartx.toList](); |
- keys[dartx.sort](dart.fn((a, b) => dart._callMethodStats[dartx.get](b)[dartx.compareTo](dart._callMethodStats[dartx.get](a)), StringAndStringToint())); |
+ keys[dartx.sort](dart.fn((a, b) => dart._callMethodStats[dartx.get](b).count[dartx.compareTo](dart._callMethodStats[dartx.get](a).count), StringAndStringToint())); |
for (let key of keys) { |
- let count = dart._callMethodStats[dartx.get](key); |
- ret[dartx.add](JSArrayOfObject().of([key, count])); |
+ let stats = dart._callMethodStats[dartx.get](key); |
+ ret[dartx.add](JSArrayOfObject().of([stats.typeName, stats.frame, stats.count])); |
} |
return ret; |
}; |
dart.clearDynamicStats = function() { |
dart._callMethodStats[dartx.clear](); |
}; |
- dart._trackCall = function(obj, name) { |
+ dart._trackCall = function(obj) { |
if (!dart.trackProfile) return; |
let actual = dart.getReifiedType(obj); |
let stackStr = new Error().stack; |
@@ -1580,12 +1582,9 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
break; |
} |
} |
- name = dart.str`${dart.typeName(actual)}.${name} <${src}>`; |
- if (dart.test(dart._callMethodStats[dartx.containsKey](name))) { |
- dart._callMethodStats[dartx.set](core.String._check(name), dart.notNull(dart._callMethodStats[dartx.get](name)) + 1); |
- } else { |
- dart._callMethodStats[dartx.set](core.String._check(name), 1); |
- } |
+ let actualTypeName = dart.typeName(actual); |
+ let o = dart._callMethodStats[dartx.putIfAbsent](dart.str`${actualTypeName} <${src}>`, dart.fn(() => new dart._MethodStats(core.String._check(actualTypeName), src), VoidTo_MethodStats())); |
+ o.count = dart.notNull(o.count) + 1; |
}; |
dart._callMethod = function(obj, name, typeArgs, args, displayName) { |
let symbol = dart._canonicalMember(obj, name); |
@@ -2438,9 +2437,25 @@ dart_library.library('dart_sdk', null, /* Imports */[ |
statics: () => ({_namedArgsToSymbols: dart.definiteFunctionType(core.Map$(core.Symbol, dart.dynamic), [dart.dynamic])}), |
names: ['_namedArgsToSymbols'] |
}); |
+ dart._MethodStats = class _MethodStats extends core.Object { |
+ new(typeName, frame) { |
+ this.typeName = typeName; |
+ this.frame = frame; |
+ this.count = null; |
+ this.count = 0; |
+ } |
+ }; |
+ dart.setSignature(dart._MethodStats, { |
+ constructors: () => ({new: dart.definiteFunctionType(dart._MethodStats, [core.String, core.String])}), |
+ fields: () => ({ |
+ typeName: core.String, |
+ frame: core.String, |
+ count: core.int |
+ }) |
+ }); |
dart.defineLazy(dart, { |
get _callMethodStats() { |
- return MapOfString$int().new(); |
+ return MapOfString$_MethodStats().new(); |
}, |
set _callMethodStats(_) {} |
}); |