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

Side by Side Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10703188: Allow patch files to add top-level declarations to the patched library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix errors caught by editor. Created 8 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 | 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 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 final JavaScriptBackend backend; 6 final JavaScriptBackend backend;
7 SsaCodeGeneratorTask(JavaScriptBackend backend) 7 SsaCodeGeneratorTask(JavaScriptBackend backend)
8 : this.backend = backend, 8 : this.backend = backend,
9 super(backend.compiler); 9 super(backend.compiler);
10 String get name() => 'SSA code generator'; 10 String get name() => 'SSA code generator';
(...skipping 17 matching lines...) Expand all
28 // $.staticFun = function() { 28 // $.staticFun = function() {
29 // ... 29 // ...
30 // }; 30 // };
31 if (element.isInstanceMember() || 31 if (element.isInstanceMember() ||
32 element.kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY) { 32 element.kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY) {
33 extraSpace = " "; 33 extraSpace = " ";
34 } 34 }
35 35
36 String code = 'function($parameters) {\n$body$extraSpace}'; 36 String code = 'function($parameters) {\n$body$extraSpace}';
37 List<SourceMappingEntry> sourceMappings = new List<SourceMappingEntry>(); 37 List<SourceMappingEntry> sourceMappings = new List<SourceMappingEntry>();
38 SourceFile sourceFile = element.getCompilationUnit().script.file; 38 SourceFile sourceFile = element.getScript().file;
39 FunctionExpression expression = element.cachedNode; 39 FunctionExpression expression = element.cachedNode;
40 sourceMappings.add(new SourceMappingEntry( 40 sourceMappings.add(new SourceMappingEntry(
41 sourceFile, expression.getBeginToken().charOffset, 0)); 41 sourceFile, expression.getBeginToken().charOffset, 0));
42 sourceMappings.add(new SourceMappingEntry( 42 sourceMappings.add(new SourceMappingEntry(
43 sourceFile, expression.getEndToken().charOffset, code.length - 1)); 43 sourceFile, expression.getEndToken().charOffset, code.length - 1));
44 return new CodeBlock(code, sourceMappings); 44 return new CodeBlock(code, sourceMappings);
45 } 45 }
46 46
47 CodeBlock generateMethod(WorkItem work, HGraph graph) { 47 CodeBlock generateMethod(WorkItem work, HGraph graph) {
48 return measure(() { 48 return measure(() {
(...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after
3111 if (leftType.canBeNull() && rightType.canBeNull()) { 3111 if (leftType.canBeNull() && rightType.canBeNull()) {
3112 if (left.isConstantNull() || right.isConstantNull() || 3112 if (left.isConstantNull() || right.isConstantNull() ||
3113 (leftType.isPrimitive() && leftType == rightType)) { 3113 (leftType.isPrimitive() && leftType == rightType)) {
3114 return '=='; 3114 return '==';
3115 } 3115 }
3116 return null; 3116 return null;
3117 } else { 3117 } else {
3118 return '==='; 3118 return '===';
3119 } 3119 }
3120 } 3120 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/scanner_task.dart ('k') | lib/compiler/implementation/unparse_validator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698