Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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); | |
|
floitsch
2015/02/24 23:08:48
moved here to live with the other constant-related
Johnni Winther
2015/02/25 11:37:02
Maybe 'generateConstantReference'.
floitsch
2015/02/25 16:35:18
The thing is, that it doesn't always generate a re
Johnni Winther
2015/02/26 08:24:50
I rarely read 'reference' as a verb...
floitsch
2015/02/26 13:11:33
useConstant?
Johnni Winther
2015/02/26 15:01:46
It feels wrong; like registering that we use the c
| |
| 449 | |
| 450 void invalidateCaches(); | 450 void invalidateCaches(); |
| 451 } | 451 } |
| OLD | NEW |