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

Side by Side Diff: frog/leg/native_handler.dart

Issue 9773026: Add a method on native classes for is checks. Reduces the code for generating is checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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/leg/native_emitter.dart ('k') | frog/leg/ssa/codegen.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 // 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 #library('native'); 5 #library('native');
6 #import('../../lib/uri/uri.dart'); 6 #import('../../lib/uri/uri.dart');
7 #import('leg.dart'); 7 #import('leg.dart');
8 #import('elements/elements.dart'); 8 #import('elements/elements.dart');
9 #import('scanner/scannerlib.dart'); 9 #import('scanner/scannerlib.dart');
10 #import('ssa/ssa.dart'); 10 #import('ssa/ssa.dart');
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 addSubtypes(classElement, emitter); 52 addSubtypes(classElement, emitter);
53 } 53 }
54 } 54 }
55 } 55 }
56 if (hasNativeClass) { 56 if (hasNativeClass) {
57 compiler.registerStaticUse(compiler.findHelper( 57 compiler.registerStaticUse(compiler.findHelper(
58 const SourceString('dynamicFunction'))); 58 const SourceString('dynamicFunction')));
59 compiler.registerStaticUse(compiler.findHelper( 59 compiler.registerStaticUse(compiler.findHelper(
60 const SourceString('dynamicSetMetadata'))); 60 const SourceString('dynamicSetMetadata')));
61 compiler.registerStaticUse(compiler.findHelper( 61 compiler.registerStaticUse(compiler.findHelper(
62 const SourceString('dynamicIsCheck'))); 62 const SourceString('defineProperty')));
63 } 63 }
64 } 64 }
65 65
66 void maybeEnableNative(Compiler compiler, 66 void maybeEnableNative(Compiler compiler,
67 LibraryElement library, 67 LibraryElement library,
68 Uri uri) { 68 Uri uri) {
69 String libraryName = uri.toString(); 69 String libraryName = uri.toString();
70 if (library.script.name.contains('dart/frog/tests/native/src') 70 if (library.script.name.contains('dart/frog/tests/native/src')
71 || libraryName == 'dart:dom' 71 || libraryName == 'dart:dom'
72 || libraryName == 'dart:isolate' 72 || libraryName == 'dart:isolate'
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 const LiteralDartString('void'), 340 const LiteralDartString('void'),
341 <HInstruction>[jsClosure])); 341 <HInstruction>[jsClosure]));
342 } 342 }
343 }); 343 });
344 LiteralString jsCode = node.arguments.head; 344 LiteralString jsCode = node.arguments.head;
345 builder.push(new HForeign(jsCode.dartString, 345 builder.push(new HForeign(jsCode.dartString,
346 const LiteralDartString('Object'), 346 const LiteralDartString('Object'),
347 <HInstruction>[])); 347 <HInstruction>[]));
348 } 348 }
349 } 349 }
OLDNEW
« no previous file with comments | « frog/leg/native_emitter.dart ('k') | frog/leg/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698