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

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

Issue 23452029: Address comments from CL 23304012. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698