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

Side by Side Diff: frog/minfrog

Issue 8999030: frog isolate fixes: minor changes to the isolate library + architecture.py (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 years, 12 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
« no previous file with comments | « frog/lib/isolate.dart ('k') | frog/world.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 /** 4 /**
5 * Generates a dynamic call stub for a function. 5 * Generates a dynamic call stub for a function.
6 * Our goal is to create a stub method like this on-the-fly: 6 * Our goal is to create a stub method like this on-the-fly:
7 * function($0, $1, capture) { return this($0, $1, true, capture); } 7 * function($0, $1, capture) { return this($0, $1, true, capture); }
8 * 8 *
9 * This stub then replaces the dynamic one on Function, with one that is 9 * This stub then replaces the dynamic one on Function, with one that is
10 * specialized for that particular function, taking into account its default 10 * specialized for that particular function, taking into account its default
(...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after
1806 } 1806 }
1807 return true; 1807 return true;
1808 } 1808 }
1809 Collections.filter = function(source, destination, f) { 1809 Collections.filter = function(source, destination, f) {
1810 for (var $$i = source.iterator(); $$i.hasNext$0(); ) { 1810 for (var $$i = source.iterator(); $$i.hasNext$0(); ) {
1811 var e = $$i.next$0(); 1811 var e = $$i.next$0();
1812 if (f(e)) destination.add(e); 1812 if (f(e)) destination.add(e);
1813 } 1813 }
1814 return destination; 1814 return destination;
1815 } 1815 }
1816 // ********** Code for _Worker **************
1816 // ********** Code for top level ************** 1817 // ********** Code for top level **************
1817 // ********** Library node ************** 1818 // ********** Library node **************
1818 // ********** Code for Process ************** 1819 // ********** Code for Process **************
1819 function Process(_process) { 1820 function Process(_process) {
1820 this.SIGHUP = 'SIGHUP' 1821 this.SIGHUP = 'SIGHUP'
1821 this.SIGINT = 'SIGINT' 1822 this.SIGINT = 'SIGINT'
1822 this.SIGQUIT = 'SIGQUIT' 1823 this.SIGQUIT = 'SIGQUIT'
1823 this.SIGILL = 'SIGILL' 1824 this.SIGILL = 'SIGILL'
1824 this.SIGTRAP = 'SIGTRAP' 1825 this.SIGTRAP = 'SIGTRAP'
1825 this.SIGABRT = 'SIGABRT' 1826 this.SIGABRT = 'SIGABRT'
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 } 1874 }
1874 // ********** Code for ReadableStream ************** 1875 // ********** Code for ReadableStream **************
1875 // ********** Code for WritableStream ************** 1876 // ********** Code for WritableStream **************
1876 Object.prototype.$typeNameOf = function() { 1877 Object.prototype.$typeNameOf = function() {
1877 if ((typeof(window) != 'undefined' && window.constructor.name == 'DOMWindow') 1878 if ((typeof(window) != 'undefined' && window.constructor.name == 'DOMWindow')
1878 || typeof(process) != 'undefined') { // fast-path for Chrome and Node 1879 || typeof(process) != 'undefined') { // fast-path for Chrome and Node
1879 return this.constructor.name; 1880 return this.constructor.name;
1880 } 1881 }
1881 var str = Object.prototype.toString.call(this); 1882 var str = Object.prototype.toString.call(this);
1882 str = str.substring(8, str.length - 1); 1883 str = str.substring(8, str.length - 1);
1883 if (str == 'Window') str = 'DOMWindow'; 1884 if (str == 'Window') {
1885 str = 'DOMWindow';
1886 } else if (str == 'Document') {
1887 str = 'HTMLDocument';
1888 }
1884 return str; 1889 return str;
1885 } 1890 }
1886 function $dynamic(name) { 1891 function $dynamic(name) {
1887 var f = Object.prototype[name]; 1892 var f = Object.prototype[name];
1888 if (f && f.methods) return f.methods; 1893 if (f && f.methods) return f.methods;
1889 1894
1890 var methods = {}; 1895 var methods = {};
1891 if (f) methods.Object = f; 1896 if (f) methods.Object = f;
1892 function $dynamicBind() { 1897 function $dynamicBind() {
1893 // Find the target method 1898 // Find the target method
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 } 2122 }
2118 CoreJs.prototype.ensureDynamicProto = function() { 2123 CoreJs.prototype.ensureDynamicProto = function() {
2119 if (this._generatedDynamicProto) return; 2124 if (this._generatedDynamicProto) return;
2120 this._generatedDynamicProto = true; 2125 this._generatedDynamicProto = true;
2121 this.ensureTypeNameOf(); 2126 this.ensureTypeNameOf();
2122 this.writer.writeln("function $dynamic(name) {\n var f = Object.prototype[nam e];\n if (f && f.methods) return f.methods;\n\n var methods = {};\n if (f) me thods.Object = f;\n function $dynamicBind() {\n // Find the target method\n var method;\n var proto = Object.getPrototypeOf(this);\n var obj = this ;\n do {\n method = methods[obj.$typeNameOf()];\n if (method) break ;\n obj = Object.getPrototypeOf(obj);\n } while (obj);\n\n // Patch t he prototype, but don't overwrite an existing stub, like\n // the one on Obje ct.prototype.\n if (!proto.hasOwnProperty(name)) proto[name] = method || meth ods.Object;\n\n return method.apply(this, Array.prototype.slice.call(argument s));\n };\n $dynamicBind.methods = methods;\n Object.prototype[name] = $dynam icBind;\n return methods;\n}"/*null._DYNAMIC_FUNCTION*/); 2127 this.writer.writeln("function $dynamic(name) {\n var f = Object.prototype[nam e];\n if (f && f.methods) return f.methods;\n\n var methods = {};\n if (f) me thods.Object = f;\n function $dynamicBind() {\n // Find the target method\n var method;\n var proto = Object.getPrototypeOf(this);\n var obj = this ;\n do {\n method = methods[obj.$typeNameOf()];\n if (method) break ;\n obj = Object.getPrototypeOf(obj);\n } while (obj);\n\n // Patch t he prototype, but don't overwrite an existing stub, like\n // the one on Obje ct.prototype.\n if (!proto.hasOwnProperty(name)) proto[name] = method || meth ods.Object;\n\n return method.apply(this, Array.prototype.slice.call(argument s));\n };\n $dynamicBind.methods = methods;\n Object.prototype[name] = $dynam icBind;\n return methods;\n}"/*null._DYNAMIC_FUNCTION*/);
2123 } 2128 }
2124 CoreJs.prototype.ensureTypeNameOf = function() { 2129 CoreJs.prototype.ensureTypeNameOf = function() {
2125 if (this._generatedTypeNameOf) return; 2130 if (this._generatedTypeNameOf) return;
2126 this._generatedTypeNameOf = true; 2131 this._generatedTypeNameOf = true;
2127 this.writer.writeln("Object.prototype.$typeNameOf = function() {\n if ((typeo f(window) != 'undefined' && window.constructor.name == 'DOMWindow')\n || ty peof(process) != 'undefined') { // fast-path for Chrome and Node\n return thi s.constructor.name;\n }\n var str = Object.prototype.toString.call(this);\n s tr = str.substring(8, str.length - 1);\n if (str == 'Window') str = 'DOMWindow' ;\n return str;\n}"/*null._TYPE_NAME_OF_FUNCTION*/); 2132 this.writer.writeln("Object.prototype.$typeNameOf = function() {\n if ((typeo f(window) != 'undefined' && window.constructor.name == 'DOMWindow')\n || ty peof(process) != 'undefined') { // fast-path for Chrome and Node\n return thi s.constructor.name;\n }\n var str = Object.prototype.toString.call(this);\n s tr = str.substring(8, str.length - 1);\n if (str == 'Window') {\n str = 'DOM Window';\n } else if (str == 'Document') {\n str = 'HTMLDocument';\n }\n r eturn str;\n}"/*null._TYPE_NAME_OF_FUNCTION*/);
2128 } 2133 }
2129 CoreJs.prototype.ensureInheritsHelper = function() { 2134 CoreJs.prototype.ensureInheritsHelper = function() {
2130 if (this._generatedInherits) return; 2135 if (this._generatedInherits) return;
2131 this._generatedInherits = true; 2136 this._generatedInherits = true;
2132 this.writer.writeln("/** Implements extends for Dart classes on JavaScript pro totypes. */\nfunction $inherits(child, parent) {\n if (child.prototype.__proto_ _) {\n child.prototype.__proto__ = parent.prototype;\n } else {\n functio n tmp() {};\n tmp.prototype = parent.prototype;\n child.prototype = new tm p();\n child.prototype.constructor = child;\n }\n}"/*null._INHERITS_FUNCTION */); 2137 this.writer.writeln("/** Implements extends for Dart classes on JavaScript pro totypes. */\nfunction $inherits(child, parent) {\n if (child.prototype.__proto_ _) {\n child.prototype.__proto__ = parent.prototype;\n } else {\n functio n tmp() {};\n tmp.prototype = parent.prototype;\n child.prototype = new tm p();\n child.prototype.constructor = child;\n }\n}"/*null._INHERITS_FUNCTION */);
2133 } 2138 }
2134 CoreJs.prototype.generate = function(w) { 2139 CoreJs.prototype.generate = function(w) {
2135 w.write(this.writer.get$text()); 2140 w.write(this.writer.get$text());
2136 this.writer = w; 2141 this.writer = w;
2137 if (this.useGenStub) { 2142 if (this.useGenStub) {
(...skipping 10668 matching lines...) Expand 10 before | Expand all | Expand 10 after
12806 this.info(('mangling matching top level name "' + named.get$jsname() + '" in ') + ('both "' + named.get$library().get$jsname() + '" and "' + existing.get$li brary().get$jsname() + '"')); 12811 this.info(('mangling matching top level name "' + named.get$jsname() + '" in ') + ('both "' + named.get$library().get$jsname() + '" and "' + existing.get$li brary().get$jsname() + '"'));
12807 var existingPri = existing.get$jsnamePriority(); 12812 var existingPri = existing.get$jsnamePriority();
12808 var namedPri = named.get$jsnamePriority(); 12813 var namedPri = named.get$jsnamePriority();
12809 if (existingPri > namedPri || namedPri == 0) { 12814 if (existingPri > namedPri || namedPri == 0) {
12810 this._renameJavascriptTopName(named); 12815 this._renameJavascriptTopName(named);
12811 } 12816 }
12812 else if (namedPri > existingPri) { 12817 else if (namedPri > existingPri) {
12813 this._renameJavascriptTopName(existing); 12818 this._renameJavascriptTopName(existing);
12814 } 12819 }
12815 else { 12820 else {
12816 $globals.world.internalError(('conflicting JS name "' + name + '" of same ') + ('priority ' + existingPri + ': (already defined in) ') + ('' + existing.ge t$span().get$locationText() + ' with priority ' + namedPri + ')'), named.get$spa n(), existing.get$span()); 12821 var msg = ('conflicting JS name "' + name + '" of same ') + ('priority ' + existingPri + ': (already defined in) ') + ('' + existing.get$span().get$locati onText() + ' with priority ' + namedPri + ')');
12822 if (named.get$isNative()) {
12823 $globals.world.info(msg, named.get$span(), existing.get$span());
12824 }
12825 else {
12826 $globals.world.internalError(msg, named.get$span(), existing.get$span()) ;
12827 }
12817 } 12828 }
12818 } 12829 }
12819 else { 12830 else {
12820 this._topNames.$setindex(name, named); 12831 this._topNames.$setindex(name, named);
12821 } 12832 }
12822 } 12833 }
12823 World.prototype._renameJavascriptTopName = function(named) { 12834 World.prototype._renameJavascriptTopName = function(named) {
12824 named._jsname = ('' + named.get$library().get$jsname() + '_' + named.get$jsnam e()); 12835 named._jsname = ('' + named.get$library().get$jsname() + '_' + named.get$jsnam e());
12825 var existing = this._topNames.$index(named.get$jsname()); 12836 var existing = this._topNames.$index(named.get$jsname());
12826 if (existing != null && $ne(existing, named)) { 12837 if (existing != null && $ne(existing, named)) {
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
13605 $globals._RED_COLOR = '\u001b[31m'; 13616 $globals._RED_COLOR = '\u001b[31m';
13606 } 13617 }
13607 var const$1 = new EmptyQueueException()/*const EmptyQueueException()*/; 13618 var const$1 = new EmptyQueueException()/*const EmptyQueueException()*/;
13608 var const$126 = new IllegalAccessException()/*const IllegalAccessException()*/; 13619 var const$126 = new IllegalAccessException()/*const IllegalAccessException()*/;
13609 var const$127 = ImmutableList.ImmutableList$from$factory([])/*const []*/; 13620 var const$127 = ImmutableList.ImmutableList$from$factory([])/*const []*/;
13610 var const$2 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; 13621 var const$2 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/;
13611 var const$7 = new NoMoreElementsException()/*const NoMoreElementsException()*/; 13622 var const$7 = new NoMoreElementsException()/*const NoMoreElementsException()*/;
13612 var $globals = {}; 13623 var $globals = {};
13613 $static_init(); 13624 $static_init();
13614 main(); 13625 main();
OLDNEW
« no previous file with comments | « frog/lib/isolate.dart ('k') | frog/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698