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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/native_emitter.dart

Issue 890443003: Revert "dart2js: remove invalid case in generateParameterStubStatements in NativeEmitter." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | 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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 class NativeEmitter { 7 class NativeEmitter {
8 8
9 final Map<Element, ClassBuilder> cachedBuilders; 9 final Map<Element, ClassBuilder> cachedBuilders;
10 10
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 326
327 String target; 327 String target;
328 jsAst.Expression receiver; 328 jsAst.Expression receiver;
329 List<jsAst.Expression> arguments; 329 List<jsAst.Expression> arguments;
330 330
331 assert(invariant(member, nativeMethods.contains(member))); 331 assert(invariant(member, nativeMethods.contains(member)));
332 // When calling a JS method, we call it with the native name, and only the 332 // When calling a JS method, we call it with the native name, and only the
333 // arguments up until the last one provided. 333 // arguments up until the last one provided.
334 target = member.fixedBackendName; 334 target = member.fixedBackendName;
335 335
336 assert(invariant(member, isInterceptedMethod)); 336 if (isInterceptedMethod) {
337 receiver = argumentsBuffer[0]; 337 receiver = argumentsBuffer[0];
338 arguments = argumentsBuffer.sublist(1, 338 arguments = argumentsBuffer.sublist(1,
339 indexOfLastOptionalArgumentInParameters + 1); 339 indexOfLastOptionalArgumentInParameters + 1);
340 } else {
341 // Native methods that are not intercepted must be static.
342 assert(invariant(member, member.isStatic));
343 receiver = js('this');
344 arguments = argumentsBuffer.sublist(0,
345 indexOfLastOptionalArgumentInParameters + 1);
346 }
340 statements.add( 347 statements.add(
341 js.statement('return #.#(#)', [receiver, target, arguments])); 348 js.statement('return #.#(#)', [receiver, target, arguments]));
342 349
343 return statements; 350 return statements;
344 } 351 }
345 352
346 bool isSupertypeOfNativeClass(Element element) { 353 bool isSupertypeOfNativeClass(Element element) {
347 if (element.isTypeVariable) { 354 if (element.isTypeVariable) {
348 compiler.internalError(element, "Is check for type variable."); 355 compiler.internalError(element, "Is check for type variable.");
349 return false; 356 return false;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 } 471 }
465 ''', {'info': infoAccess, 472 ''', {'info': infoAccess,
466 'constructor': constructorAccess, 473 'constructor': constructorAccess,
467 'subclassRead': subclassRead, 474 'subclassRead': subclassRead,
468 'interceptorsByTagAccess': interceptorsByTagAccess, 475 'interceptorsByTagAccess': interceptorsByTagAccess,
469 'leafTagsAccess': leafTagsAccess, 476 'leafTagsAccess': leafTagsAccess,
470 'nativeSuperclassTagName': embeddedNames.NATIVE_SUPERCLASS_TAG_NAME, 477 'nativeSuperclassTagName': embeddedNames.NATIVE_SUPERCLASS_TAG_NAME,
471 'allowNativesSubclassing': true}); 478 'allowNativesSubclassing': true});
472 } 479 }
473 } 480 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698