Reviewers: Toon Verwaest,

Description:
Merged r18697 into 3.23 branch.

Fix representation requirement in HReturn.

[email protected]
BUG=

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

SVN Base: https://v8.googlecode.com/svn/branches/3.23

Affected files (+17, -11 lines):
  M src/hydrogen-instructions.h
  M src/hydrogen-instructions.cc
  M src/version.cc
  A + test/mjsunit/regress-333594.js


Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 519fb0ff8092d77421927715a4f732c1bb715cc4..1323337b024b6718e574dd8a0eb14a010940bd39 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2523,6 +2523,7 @@ HConstant::HConstant(Handle<Object> handle, Representation r)
     has_smi_value_ = has_int32_value_ && Smi::IsValid(int32_value_);
     double_value_ = n;
     has_double_value_ = true;
+    // TODO(titzer): if this heap number is new space, tenure a new one.
   } else {
     is_internalized_string_ = handle->IsInternalizedString();
   }
@@ -2721,6 +2722,9 @@ void HConstant::PrintDataTo(StringStream* stream) {
   } else {
     handle(Isolate::Current())->ShortPrint(stream);
   }
+  if (!is_not_in_new_space_) {
+    stream->Add("[new space] ");
+  }
 }


Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index d4beb6e1de2180b9fb903116a2d66b4dc7f21428..045ef932e1ebf94b1c0020a1feeddbf0c6805285 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -1585,6 +1585,8 @@ class HReturn V8_FINAL : public HTemplateControlInstruction<0, 3> {
   DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HReturn, HValue*);

virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
+    // TODO(titzer): require an Int32 input for faster returns.
+    if (index == 2) return Representation::Smi();
     return Representation::Tagged();
   }

Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index ed1354cd501fc1955c05906b0e01635a0affbc5c..c704427cdf21405798104ee726e27c7e57c901f3 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     23
 #define BUILD_NUMBER      17
-#define PATCH_LEVEL       10
+#define PATCH_LEVEL       11
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
Index: test/mjsunit/regress-333594.js
diff --git a/test/mjsunit/regress/regress-334708.js b/test/mjsunit/regress-333594.js
similarity index 90%
copy from test/mjsunit/regress/regress-334708.js
copy to test/mjsunit/regress-333594.js
index f0291bbdab61128baad9df89457d045b66644f1b..6f6dbaafcd64d8b752226a290df525ca200b69a0 100644
--- a/test/mjsunit/regress/regress-334708.js
+++ b/test/mjsunit/regress-333594.js
@@ -27,16 +27,16 @@

 // Flags: --allow-natives-syntax

-function foo(x, y) {
-  return Math.floor(x / y);
-}
+var a = { x: 1.1 };
+a.x = 0;
+var G = a.x;
+var o = { x: {} };

-function bar(x, y) {
-  return foo(x + 1, y + 1);
+function func() {
+  return {x: G};
 }

-foo(16, "4");
-
-bar(64, 2);
-%OptimizeFunctionOnNextCall(bar);
-bar(64, 2);
+func();
+func();
+%OptimizeFunctionOnNextCall(func);
+assertEquals(0, func().x);


--
--
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/groups/opt_out.

Reply via email to