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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart

Issue 636903002: Compute an incremental patch to JavaScript code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use Namer.elementAccess (to address Johnni's comment) Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/enqueue.dart ('k') | dart/site/try/poi/patcher.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
index 69785015bd5d9b7bbc00141a8d90fdac95ef3a10..04117a33e3b5c18f52dea576d94b8f7ce0e98373 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
@@ -1105,6 +1105,9 @@ class OldEmitter implements Emitter {
Element isolateMain =
backend.isolateHelperLibrary.find(JavaScriptBackend.START_ROOT_ISOLATE);
mainCallClosure = buildIsolateSetupClosure(main, isolateMain);
+ } else if (compiler.hasIncrementalSupport) {
+ mainCallClosure =
+ js('function() { return #(); }', namer.elementAccess(main));
} else {
mainCallClosure = namer.elementAccess(main);
}
@@ -1331,6 +1334,12 @@ class OldEmitter implements Emitter {
// Using a named function here produces easier to read stack traces in
// Chrome/V8.
mainBuffer.add('(function(${namer.currentIsolate})$_{\n');
+ if (compiler.hasIncrementalSupport) {
+ mainBuffer.add(
+ '(this.\$dart_unsafe_eval ='
+ ' this.\$dart_unsafe_eval || Object.create(null))'
+ '.patch = function(a) { eval(a) }$N');
+ }
if (isProgramSplit) {
/// We collect all the global state of the, so it can be passed to the
/// initializer of deferred files.
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/enqueue.dart ('k') | dart/site/try/poi/patcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698