Revert "Load the array class in the compiler for allocations."

libcore test fails.

This reverts commit cc99df230feb46ba717252f002d0cc2da6828421.

Change-Id: I5bac595acd2b240886062e8c1f11f9095ff6a9ed
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index a2980dc..53b0fdd 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -3801,15 +3801,6 @@
     entrypoint_ = entrypoint;
   }
 
-  HLoadClass* GetLoadClass() const {
-    HInstruction* input = InputAt(0);
-    if (input->IsClinitCheck()) {
-      input = input->InputAt(0);
-    }
-    DCHECK(input->IsLoadClass());
-    return input->AsLoadClass();
-  }
-
   bool IsStringAlloc() const;
 
   DECLARE_INSTRUCTION(NewInstance);
@@ -4364,12 +4355,23 @@
 
 class HNewArray FINAL : public HExpression<2> {
  public:
-  HNewArray(HInstruction* cls, HInstruction* length, uint32_t dex_pc)
-      : HExpression(Primitive::kPrimNot, SideEffects::CanTriggerGC(), dex_pc) {
-    SetRawInputAt(0, cls);
-    SetRawInputAt(1, length);
+  HNewArray(HInstruction* length,
+            HCurrentMethod* current_method,
+            uint32_t dex_pc,
+            dex::TypeIndex type_index,
+            const DexFile& dex_file,
+            QuickEntrypointEnum entrypoint)
+      : HExpression(Primitive::kPrimNot, SideEffects::CanTriggerGC(), dex_pc),
+        type_index_(type_index),
+        dex_file_(dex_file),
+        entrypoint_(entrypoint) {
+    SetRawInputAt(0, length);
+    SetRawInputAt(1, current_method);
   }
 
+  dex::TypeIndex GetTypeIndex() const { return type_index_; }
+  const DexFile& GetDexFile() const { return dex_file_; }
+
   // Calls runtime so needs an environment.
   bool NeedsEnvironment() const OVERRIDE { return true; }
 
@@ -4378,18 +4380,15 @@
 
   bool CanBeNull() const OVERRIDE { return false; }
 
-  HLoadClass* GetLoadClass() const {
-    DCHECK(InputAt(0)->IsLoadClass());
-    return InputAt(0)->AsLoadClass();
-  }
-
-  HInstruction* GetLength() const {
-    return InputAt(1);
-  }
+  QuickEntrypointEnum GetEntrypoint() const { return entrypoint_; }
 
   DECLARE_INSTRUCTION(NewArray);
 
  private:
+  const dex::TypeIndex type_index_;
+  const DexFile& dex_file_;
+  const QuickEntrypointEnum entrypoint_;
+
   DISALLOW_COPY_AND_ASSIGN(HNewArray);
 };
 
@@ -5892,10 +5891,7 @@
 
   bool CanThrow() const OVERRIDE { return true; }
 
-  HLoadClass* GetLoadClass() const {
-    DCHECK(InputAt(0)->IsLoadClass());
-    return InputAt(0)->AsLoadClass();
-  }
+  HLoadClass* GetLoadClass() const { return InputAt(0)->AsLoadClass(); }
 
   DECLARE_INSTRUCTION(ClinitCheck);
 
@@ -6761,23 +6757,6 @@
   std::copy_backward(blocks->begin() + after + 1u, blocks->begin() + old_size, blocks->end());
 }
 
-/*
- * Hunt "under the hood" of array lengths (leading to array references),
- * null checks (also leading to array references), and new arrays
- * (leading to the actual length). This makes it more likely related
- * instructions become actually comparable.
- */
-inline HInstruction* HuntForDeclaration(HInstruction* instruction) {
-  while (instruction->IsArrayLength() ||
-         instruction->IsNullCheck() ||
-         instruction->IsNewArray()) {
-    instruction = instruction->IsNewArray()
-        ? instruction->AsNewArray()->GetLength()
-        : instruction->InputAt(0);
-  }
-  return instruction;
-}
-
 }  // namespace art
 
 #endif  // ART_COMPILER_OPTIMIZING_NODES_H_