Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 26873) |
| +++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy) |
| @@ -1664,7 +1664,18 @@ |
| // We're accessing a native JavaScript property called 'length' |
| // on a JS String or a JS array. Therefore, the name of that |
| // property should not be mangled. |
| - push(new js.PropertyAccess.field(pop(), 'length'), node); |
| + if (backend.isTypedArray( |
| + node.receiver.instructionType.computeMask(compiler))) { |
| + // TODO(...): Remove this custom code for typed arrays once V8 |
|
bakster
2013/08/30 07:56:27
Please replace ... with your name.
ngeoffray
2013/08/30 08:51:34
Done.
|
| + // optimizes their length access. |
| + Element element = compiler.findRequiredElement( |
| + compiler.typedDataLibrary, const SourceString('fetchLength')); |
| + Constant constant = compiler.constantHandler.compileConstant(element); |
| + var jsConstant = backend.emitter.constantReference(constant); |
| + push(new js.Call(jsConstant, [pop()]), node); |
| + } else { |
| + push(new js.PropertyAccess.field(pop(), 'length'), node); |
| + } |
| } else { |
| String name = _fieldPropertyName(element); |
| push(new js.PropertyAccess.field(pop(), name), node); |