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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart

Issue 1743283002: dart2js cps: Use definitions by default, not references. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix doc comments and long lines Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library dart2js.ir_builder; 5 library dart2js.ir_builder;
6 6
7 import '../closure.dart' as closure; 7 import '../closure.dart' as closure;
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/names.dart' show 9 import '../common/names.dart' show
10 Names, 10 Names,
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 for (int jumpIndex = 0; jumpIndex < _invocations.length; ++jumpIndex) { 336 for (int jumpIndex = 0; jumpIndex < _invocations.length; ++jumpIndex) {
337 Environment invocationEnvironment = _invocationEnvironments[jumpIndex]; 337 Environment invocationEnvironment = _invocationEnvironments[jumpIndex];
338 List<ir.Reference> arguments = <ir.Reference>[]; 338 List<ir.Reference> arguments = <ir.Reference>[];
339 int varIndex = 0; 339 int varIndex = 0;
340 for (ir.Parameter parameter in parameters) { 340 for (ir.Parameter parameter in parameters) {
341 varIndex = 341 varIndex =
342 _continuationEnvironment.index2value.indexOf(parameter, varIndex); 342 _continuationEnvironment.index2value.indexOf(parameter, varIndex);
343 arguments.add(new ir.Reference(invocationEnvironment[varIndex])); 343 arguments.add(new ir.Reference(invocationEnvironment[varIndex]));
344 } 344 }
345 ir.InvokeContinuation invocation = _invocations[jumpIndex]; 345 ir.InvokeContinuation invocation = _invocations[jumpIndex];
346 invocation.continuation = new ir.Reference(_continuation); 346 invocation.continuationRef = new ir.Reference(_continuation);
347 invocation.arguments = arguments; 347 invocation.argumentRefs = arguments;
348 } 348 }
349 } 349 }
350 } 350 }
351 351
352 /// A class to collect 'backward' jumps. 352 /// A class to collect 'backward' jumps.
353 /// 353 ///
354 /// A backward jump to a continuation in the sense of the CPS translation is 354 /// A backward jump to a continuation in the sense of the CPS translation is
355 /// a jump where some code in the body of the continuation is translated 355 /// a jump where some code in the body of the continuation is translated
356 /// before the jump is emitted. They have the property that the 356 /// before the jump is emitted. They have the property that the
357 /// continuation parameters and the environment for the translation of the 357 /// continuation parameters and the environment for the translation of the
(...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after
2937 this.stackTraceVariable, 2937 this.stackTraceVariable,
2938 this.buildCatchBlock}); 2938 this.buildCatchBlock});
2939 } 2939 }
2940 2940
2941 class SwitchCaseInfo { 2941 class SwitchCaseInfo {
2942 final SubbuildFunction buildCondition; 2942 final SubbuildFunction buildCondition;
2943 final SubbuildFunction buildBody; 2943 final SubbuildFunction buildBody;
2944 2944
2945 SwitchCaseInfo(this.buildCondition, this.buildBody); 2945 SwitchCaseInfo(this.buildCondition, this.buildBody);
2946 } 2946 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698