Chromium Code Reviews| Index: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
| index c93307282b5a5ec17d010fe493d9dab0fd1f90bd..cd25786e92e51b83d2c35348ee33533762e19361 100644 |
| --- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
| +++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
| @@ -4,6 +4,7 @@ |
| part of js_backend; |
| +/// Enables debugging of fast/slow objects using V8-specific primitives. |
| const DEBUG_FAST_OBJECTS = false; |
| /** |
| @@ -703,7 +704,8 @@ class CodeEmitterTask extends CompilerTask { |
| optional( |
| DEBUG_FAST_OBJECTS, |
| - js(r'print("Number of classes: " + Object.getOwnPropertyNames($$).length)')), |
| + js(r'print("Number of classes: "' |
| + ' + Object.getOwnPropertyNames($$).length)')), |
| js.forIn('cls', 'collectedClasses', [ |
| js.if_('hasOwnProperty.call(collectedClasses, cls)', [ |
| @@ -3766,6 +3768,10 @@ function instancify(properties) { |
| } |
| for (String globalObject in Namer.reservedGlobalObjectNames) { |
| + // The global objects start as so-called "slow objects". For V8, this |
| + // means that it won't try to make map transitions as we add properties |
| + // to these objects. Later on, we attempt to turn these objects into |
| + // fast objects by calling "instancify". |
|
ngeoffray
2013/09/13 10:05:54
Please add that instancify is being defined in [em
ahe
2013/09/13 10:09:12
Done.
|
| mainBuffer |
| ..write('var ${globalObject}$_=$_{}$N') |
| ..write('delete ${globalObject}.x$N'); |
| @@ -4007,6 +4013,7 @@ function instancify(properties) { |
| 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 helper object: " |
| + String(Object.getOwnPropertyNames(H).length) |