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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 24267004: Emit CSP code in separate file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make tests pass Created 7 years, 2 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 | 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 class JavaScriptItemCompilationContext extends ItemCompilationContext { 7 class JavaScriptItemCompilationContext extends ItemCompilationContext {
8 final Set<HInstruction> boundsChecked; 8 final Set<HInstruction> boundsChecked;
9 9
10 JavaScriptItemCompilationContext() 10 JavaScriptItemCompilationContext()
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 410
411 // Checked mode helpers indexed by name. 411 // Checked mode helpers indexed by name.
412 Map<String, CheckedModeHelper> checkedModeHelperByName = 412 Map<String, CheckedModeHelper> checkedModeHelperByName =
413 new Map<String, CheckedModeHelper>.fromIterable( 413 new Map<String, CheckedModeHelper>.fromIterable(
414 checkedModeHelpers, 414 checkedModeHelpers,
415 key: (helper) => helper.name.slowToString()); 415 key: (helper) => helper.name.slowToString());
416 416
417 /// Number of methods compiled before considering reflection. 417 /// Number of methods compiled before considering reflection.
418 int preMirrorsMethodCount = 0; 418 int preMirrorsMethodCount = 0;
419 419
420 JavaScriptBackend(Compiler compiler, bool generateSourceMap, bool disableEval) 420 JavaScriptBackend(Compiler compiler, bool generateSourceMap)
421 : namer = determineNamer(compiler), 421 : namer = determineNamer(compiler),
422 oneShotInterceptors = new Map<String, Selector>(), 422 oneShotInterceptors = new Map<String, Selector>(),
423 interceptedElements = new Map<SourceString, Set<Element>>(), 423 interceptedElements = new Map<SourceString, Set<Element>>(),
424 rti = new RuntimeTypes(compiler), 424 rti = new RuntimeTypes(compiler),
425 specializedGetInterceptors = new Map<String, Set<ClassElement>>(), 425 specializedGetInterceptors = new Map<String, Set<ClassElement>>(),
426 super(compiler, JAVA_SCRIPT_CONSTANT_SYSTEM) { 426 super(compiler, JAVA_SCRIPT_CONSTANT_SYSTEM) {
427 emitter = disableEval 427 emitter = new CodeEmitterTask(compiler, namer, generateSourceMap);
428 ? new CodeEmitterNoEvalTask(compiler, namer, generateSourceMap)
429 : new CodeEmitterTask(compiler, namer, generateSourceMap);
430 builder = new SsaBuilderTask(this); 428 builder = new SsaBuilderTask(this);
431 optimizer = new SsaOptimizerTask(this); 429 optimizer = new SsaOptimizerTask(this);
432 generator = new SsaCodeGeneratorTask(this); 430 generator = new SsaCodeGeneratorTask(this);
433 } 431 }
434 432
435 static Namer determineNamer(Compiler compiler) { 433 static Namer determineNamer(Compiler compiler) {
436 return compiler.enableMinification ? 434 return compiler.enableMinification ?
437 new MinifyNamer(compiler) : 435 new MinifyNamer(compiler) :
438 new Namer(compiler); 436 new Namer(compiler);
439 } 437 }
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 copy(constant.values); 1839 copy(constant.values);
1842 copy(constant.protoValue); 1840 copy(constant.protoValue);
1843 copy(constant); 1841 copy(constant);
1844 } 1842 }
1845 1843
1846 void visitConstructed(ConstructedConstant constant) { 1844 void visitConstructed(ConstructedConstant constant) {
1847 copy(constant.fields); 1845 copy(constant.fields);
1848 copy(constant); 1846 copy(constant);
1849 } 1847 }
1850 } 1848 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698