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

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

Issue 947333004: dart2js: simplify constant expression generation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix long line. Created 5 years, 9 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
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 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter"); 7 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter");
8 8
9 /** 9 /**
10 * Generates the code for all used classes in the program. Static fields (even 10 * Generates the code for all used classes in the program. Static fields (even
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 /// Returns the JS function that must be invoked to get the value of the 410 /// Returns the JS function that must be invoked to get the value of the
411 /// lazily initialized static. 411 /// lazily initialized static.
412 jsAst.Expression isolateLazyInitializerAccess(FieldElement element); 412 jsAst.Expression isolateLazyInitializerAccess(FieldElement element);
413 413
414 /// Returns the closure expression of a static function. 414 /// Returns the closure expression of a static function.
415 jsAst.Expression isolateStaticClosureAccess(FunctionElement element); 415 jsAst.Expression isolateStaticClosureAccess(FunctionElement element);
416 416
417 /// Returns the JS code for accessing the embedded [global]. 417 /// Returns the JS code for accessing the embedded [global].
418 jsAst.Expression generateEmbeddedGlobalAccess(String global); 418 jsAst.Expression generateEmbeddedGlobalAccess(String global);
419 419
420 /// Returns the JS code for accessing the given [constant].
421 jsAst.Expression constantReference(ConstantValue constant);
422
423 /// Returns the JS function representing the given function. 420 /// Returns the JS function representing the given function.
424 /// 421 ///
425 /// The function must be invoked and can not be used as closure. 422 /// The function must be invoked and can not be used as closure.
426 jsAst.Expression staticFunctionAccess(FunctionElement element); 423 jsAst.Expression staticFunctionAccess(FunctionElement element);
427 424
428 jsAst.Expression staticFieldAccess(FieldElement element); 425 jsAst.Expression staticFieldAccess(FieldElement element);
429 426
430 /// Returns the JS constructor of the given element. 427 /// Returns the JS constructor of the given element.
431 /// 428 ///
432 /// The returned expression must only be used in a JS `new` expression. 429 /// The returned expression must only be used in a JS `new` expression.
433 jsAst.Expression constructorAccess(ClassElement e); 430 jsAst.Expression constructorAccess(ClassElement e);
434 431
435 /// Returns the JS prototype of the given class [e]. 432 /// Returns the JS prototype of the given class [e].
436 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated); 433 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated);
437 434
438 /// Returns the JS constructor of the given interceptor class [e]. 435 /// Returns the JS constructor of the given interceptor class [e].
439 jsAst.Expression interceptorClassAccess(ClassElement e); 436 jsAst.Expression interceptorClassAccess(ClassElement e);
440 437
441 /// Returns the JS expression representing the type [e]. 438 /// Returns the JS expression representing the type [e].
442 jsAst.Expression typeAccess(Element e); 439 jsAst.Expression typeAccess(Element e);
443 440
444 /// Returns the JS expression representing a function that returns 'null' 441 /// Returns the JS expression representing a function that returns 'null'
445 jsAst.Expression generateFunctionThatReturnsNull(); 442 jsAst.Expression generateFunctionThatReturnsNull();
446 443
447 int compareConstants(ConstantValue a, ConstantValue b); 444 int compareConstants(ConstantValue a, ConstantValue b);
448 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); 445 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant);
449 446
447 /// Returns the JS code for accessing the given [constant].
448 jsAst.Expression constantReference(ConstantValue constant);
449
450 void invalidateCaches(); 450 void invalidateCaches();
451 } 451 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/constant_emitter.dart ('k') | pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698