Reviewers: mvstanton,

https://codereview.chromium.org/303583002/diff/1/src/hydrogen-instructions.cc
File src/hydrogen-instructions.cc (right):

https://codereview.chromium.org/303583002/diff/1/src/hydrogen-instructions.cc#newcode2907
src/hydrogen-instructions.cc:2907: if (representation().IsExternal())
return false;
On 2014/05/27 14:49:25, mvstanton wrote:
What is the reason for this change out of curiousity?

This allows us to emit external pointers that are constants, e.g. for
the external buffer that points to the KeyedLoad name cache used be the
generic keyed load stub.

Description:
Small changes in preparation for Hydrogen-generated KeyedLoadGeneric

R=mvstan...@chromium.org

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

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

Affected files (+13, -1 lines):
  M src/arm/lithium-arm.h
  M src/arm64/lithium-arm64.h
  M src/hydrogen-instructions.h
  M src/hydrogen-instructions.cc
  M src/ia32/lithium-ia32.h
  M src/mips/lithium-mips.h
  M src/x64/lithium-x64.h


Index: src/arm/lithium-arm.h
diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h
index de52883f711792c47dd45e456bf05ca07742eea6..7675ef28d1a5419fe9929455139035713da30fd3 100644
--- a/src/arm/lithium-arm.h
+++ b/src/arm/lithium-arm.h
@@ -424,6 +424,7 @@ class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> {

 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> {
  public:
+  virtual bool IsControl() const V8_OVERRIDE { return true; }
   DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
   DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
 };
Index: src/arm64/lithium-arm64.h
diff --git a/src/arm64/lithium-arm64.h b/src/arm64/lithium-arm64.h
index 72ae57db3c92819935e66ea32bd2f1278c07e45d..1da3dd83666dde1219876c5b08a6904a02ad5c61 100644
--- a/src/arm64/lithium-arm64.h
+++ b/src/arm64/lithium-arm64.h
@@ -1288,6 +1288,7 @@ class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {

 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> {
  public:
+  virtual bool IsControl() const V8_OVERRIDE { return true; }
   DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
   DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
 };
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 2f8c2da59238934136d4b82c689580b5e3998447..e4ad0cde4dff944a192a7943cdf785add212b5f2 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2904,6 +2904,7 @@ bool HConstant::EmitAtUses() {
   if (UseCount() == 0) return true;
   if (IsCell()) return false;
   if (representation().IsDouble()) return false;
+  if (representation().IsExternal()) return false;
   return true;
 }

Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 4f83aafa72e0515cf4a419f1d1cc16f25ba29a81..29da29e60fd6802579e043c9f69810eae08ac04c 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -7776,6 +7776,8 @@ class HForInCacheArray V8_FINAL : public HTemplateInstruction<2> {

 class HLoadFieldByIndex V8_FINAL : public HTemplateInstruction<2> {
  public:
+  DECLARE_INSTRUCTION_FACTORY_P2(HLoadFieldByIndex, HValue*, HValue*);
+
   HLoadFieldByIndex(HValue* object,
                     HValue* index) {
     SetOperandAt(0, object);
@@ -7785,7 +7787,11 @@ class HLoadFieldByIndex V8_FINAL : public HTemplateInstruction<2> {
   }

virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
-    return Representation::Tagged();
+    if (index == 1) {
+      return Representation::Smi();
+    } else {
+      return Representation::Tagged();
+    }
   }

   HValue* object() { return OperandAt(0); }
Index: src/ia32/lithium-ia32.h
diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h
index 5a612b75175d81830c695423864baaaf39232f99..e7b0d5b429390f0e613d9b7b679b122e5e1ead2d 100644
--- a/src/ia32/lithium-ia32.h
+++ b/src/ia32/lithium-ia32.h
@@ -415,6 +415,7 @@ class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> {

 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> {
  public:
+  virtual bool IsControl() const V8_OVERRIDE { return true; }
   DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
   DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
 };
Index: src/mips/lithium-mips.h
diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h
index 954974ce6b3aa23e4cc02ffe51d031f6003ad7ab..cf6be5941f62da328688ea29d6510ac0621a7b02 100644
--- a/src/mips/lithium-mips.h
+++ b/src/mips/lithium-mips.h
@@ -421,6 +421,7 @@ class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> {

 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> {
  public:
+  virtual bool IsControl() const V8_OVERRIDE { return true; }
   DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
   DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
 };
Index: src/x64/lithium-x64.h
diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h
index 3f228249f3a2fcc0c2c12a1c3ba5480eb52b14ac..ef407898f0accd78e0f0a53513644f4b12778cd5 100644
--- a/src/x64/lithium-x64.h
+++ b/src/x64/lithium-x64.h
@@ -429,6 +429,7 @@ class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> {

 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> {
  public:
+  virtual bool IsControl() const V8_OVERRIDE { return true; }
   DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
   DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
 };


--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to