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

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

Issue 1237573002: Remove functions white-listed for use of try-finally and switch, add JS_SET_CURRENT_ISOLATE. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Change CURRENT_ISOLATE to STATIC_STATE. 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /// Generate code using the cps-based IR pipeline. 5 /// Generate code using the cps-based IR pipeline.
6 library code_generator_task; 6 library code_generator_task;
7 7
8 import 'glue.dart'; 8 import 'glue.dart';
9 import 'codegen.dart'; 9 import 'codegen.dart';
10 import 'unsugar.dart'; 10 import 'unsugar.dart';
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 ClassElement cls = element.enclosingClass; 65 ClassElement cls = element.enclosingClass;
66 String name = element.name; 66 String name = element.name;
67 String className = cls == null ? null : cls.name; 67 String className = cls == null ? null : cls.name;
68 LibraryElement library = element.library; 68 LibraryElement library = element.library;
69 String libraryName = library == null ? null : library.toString(); 69 String libraryName = library == null ? null : library.toString();
70 // TODO(karlklose): remove this fallback. 70 // TODO(karlklose): remove this fallback.
71 // Fallback for a few functions that we know require try-finally and 71 // Fallback for a few functions that we know require try-finally and
72 // switch. 72 // switch.
73 if (element.isNative || 73 if (element.isNative ||
74 element.isPatched || 74 element.isPatched ||
75 libraryName == 'origin library(dart:typed_data)' || 75 libraryName == 'origin library(dart:typed_data)') {
76 // Using switch or try-finally.
77 library.isInternalLibrary && name == 'unwrapException' ||
78 library.isPlatformLibrary && className == 'IterableBase' ||
79 library.isInternalLibrary && className == 'Closure' ||
80 libraryName == 'origin library(dart:collection)' &&
81 name == 'mapToString' ||
82 libraryName == 'library(dart:html)' && name == 'sanitizeNode' ||
83 className == '_IsolateContext' ||
84 className == 'IsolateNatives' ||
85 className == '_Deserializer' ||
86 name == '_rootRun' ||
87 name == '_microtaskLoopEntry') {
88 compiler.log('Using SSA compiler for platform element $element'); 76 compiler.log('Using SSA compiler for platform element $element');
89 return fallbackCompiler.compile(work); 77 return fallbackCompiler.compile(work);
90 } 78 }
91 79
92 if (tracer != null) { 80 if (tracer != null) {
93 tracer.traceCompilation(element.name, null); 81 tracer.traceCompilation(element.name, null);
94 } 82 }
95 cps.FunctionDefinition cpsFunction = compileToCpsIR(element); 83 cps.FunctionDefinition cpsFunction = compileToCpsIR(element);
96 cpsFunction = optimizeCpsIR(cpsFunction); 84 cpsFunction = optimizeCpsIR(cpsFunction);
97 tree_ir.FunctionDefinition treeFunction = compileToTreeIR(cpsFunction); 85 tree_ir.FunctionDefinition treeFunction = compileToTreeIR(cpsFunction);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // TODO(sigurdm): Make a better list of tasks. 222 // TODO(sigurdm): Make a better list of tasks.
235 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks); 223 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks);
236 } 224 }
237 225
238 js.Node attachPosition(js.Node node, AstElement element) { 226 js.Node attachPosition(js.Node node, AstElement element) {
239 return node.withSourceInformation( 227 return node.withSourceInformation(
240 sourceInformationFactory.createBuilderForContext(element) 228 sourceInformationFactory.createBuilderForContext(element)
241 .buildDeclaration(element)); 229 .buildDeclaration(element));
242 } 230 }
243 } 231 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698