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

Side by Side Diff: src/v8natives.js

Issue 3191026: Explicitly set expected number of properties for instances of builtin types. (Closed)
Patch Set: Created 10 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 unified diff | Download patch
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 %SetCode($Object, function(x) { 829 %SetCode($Object, function(x) {
830 if (%_IsConstructCall()) { 830 if (%_IsConstructCall()) {
831 if (x == null) return this; 831 if (x == null) return this;
832 return ToObject(x); 832 return ToObject(x);
833 } else { 833 } else {
834 if (x == null) return { }; 834 if (x == null) return { };
835 return ToObject(x); 835 return ToObject(x);
836 } 836 }
837 }); 837 });
838 838
839 %SetExpectedNumberOfProperties($Object, 4);
839 840
840 // ---------------------------------------------------------------------------- 841 // ----------------------------------------------------------------------------
841 842
842 843
843 function SetupObject() { 844 function SetupObject() {
844 // Setup non-enumerable functions on the Object.prototype object. 845 // Setup non-enumerable functions on the Object.prototype object.
845 InstallFunctions($Object.prototype, DONT_ENUM, $Array( 846 InstallFunctions($Object.prototype, DONT_ENUM, $Array(
846 "toString", ObjectToString, 847 "toString", ObjectToString,
847 "toLocaleString", ObjectToLocaleString, 848 "toLocaleString", ObjectToLocaleString,
848 "valueOf", ObjectValueOf, 849 "valueOf", ObjectValueOf,
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 // ---------------------------------------------------------------------------- 1180 // ----------------------------------------------------------------------------
1180 1181
1181 function SetupFunction() { 1182 function SetupFunction() {
1182 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1183 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1183 "bind", FunctionBind, 1184 "bind", FunctionBind,
1184 "toString", FunctionToString 1185 "toString", FunctionToString
1185 )); 1186 ));
1186 } 1187 }
1187 1188
1188 SetupFunction(); 1189 SetupFunction();
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698