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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart

Issue 1250633002: Add operators test to source_mapping_test. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 5 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 | « pkg/compiler/lib/src/cps_ir/cps_fragment.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index cca5f7b06477020bf2f21580b9c850083414f057..dc810da0080627ed0a1cd539d6a3224703b110ac 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -193,7 +193,7 @@ abstract class JumpCollector {
}
/// True if a jump inserted now will escape from a try block.
- ///
+ ///
/// Concretely, this is true when [enterTry] has been called without
/// its corresponding [leaveTry] call.
bool get isEscapingTry => _boxedTryVariables.isNotEmpty;
@@ -637,7 +637,7 @@ class IrBuilder {
Selector selector,
TypeMask mask,
List<ir.Primitive> arguments,
- {SourceInformation sourceInformation}) {
+ SourceInformation sourceInformation) {
assert(isOpen);
return _continueWithExpression(
(k) => new ir.InvokeMethod(receiver, selector, mask, arguments, k,
@@ -650,8 +650,8 @@ class IrBuilder {
List<ir.Definition> arguments,
{SourceInformation sourceInformation}) {
Selector selector = callStructure.callSelector;
- return _buildInvokeDynamic(target, selector, mask, arguments,
- sourceInformation: sourceInformation);
+ return _buildInvokeDynamic(
+ target, selector, mask, arguments, sourceInformation);
}
@@ -876,15 +876,15 @@ class IrBuilder {
List<ir.Primitive> arguments,
{SourceInformation sourceInformation}) {
return _buildInvokeDynamic(
- receiver, selector, mask, arguments,
- sourceInformation: sourceInformation);
+ receiver, selector, mask, arguments, sourceInformation);
}
/// Create a dynamic getter invocation on [receiver] where the getter name is
/// defined by [selector].
ir.Primitive buildDynamicGet(ir.Primitive receiver,
Selector selector,
- TypeMask mask) {
+ TypeMask mask,
+ SourceInformation sourceInformation) {
assert(selector.isGetter);
FieldElement field = program.locateSingleField(selector, mask);
if (field != null) {
@@ -893,7 +893,7 @@ class IrBuilder {
return buildFieldGet(receiver, field);
} else {
return _buildInvokeDynamic(
- receiver, selector, mask, const <ir.Primitive>[]);
+ receiver, selector, mask, const <ir.Primitive>[], sourceInformation);
}
}
@@ -902,7 +902,8 @@ class IrBuilder {
ir.Primitive buildDynamicSet(ir.Primitive receiver,
Selector selector,
TypeMask mask,
- ir.Primitive value) {
+ ir.Primitive value,
+ {SourceInformation sourceInformation}) {
assert(selector.isSetter);
FieldElement field = program.locateSingleField(selector, mask);
if (field != null) {
@@ -910,19 +911,22 @@ class IrBuilder {
// treated as a field access, since the setter might not be emitted.
buildFieldSet(receiver, field, value);
} else {
- _buildInvokeDynamic(receiver, selector, mask, <ir.Primitive>[value]);
+ _buildInvokeDynamic(receiver, selector, mask, <ir.Primitive>[value],
+ sourceInformation);
}
return value;
}
/// Create a dynamic index set invocation on [receiver] with the provided
/// [index] and [value].
- ir.Primitive buildDynamicIndexSet(ir.Primitive receiver,
- TypeMask mask,
- ir.Primitive index,
- ir.Primitive value) {
+ ir.Primitive buildDynamicIndexSet(ir.Primitive receiver,
+ TypeMask mask,
+ ir.Primitive index,
+ ir.Primitive value,
+ {SourceInformation sourceInformation}) {
_buildInvokeDynamic(
- receiver, new Selector.indexSet(), mask, <ir.Primitive>[index, value]);
+ receiver, new Selector.indexSet(), mask, <ir.Primitive>[index, value],
+ sourceInformation);
return value;
}
@@ -1042,11 +1046,13 @@ class IrBuilder {
///
/// The arguments must be strings; usually a call to [buildStringify] is
/// needed to ensure the proper conversion takes places.
- ir.Primitive buildStringConcatenation(List<ir.Primitive> arguments) {
+ ir.Primitive buildStringConcatenation(List<ir.Primitive> arguments,
+ {SourceInformation sourceInformation}) {
assert(isOpen);
return addPrimitive(new ir.ApplyBuiltinOperator(
ir.BuiltinOperator.StringConcatenate,
- arguments));
+ arguments,
+ sourceInformation));
}
/// Create an invocation of the `call` method of [functionExpression], where
@@ -2214,9 +2220,11 @@ class IrBuilder {
return environment.discard(1);
}
- ir.Primitive buildIdentical(ir.Primitive x, ir.Primitive y) {
+ ir.Primitive buildIdentical(ir.Primitive x, ir.Primitive y,
+ {SourceInformation sourceInformation}) {
return addPrimitive(new ir.ApplyBuiltinOperator(
- ir.BuiltinOperator.Identical, <ir.Primitive>[x, y]));
+ ir.BuiltinOperator.Identical, <ir.Primitive>[x, y],
+ sourceInformation));
}
/// Called when entering a nested function with free variables.
@@ -2439,8 +2447,8 @@ class IrBuilder {
return addPrimitive(new ir.GetField(receiver, target));
}
- void buildFieldSet(ir.Primitive receiver,
- FieldElement target,
+ void buildFieldSet(ir.Primitive receiver,
+ FieldElement target,
ir.Primitive value) {
add(new ir.SetField(receiver, target, value));
}
@@ -2655,8 +2663,10 @@ class IrBuilder {
/// `right` if [value] is null. Only when [value] is null, [buildRight] is
/// evaluated to produce the `right` value.
ir.Primitive buildIfNull(ir.Primitive value,
- ir.Primitive buildRight(IrBuilder builder)) {
- ir.Primitive condition = _buildCheckNull(value);
+ ir.Primitive buildRight(IrBuilder builder),
+ {SourceInformation sourceInformation}) {
+ ir.Primitive condition =
+ _buildCheckNull(value, sourceInformation: sourceInformation);
return buildConditional(condition, buildRight, (_) => value);
}
@@ -2664,15 +2674,19 @@ class IrBuilder {
/// that checks if [receiver] is null, if so, it returns null, otherwise it
/// evaluates the [buildSend] expression.
ir.Primitive buildIfNotNullSend(ir.Primitive receiver,
- ir.Primitive buildSend(IrBuilder builder)) {
- ir.Primitive condition = _buildCheckNull(receiver);
+ ir.Primitive buildSend(IrBuilder builder),
+ {SourceInformation sourceInformation}) {
+ ir.Primitive condition =
+ _buildCheckNull(receiver, sourceInformation: sourceInformation);
return buildConditional(condition, (_) => receiver, buildSend);
}
/// Creates a type test checking whether [value] is null.
- ir.Primitive _buildCheckNull(ir.Primitive value) {
+ ir.Primitive _buildCheckNull(ir.Primitive value,
+ {SourceInformation sourceInformation}) {
assert(isOpen);
- return buildIdentical(value, buildNullConstant());
+ return buildIdentical(value, buildNullConstant(),
+ sourceInformation: sourceInformation);
}
/// Convert the given value to a string.
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_fragment.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698