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

Unified Diff: src/runtime.js

Issue 1266013006: [stubs] Unify (and optimize) implementation of ToObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing support for %_ToObject in TurboFan and Crankshaft. Created 5 years, 5 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 | « src/ppc/interface-descriptors-ppc.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index 63a733fcb614ea249ba2469695a0ab2f1cf3aa0e..000d49756563dc02e5f3ce310d5cca641d7d1c67 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -58,7 +58,6 @@ var APPLY_PREPARE;
var REFLECT_APPLY_PREPARE;
var REFLECT_CONSTRUCT_PREPARE;
var STACK_OVERFLOW;
-var TO_OBJECT;
var TO_NUMBER;
var TO_STRING;
var TO_NAME;
@@ -76,7 +75,6 @@ var $toInteger;
var $toLength;
var $toName;
var $toNumber;
-var $toObject;
var $toPositiveInteger;
var $toPrimitive;
var $toString;
@@ -512,7 +510,7 @@ SHR_STRONG = function SHR_STRONG(y) {
// ECMA-262, section 11.4.1, page 46.
DELETE = function DELETE(key, language_mode) {
- return %DeleteProperty(%$toObject(this), key, language_mode);
+ return %DeleteProperty(TO_OBJECT(this), key, language_mode);
}
@@ -730,12 +728,6 @@ STACK_OVERFLOW = function STACK_OVERFLOW(length) {
}
-// Convert the receiver to an object - forward to ToObject.
-TO_OBJECT = function TO_OBJECT() {
- return %$toObject(this);
-}
-
-
// Convert the receiver to a number - forward to ToNumber.
TO_NUMBER = function TO_NUMBER() {
return %$toNumber(this);
@@ -832,20 +824,6 @@ function ToName(x) {
}
-// ECMA-262, section 9.9, page 36.
-function ToObject(x) {
- if (IS_STRING(x)) return new GlobalString(x);
- if (IS_NUMBER(x)) return new GlobalNumber(x);
- if (IS_BOOLEAN(x)) return new GlobalBoolean(x);
- if (IS_SYMBOL(x)) return %NewSymbolWrapper(x);
- if (IS_FLOAT32X4(x)) return %NewFloat32x4Wrapper(x);
- if (IS_NULL_OR_UNDEFINED(x) && !IS_UNDETECTABLE(x)) {
- throw MakeTypeError(kUndefinedOrNullToObject);
- }
- return x;
-}
-
-
// ECMA-262, section 9.4, page 34.
function ToInteger(x) {
if (%_IsSmi(x)) return x;
@@ -1006,7 +984,6 @@ $toInteger = ToInteger;
$toLength = ToLength;
$toName = ToName;
$toNumber = ToNumber;
-$toObject = ToObject;
$toPositiveInteger = ToPositiveInteger;
$toPrimitive = ToPrimitive;
$toString = ToString;
« no previous file with comments | « src/ppc/interface-descriptors-ppc.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698