Index: src/v8natives.js |
diff --git a/src/v8natives.js b/src/v8natives.js |
index 019e7c11ea83c95bc2ec0cba8676d4a8bd9ea784..8ff6f40461f4d4cc6c67079325247c794f3b1a35 100644 |
--- a/src/v8natives.js |
+++ b/src/v8natives.js |
@@ -17,7 +17,9 @@ |
// Helper function used to install functions on objects. |
function InstallFunctions(object, attributes, functions) { |
- %OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1); |
+ 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]; |
@@ -67,7 +69,9 @@ |
// Helper function for installing constant properties on objects. |
function InstallConstants(object, constants) { |
- %OptimizeObjectForAddingMultipleProperties(object, constants.length >> 1); |
+ if (constants.length >= 4) { |
+ %OptimizeObjectForAddingMultipleProperties(object, constants.length >> 1); |
+ } |
var attributes = DONT_ENUM | DONT_DELETE | READ_ONLY; |
for (var i = 0; i < constants.length; i += 2) { |
var name = constants[i]; |