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

Side by Side Diff: src/js/v8natives.js

Issue 2730573004: Revert of Migrate Object.prototype.valueOf to CSA (Closed)
Patch Set: Created 3 years, 9 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/debug/debug-evaluate.cc ('k') | test/cctest/test-serialize.cc » ('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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ---------------------------------------------------------------------------- 9 // ----------------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 13 matching lines...) Expand all
24 // ---------------------------------------------------------------------------- 24 // ----------------------------------------------------------------------------
25 // Object 25 // Object
26 26
27 // ES6 19.1.3.5 Object.prototype.toLocaleString([reserved1 [,reserved2]]) 27 // ES6 19.1.3.5 Object.prototype.toLocaleString([reserved1 [,reserved2]])
28 function ObjectToLocaleString() { 28 function ObjectToLocaleString() {
29 CHECK_OBJECT_COERCIBLE(this, "Object.prototype.toLocaleString"); 29 CHECK_OBJECT_COERCIBLE(this, "Object.prototype.toLocaleString");
30 return this.toString(); 30 return this.toString();
31 } 31 }
32 32
33 33
34 // ES6 19.1.3.7 Object.prototype.valueOf()
35 function ObjectValueOf() {
36 return TO_OBJECT(this);
37 }
38
39
34 // ES6 19.1.3.3 Object.prototype.isPrototypeOf(V) 40 // ES6 19.1.3.3 Object.prototype.isPrototypeOf(V)
35 function ObjectIsPrototypeOf(V) { 41 function ObjectIsPrototypeOf(V) {
36 if (!IS_RECEIVER(V)) return false; 42 if (!IS_RECEIVER(V)) return false;
37 var O = TO_OBJECT(this); 43 var O = TO_OBJECT(this);
38 return %HasInPrototypeChain(V, O); 44 return %HasInPrototypeChain(V, O);
39 } 45 }
40 46
41 47
42 // ES6 7.3.9 48 // ES6 7.3.9
43 function GetMethod(obj, p) { 49 function GetMethod(obj, p) {
(...skipping 19 matching lines...) Expand all
63 %SetNativeFlag(GlobalObject); 69 %SetNativeFlag(GlobalObject);
64 %SetCode(GlobalObject, ObjectConstructor); 70 %SetCode(GlobalObject, ObjectConstructor);
65 71
66 %AddNamedProperty(GlobalObject.prototype, "constructor", GlobalObject, 72 %AddNamedProperty(GlobalObject.prototype, "constructor", GlobalObject,
67 DONT_ENUM); 73 DONT_ENUM);
68 74
69 // Set up non-enumerable functions on the Object.prototype object. 75 // Set up non-enumerable functions on the Object.prototype object.
70 utils.InstallFunctions(GlobalObject.prototype, DONT_ENUM, [ 76 utils.InstallFunctions(GlobalObject.prototype, DONT_ENUM, [
71 "toString", ObjectToString, 77 "toString", ObjectToString,
72 "toLocaleString", ObjectToLocaleString, 78 "toLocaleString", ObjectToLocaleString,
73 // valueOf is added in bootstrapper.cc. 79 "valueOf", ObjectValueOf,
74 "isPrototypeOf", ObjectIsPrototypeOf, 80 "isPrototypeOf", ObjectIsPrototypeOf,
75 // propertyIsEnumerable is added in bootstrapper.cc. 81 // propertyIsEnumerable is added in bootstrapper.cc.
76 // __defineGetter__ is added in bootstrapper.cc. 82 // __defineGetter__ is added in bootstrapper.cc.
77 // __lookupGetter__ is added in bootstrapper.cc. 83 // __lookupGetter__ is added in bootstrapper.cc.
78 // __defineSetter__ is added in bootstrapper.cc. 84 // __defineSetter__ is added in bootstrapper.cc.
79 // __lookupSetter__ is added in bootstrapper.cc. 85 // __lookupSetter__ is added in bootstrapper.cc.
80 ]); 86 ]);
81 87
82 88
83 // ---------------------------------------------------------------------------- 89 // ----------------------------------------------------------------------------
(...skipping 16 matching lines...) Expand all
100 106
101 // ---------------------------------------------------------------------------- 107 // ----------------------------------------------------------------------------
102 // Exports 108 // Exports
103 109
104 utils.Export(function(to) { 110 utils.Export(function(to) {
105 to.GetIterator = GetIterator; 111 to.GetIterator = GetIterator;
106 to.GetMethod = GetMethod; 112 to.GetMethod = GetMethod;
107 to.ObjectHasOwnProperty = GlobalObject.prototype.hasOwnProperty; 113 to.ObjectHasOwnProperty = GlobalObject.prototype.hasOwnProperty;
108 }); 114 });
109 115
116 %InstallToContext([
117 "object_value_of", ObjectValueOf,
118 ]);
119
110 }) 120 })
OLDNEW
« no previous file with comments | « src/debug/debug-evaluate.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698