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

Side by Side Diff: pkg/compiler/lib/src/native/ssa.dart

Issue 2814453005: Merge CommonElements and BackendHelpers! (Closed)
Patch Set: comments and re-merge, take two 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/native/resolver.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import '../common.dart'; 5 import '../common.dart';
6 import '../constants/values.dart'; 6 import '../constants/values.dart';
7 import '../elements/resolution_types.dart'; 7 import '../elements/resolution_types.dart';
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../js/js.dart' as js; 9 import '../js/js.dart' as js;
10 import '../js_emitter/js_emitter.dart' show NativeEmitter; 10 import '../js_emitter/js_emitter.dart' show NativeEmitter;
(...skipping 10 matching lines...) Expand all
21 21
22 HInstruction convertDartClosure( 22 HInstruction convertDartClosure(
23 ParameterElement parameter, ResolutionFunctionType type) { 23 ParameterElement parameter, ResolutionFunctionType type) {
24 HInstruction local = builder.localsHandler.readLocal(parameter); 24 HInstruction local = builder.localsHandler.readLocal(parameter);
25 ConstantValue arityConstant = 25 ConstantValue arityConstant =
26 builder.constantSystem.createInt(type.parameterTypes.length); 26 builder.constantSystem.createInt(type.parameterTypes.length);
27 HInstruction arity = 27 HInstruction arity =
28 builder.graph.addConstant(arityConstant, builder.closedWorld); 28 builder.graph.addConstant(arityConstant, builder.closedWorld);
29 // TODO(ngeoffray): For static methods, we could pass a method with a 29 // TODO(ngeoffray): For static methods, we could pass a method with a
30 // defined arity. 30 // defined arity.
31 MethodElement helper = builder.helpers.closureConverter; 31 MethodElement helper = builder.commonElements.closureConverter;
32 builder.pushInvokeStatic(nativeBody, helper, [local, arity]); 32 builder.pushInvokeStatic(nativeBody, helper, [local, arity]);
33 HInstruction closure = builder.pop(); 33 HInstruction closure = builder.pop();
34 return closure; 34 return closure;
35 } 35 }
36 36
37 // Check which pattern this native method follows: 37 // Check which pattern this native method follows:
38 // 1) foo() native; 38 // 1) foo() native;
39 // hasBody = false 39 // hasBody = false
40 // 2) foo() native "bar"; 40 // 2) foo() native "bar";
41 // No longer supported, this is now done with @JSName('foo') and case 1. 41 // No longer supported, this is now done with @JSName('foo') and case 1.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 LiteralString jsCode = nativeBody.asLiteralString(); 114 LiteralString jsCode = nativeBody.asLiteralString();
115 builder.push(new HForeignCode.statement( 115 builder.push(new HForeignCode.statement(
116 js.js.statementTemplateYielding( 116 js.js.statementTemplateYielding(
117 new js.LiteralStatement(jsCode.dartString.slowToString())), 117 new js.LiteralStatement(jsCode.dartString.slowToString())),
118 <HInstruction>[], 118 <HInstruction>[],
119 new SideEffects(), 119 new SideEffects(),
120 null, 120 null,
121 builder.commonMasks.dynamicType)); 121 builder.commonMasks.dynamicType));
122 } 122 }
123 } 123 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/resolver.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698