Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Unified Diff: sdk/lib/_internal/js_runtime/lib/core_patch.dart

Issue 2836733002: dart2js: patch file support cleanup (Closed)
Patch Set: remove js_array change Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/annotations.dart ('k') | tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/core_patch.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index b911d3b2868b04a0828f234e5f9e89ec8d828099..f890fc2c9470f4af1601c9f1d933bc94c95c783f 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
@@ -17,15 +17,12 @@ import 'dart:_js_helper'
NoInline,
objectHashCode,
patch,
- patch_full,
- patch_lazy,
- patch_startup,
Primitives,
stringJoinUnchecked,
getTraceFromException,
RuntimeError;
-import 'dart:_foreign_helper' show JS;
+import 'dart:_foreign_helper' show JS, JS_GET_FLAG;
import 'dart:_native_typed_data' show NativeUint8List;
@@ -33,7 +30,7 @@ import 'dart:async' show StreamController;
String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
-_symbolMapToStringMap(Map<Symbol, dynamic> map) {
+Map<String, dynamic> _symbolMapToStringMap(Map<Symbol, dynamic> map) {
if (map == null) return null;
var result = new Map<String, dynamic>();
map.forEach((Symbol key, value) {
@@ -76,34 +73,17 @@ class Null {
// Patch for Function implementation.
@patch
class Function {
- @patch_full
- static apply(Function function, List positionalArguments,
- [Map<Symbol, dynamic> namedArguments]) {
- return Primitives.applyFunction(function, positionalArguments,
- namedArguments == null ? null : _toMangledNames(namedArguments));
- }
-
- @patch_lazy
- static apply(Function function, List positionalArguments,
- [Map<Symbol, dynamic> namedArguments]) {
- return Primitives.applyFunction2(function, positionalArguments,
- namedArguments == null ? null : _symbolMapToStringMap(namedArguments));
- }
-
- @patch_startup
+ @patch
static apply(Function function, List positionalArguments,
[Map<Symbol, dynamic> namedArguments]) {
- return Primitives.applyFunction2(function, positionalArguments,
- namedArguments == null ? null : _symbolMapToStringMap(namedArguments));
- }
-
- static Map<String, dynamic> _toMangledNames(
- Map<Symbol, dynamic> namedArguments) {
- Map<String, dynamic> result = {};
- namedArguments.forEach((symbol, value) {
- result[_symbolToString(symbol)] = value;
- });
- return result;
+ if (JS_GET_FLAG("IS_FULL_EMITTER")) {
+ return Primitives.applyFunction(
+ function, positionalArguments, _symbolMapToStringMap(namedArguments));
+ } else {
+ /// The lazy and startup emitter use a different implementation.
+ return Primitives.applyFunction2(
+ function, positionalArguments, _symbolMapToStringMap(namedArguments));
+ }
}
}
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/annotations.dart ('k') | tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698