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

Unified Diff: src/v8natives.js

Issue 165449: Avoid map transitions and multiple backing arrays for builtin prototypes... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 4 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 | « src/spaces.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
===================================================================
--- src/v8natives.js (revision 2674)
+++ src/v8natives.js (working copy)
@@ -46,12 +46,16 @@
// Helper function used to install functions on objects.
function InstallFunctions(object, attributes, functions) {
+ if (functions.length >= 8) {
+ %OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1);
+ }
for (var i = 0; i < functions.length; i += 2) {
var key = functions[i];
var f = functions[i + 1];
%FunctionSetName(f, key);
%SetProperty(object, key, f, attributes);
}
+ %TransformToFastProperties(object);
}
// Emulates JSC by installing functions on a hidden prototype that
@@ -454,8 +458,10 @@
function SetupNumber() {
// Setup the constructor property on the Number prototype object.
+ %OptimizeObjectForAddingMultipleProperties($Number.prototype, 8);
%SetProperty($Number.prototype, "constructor", $Number, DONT_ENUM);
+ %OptimizeObjectForAddingMultipleProperties($Number, 5);
// ECMA-262 section 15.7.3.1.
%SetProperty($Number,
"MAX_VALUE",
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698