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

Side by Side Diff: src/v8natives.js

Issue 450303003: Tag all prototypes as proto, except those set using __proto__ (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove is_shared from Map Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/stub-cache.cc ('k') | test/mjsunit/runtime-gen/internalsetprototype.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file relies on the fact that the following declarations have been made 5 // This file relies on the fact that the following declarations have been made
6 // in runtime.js: 6 // in runtime.js:
7 // var $Object = global.Object; 7 // var $Object = global.Object;
8 // var $Boolean = global.Boolean; 8 // var $Boolean = global.Boolean;
9 // var $Number = global.Number; 9 // var $Number = global.Number;
10 // var $Function = global.Function; 10 // var $Function = global.Function;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 %AddNamedProperty(prototype, fields[i], 89 %AddNamedProperty(prototype, fields[i],
90 UNDEFINED, DONT_ENUM | DONT_DELETE); 90 UNDEFINED, DONT_ENUM | DONT_DELETE);
91 } 91 }
92 } 92 }
93 for (var i = 0; i < methods.length; i += 2) { 93 for (var i = 0; i < methods.length; i += 2) {
94 var key = methods[i]; 94 var key = methods[i];
95 var f = methods[i + 1]; 95 var f = methods[i + 1];
96 %AddNamedProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY); 96 %AddNamedProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY);
97 %SetNativeFlag(f); 97 %SetNativeFlag(f);
98 } 98 }
99 %SetPrototype(prototype, null); 99 %InternalSetPrototype(prototype, null);
100 %ToFastProperties(prototype); 100 %ToFastProperties(prototype);
101 } 101 }
102 102
103 103
104 // ---------------------------------------------------------------------------- 104 // ----------------------------------------------------------------------------
105 105
106 106
107 // ECMA 262 - 15.1.4 107 // ECMA 262 - 15.1.4
108 function GlobalIsNaN(number) { 108 function GlobalIsNaN(number) {
109 if (!IS_NUMBER(number)) number = NonNumberToNumber(number); 109 if (!IS_NUMBER(number)) number = NonNumberToNumber(number);
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 1118
1119 return ObjectGetOwnPropertyKeys(obj, false); 1119 return ObjectGetOwnPropertyKeys(obj, false);
1120 } 1120 }
1121 1121
1122 1122
1123 // ES5 section 15.2.3.5. 1123 // ES5 section 15.2.3.5.
1124 function ObjectCreate(proto, properties) { 1124 function ObjectCreate(proto, properties) {
1125 if (!IS_SPEC_OBJECT(proto) && proto !== null) { 1125 if (!IS_SPEC_OBJECT(proto) && proto !== null) {
1126 throw MakeTypeError("proto_object_or_null", [proto]); 1126 throw MakeTypeError("proto_object_or_null", [proto]);
1127 } 1127 }
1128 var obj = { __proto__: proto }; 1128 var obj = {};
1129 %InternalSetPrototype(obj, proto);
1129 if (!IS_UNDEFINED(properties)) ObjectDefineProperties(obj, properties); 1130 if (!IS_UNDEFINED(properties)) ObjectDefineProperties(obj, properties);
1130 return obj; 1131 return obj;
1131 } 1132 }
1132 1133
1133 1134
1134 // ES5 section 15.2.3.6. 1135 // ES5 section 15.2.3.6.
1135 function ObjectDefineProperty(obj, p, attributes) { 1136 function ObjectDefineProperty(obj, p, attributes) {
1136 if (!IS_SPEC_OBJECT(obj)) { 1137 if (!IS_SPEC_OBJECT(obj)) {
1137 throw MakeTypeError("called_on_non_object", ["Object.defineProperty"]); 1138 throw MakeTypeError("called_on_non_object", ["Object.defineProperty"]);
1138 } 1139 }
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1868 %SetCode($Function, FunctionConstructor); 1869 %SetCode($Function, FunctionConstructor);
1869 %AddNamedProperty($Function.prototype, "constructor", $Function, DONT_ENUM); 1870 %AddNamedProperty($Function.prototype, "constructor", $Function, DONT_ENUM);
1870 1871
1871 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1872 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1872 "bind", FunctionBind, 1873 "bind", FunctionBind,
1873 "toString", FunctionToString 1874 "toString", FunctionToString
1874 )); 1875 ));
1875 } 1876 }
1876 1877
1877 SetUpFunction(); 1878 SetUpFunction();
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | test/mjsunit/runtime-gen/internalsetprototype.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698