Reviewers: Michael Starzinger,

Description:
Removed some useless/dead code regarding CompileTimeValues.

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

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

Affected files:
  M src/arm/full-codegen-arm.cc
  M src/ia32/full-codegen-ia32.cc
  M src/mips/full-codegen-mips.cc
  M src/parser.h
  M src/parser.cc
  M src/x64/full-codegen-x64.cc


Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index 4c61243a4a2c502264b493046b7641da3fdcabe5..357f0afd10d0daf86cad8659ee0e12343a7b3dbd 100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -1829,10 +1829,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
     Expression* subexpr = subexprs->at(i);
// If the subexpression is a literal or a simple materialized literal it
     // is already set in the cloned array.
-    if (subexpr->AsLiteral() != NULL ||
-        CompileTimeValue::IsCompileTimeValue(subexpr)) {
-      continue;
-    }
+    if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;

     if (!result_saved) {
       __ push(r0);
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index c55554fd1be1d96a831760f8a32874ef1e211f1b..d04fdd4e65fa6726766afd21d572df42d5207998 100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -1782,10 +1782,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
     Expression* subexpr = subexprs->at(i);
// If the subexpression is a literal or a simple materialized literal it
     // is already set in the cloned array.
-    if (subexpr->AsLiteral() != NULL ||
-        CompileTimeValue::IsCompileTimeValue(subexpr)) {
-      continue;
-    }
+    if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;

     if (!result_saved) {
       __ push(eax);  // array literal.
Index: src/mips/full-codegen-mips.cc
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
index 7ef9fd6c04031719d2826791f308a264815b44fd..bf13d919b17ef2fd4a6ba69cfa87bc1f6038648e 100644
--- a/src/mips/full-codegen-mips.cc
+++ b/src/mips/full-codegen-mips.cc
@@ -1834,10 +1834,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
     Expression* subexpr = subexprs->at(i);
// If the subexpression is a literal or a simple materialized literal it
     // is already set in the cloned array.
-    if (subexpr->AsLiteral() != NULL ||
-        CompileTimeValue::IsCompileTimeValue(subexpr)) {
-      continue;
-    }
+    if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;

     if (!result_saved) {
       __ push(v0);  // array literal
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 2ba36d3956fedd18806f807e3fd5e644a1ce94c6..51326793f456ba5a7eba7d653807b8d1b91ff4ff 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -3734,18 +3734,6 @@ bool CompileTimeValue::IsCompileTimeValue(Expression* expression) {
 }


-bool CompileTimeValue::ArrayLiteralElementNeedsInitialization(
-    Expression* value) {
-  // If value is a literal the property value is already set in the
-  // boilerplate object.
-  if (value->AsLiteral() != NULL) return false;
-  // If value is a materialized literal the property value is already set
-  // in the boilerplate object if it is simple.
-  if (CompileTimeValue::IsCompileTimeValue(value)) return false;
-  return true;
-}
-
-
 Handle<FixedArray> CompileTimeValue::GetValue(Expression* expression) {
   Factory* factory = Isolate::Current()->factory();
   ASSERT(IsCompileTimeValue(expression));
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index 38633b0b42973e60632bae8b47455bc657162ff5..5f4c6863c7a3f7bc2a3914f33653ae722c0ad338 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -888,8 +888,6 @@ class CompileTimeValue: public AllStatic {

   static bool IsCompileTimeValue(Expression* expression);

-  static bool ArrayLiteralElementNeedsInitialization(Expression* value);
-
   // Get the value as a compile time value.
   static Handle<FixedArray> GetValue(Expression* expression);

Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index e53c4642910f3ea9a9fb3ed9f638df839ab7d417..7732a1d400ede5dab19ef759e0bc202223b3d830 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -1806,10 +1806,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
     Expression* subexpr = subexprs->at(i);
// If the subexpression is a literal or a simple materialized literal it
     // is already set in the cloned array.
-    if (subexpr->AsLiteral() != NULL ||
-        CompileTimeValue::IsCompileTimeValue(subexpr)) {
-      continue;
-    }
+    if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;

     if (!result_saved) {
       __ push(rax);  // array literal


--
--
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