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

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

Issue 2673513003: dart2js: Introduce HGetLength to replace strange use of HFieldGet (Closed)
Patch Set: Created 3 years, 10 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 'dart:collection'; 5 import 'dart:collection';
6 6
7 import 'package:js_runtime/shared/embedded_names.dart'; 7 import 'package:js_runtime/shared/embedded_names.dart';
8 8
9 import '../closure.dart'; 9 import '../closure.dart';
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 5464 matching lines...) Expand 10 before | Expand all | Expand 10 after
5475 Element loopVariable = elements.getForInVariable(node); 5475 Element loopVariable = elements.getForInVariable(node);
5476 SyntheticLocal indexVariable = new SyntheticLocal('_i', loopVariable); 5476 SyntheticLocal indexVariable = new SyntheticLocal('_i', loopVariable);
5477 TypeMask boolType = commonMasks.boolType; 5477 TypeMask boolType = commonMasks.boolType;
5478 5478
5479 // These variables are shared by initializer, condition, body and update. 5479 // These variables are shared by initializer, condition, body and update.
5480 HInstruction array; // Set in buildInitializer. 5480 HInstruction array; // Set in buildInitializer.
5481 bool isFixed; // Set in buildInitializer. 5481 bool isFixed; // Set in buildInitializer.
5482 HInstruction originalLength = null; // Set for growable lists. 5482 HInstruction originalLength = null; // Set for growable lists.
5483 5483
5484 HInstruction buildGetLength() { 5484 HInstruction buildGetLength() {
5485 MemberElement lengthElement = helpers.jsIndexableLength; 5485 HInstruction result = new HGetLength(array, commonMasks.positiveIntType,
5486 HFieldGet result = new HFieldGet(
5487 lengthElement, array, commonMasks.positiveIntType,
5488 isAssignable: !isFixed); 5486 isAssignable: !isFixed);
5489 add(result); 5487 add(result);
5490 return result; 5488 return result;
5491 } 5489 }
5492 5490
5493 void buildConcurrentModificationErrorCheck() { 5491 void buildConcurrentModificationErrorCheck() {
5494 if (originalLength == null) return; 5492 if (originalLength == null) return;
5495 // The static call checkConcurrentModificationError() is expanded in 5493 // The static call checkConcurrentModificationError() is expanded in
5496 // codegen to: 5494 // codegen to:
5497 // 5495 //
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
6722 this.oldReturnLocal, 6720 this.oldReturnLocal,
6723 this.oldReturnType, 6721 this.oldReturnType,
6724 this.oldResolvedAst, 6722 this.oldResolvedAst,
6725 this.oldStack, 6723 this.oldStack,
6726 this.oldLocalsHandler, 6724 this.oldLocalsHandler,
6727 this.inTryStatement, 6725 this.inTryStatement,
6728 this.allFunctionsCalledOnce, 6726 this.allFunctionsCalledOnce,
6729 this.oldElementInferenceResults) 6727 this.oldElementInferenceResults)
6730 : super(function); 6728 : super(function);
6731 } 6729 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | pkg/compiler/lib/src/ssa/value_range_analyzer.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698