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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart

Issue 23452029: Address comments from CL 23304012. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: emitConvertToFastObjectFunction Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
index 2c18645024ee3c37c357dd0dec2c741eb06874c7..ae6c90ea5f869e6dfab8a6955034eb7400364ba7 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
@@ -153,10 +153,10 @@ class CodeEmitterNoEvalTask extends CodeEmitterTask {
js.return_('Isolate')]);
}
- void emitInstancify() {
+ void emitConvertToFastObjectFunction() {
// Create an instance that uses 'properties' as prototype. This should make
// 'properties' a fast object.
- mainBuffer.add(r'''function instancify(properties) {
+ mainBuffer.add(r'''function convertToFastObject(properties) {
function MyClass() {};
MyClass.prototype = properties;
new MyClass();
@@ -169,6 +169,7 @@ class CodeEmitterNoEvalTask extends CodeEmitterTask {
primitives, const SourceString('printString'));
String printHelperName = namer.isolateAccess(printHelper);
mainBuffer.add('''
+// The following only works on V8 when run with option "--allow-natives-syntax".
if (typeof $printHelperName === "function") {
$printHelperName("Size of global object: "
+ String(Object.getOwnPropertyNames(properties).length)

Powered by Google App Engine
This is Rietveld 408576698