Reviewers: Yang,

Message:
Hey Yang,

This was missing from the ToObject CL. Adds support for %_ToObject in
crankshafted builtins (which is necessary for Speedometer).
Please take a look.

Thanks,
Benedikt

Description:
[crankshaft] Properly optimize %_ToObject.

BUG=chromium:516423
LOG=n

Please review this at https://codereview.chromium.org/1277153003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+10, -0 lines):
  M src/hydrogen.h
  M src/hydrogen.cc


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 794a38b8e4d4faa0f703c5e520fdc69e6c734e60..404cfa7ee12d0830cab41d1fca99d567e625ccad 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -12100,6 +12100,15 @@ void HOptimizedGraphBuilder::GenerateIsObject(CallRuntime* call) {
 }


+void HOptimizedGraphBuilder::GenerateToObject(CallRuntime* call) {
+  DCHECK_EQ(1, call->arguments()->length());
+  CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
+  HValue* value = Pop();
+  HValue* result = BuildToObject(value);
+  return ast_context()->ReturnValue(result);
+}
+
+
 void HOptimizedGraphBuilder::GenerateIsJSProxy(CallRuntime* call) {
   DCHECK(call->arguments()->length() == 1);
   CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index 04db7148ac40043d005e4281225ace98821f1a8c..0790d74a2591ee6ea4dd59c9ef472e2b215471cc 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -2197,6 +2197,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
   F(TwoByteSeqStringSetChar)           \
   F(ObjectEquals)                      \
   F(IsObject)                          \
+  F(ToObject)                          \
   F(IsFunction)                        \
   F(IsUndetectableObject)              \
   F(IsSpecObject)                      \


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to