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

Unified Diff: src/v8natives.js

Issue 1094383004: Always optimize for adding properties to native objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 8ff6f40461f4d4cc6c67079325247c794f3b1a35..019e7c11ea83c95bc2ec0cba8676d4a8bd9ea784 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -17,9 +17,7 @@ var $isFinite = GlobalIsFinite;
// Helper function used to install functions on objects.
function InstallFunctions(object, attributes, functions) {
- if (functions.length >= 8) {
- %OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1);
- }
+ %OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1);
for (var i = 0; i < functions.length; i += 2) {
var key = functions[i];
var f = functions[i + 1];
@@ -69,9 +67,7 @@ function InstallGetterSetter(object, name, getter, setter) {
// Helper function for installing constant properties on objects.
function InstallConstants(object, constants) {
- if (constants.length >= 4) {
- %OptimizeObjectForAddingMultipleProperties(object, constants.length >> 1);
- }
+ %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];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698