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

Side by Side Diff: lib/runtime/_types.js

Issue 1291623005: Skip type checks on native JavaScriptObjects (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Skip type checks on JSOs Created 5 years, 4 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 | « lib/runtime/_rtti.js ('k') | lib/runtime/dart_runtime.js » ('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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /* This library defines the representation of runtime types. 5 /* This library defines the representation of runtime types.
6 */ 6 */
7 7
8 dart_library.library('dart_runtime/_types', null, /* Imports */[ 8 dart_library.library('dart_runtime/_types', null, /* Imports */[
9 ], /* Lazy Imports */[ 9 ], /* Lazy Imports */[
10 'dart/core', 10 'dart/core',
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 let voidR = new Void(); 62 let voidR = new Void();
63 exports.void = voidR; 63 exports.void = voidR;
64 64
65 class Bottom extends TypeRep { 65 class Bottom extends TypeRep {
66 toString() { return "bottom"; } 66 toString() { return "bottom"; }
67 }; 67 };
68 let bottomR = new Bottom(); 68 let bottomR = new Bottom();
69 exports.bottom = bottomR; 69 exports.bottom = bottomR;
70 70
71 class JSObject extends TypeRep {
72 toString() { return "NativeJavaScriptObject"; }
73 };
74 let jsobjectR = new JSObject();
75 exports.jsobject = jsobjectR;
76
71 class AbstractFunctionType extends TypeRep { 77 class AbstractFunctionType extends TypeRep {
72 constructor() { 78 constructor() {
73 super(); 79 super();
74 this._stringValue = null; 80 this._stringValue = null;
75 } 81 }
76 82
77 toString() { return this.name; } 83 toString() { return this.name; }
78 84
79 get name() { 85 get name() {
80 if (this._stringValue) return this._stringValue; 86 if (this._stringValue) return this._stringValue;
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 let typeArgs = classes.getGenericArgs(type); 539 let typeArgs = classes.getGenericArgs(type);
534 if (!typeArgs) return true; 540 if (!typeArgs) return true;
535 for (let t of typeArgs) { 541 for (let t of typeArgs) {
536 if (t != core.Object && t != dynamicR) return false; 542 if (t != core.Object && t != dynamicR) return false;
537 } 543 }
538 return true; 544 return true;
539 } 545 }
540 exports.isGroundType = isGroundType; 546 exports.isGroundType = isGroundType;
541 547
542 }); 548 });
OLDNEW
« no previous file with comments | « lib/runtime/_rtti.js ('k') | lib/runtime/dart_runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698