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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 779593002: Move elementAccess() from namer to emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | Annotate | Revision Log
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 part of js_backend; 5 part of js_backend;
6 6
7 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); 9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR");
10 10
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 emitter.generateEmbeddedGlobalAccess(dispatchPropertyName); 2114 emitter.generateEmbeddedGlobalAccess(dispatchPropertyName);
2115 2115
2116 // We pass the dispatch property record to the isJsIndexable 2116 // We pass the dispatch property record to the isJsIndexable
2117 // helper rather than reading it inside the helper to increase the 2117 // helper rather than reading it inside the helper to increase the
2118 // chance of making the dispatch record access monomorphic. 2118 // chance of making the dispatch record access monomorphic.
2119 jsAst.PropertyAccess record = 2119 jsAst.PropertyAccess record =
2120 new jsAst.PropertyAccess(use2, dispatchProperty); 2120 new jsAst.PropertyAccess(use2, dispatchProperty);
2121 2121
2122 List<jsAst.Expression> arguments = <jsAst.Expression>[use1, record]; 2122 List<jsAst.Expression> arguments = <jsAst.Expression>[use1, record];
2123 FunctionElement helper = findHelper('isJsIndexable'); 2123 FunctionElement helper = findHelper('isJsIndexable');
2124 jsAst.Expression helperExpression = namer.elementAccess(helper); 2124 jsAst.Expression helperExpression = emitter.globalPropertyAccess(helper);
floitsch 2014/12/03 17:02:24 Let's make the distinction between static function
zarah 2014/12/05 08:22:49 Done.
2125 return new jsAst.Call(helperExpression, arguments); 2125 return new jsAst.Call(helperExpression, arguments);
2126 } 2126 }
2127 2127
2128 bool isTypedArray(TypeMask mask) { 2128 bool isTypedArray(TypeMask mask) {
2129 // Just checking for [:TypedData:] is not sufficient, as it is an 2129 // Just checking for [:TypedData:] is not sufficient, as it is an
2130 // abstract class any user-defined class can implement. So we also 2130 // abstract class any user-defined class can implement. So we also
2131 // check for the interface [JavaScriptIndexingBehavior]. 2131 // check for the interface [JavaScriptIndexingBehavior].
2132 return 2132 return
2133 compiler.typedDataClass != null && 2133 compiler.typedDataClass != null &&
2134 compiler.world.isInstantiated(compiler.typedDataClass) && 2134 compiler.world.isInstantiated(compiler.typedDataClass) &&
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
2497 } 2497 }
2498 } 2498 }
2499 2499
2500 /// Records that [constant] is used by the element behind [registry]. 2500 /// Records that [constant] is used by the element behind [registry].
2501 class Dependency { 2501 class Dependency {
2502 final ConstantValue constant; 2502 final ConstantValue constant;
2503 final Element annotatedElement; 2503 final Element annotatedElement;
2504 2504
2505 const Dependency(this.constant, this.annotatedElement); 2505 const Dependency(this.constant, this.annotatedElement);
2506 } 2506 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698