Add support for taking parameters in optimizing compiler.

- Fix stack layout to mimic Quick's.
- Implement some sub operations.

Change-Id: I8cf75a4d29b662381a64f02c0bc61d859482fc4e
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index d6295db..40a7b6f 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -30,7 +30,6 @@
 namespace art {
 
 void CodeGenerator::Compile(CodeAllocator* allocator) {
-  frame_size_ = GetGraph()->GetMaximumNumberOfOutVRegs() * GetWordSize();
   const GrowableArray<HBasicBlock*>* blocks = GetGraph()->GetBlocks();
   DCHECK(blocks->Get(0) == GetGraph()->GetEntryBlock());
   DCHECK(GoesToNextBlock(GetGraph()->GetEntryBlock(), blocks->Get(1)));
@@ -47,16 +46,14 @@
 void CodeGenerator::CompileEntryBlock() {
   HGraphVisitor* location_builder = GetLocationBuilder();
   HGraphVisitor* instruction_visitor = GetInstructionVisitor();
-  // The entry block contains all locals for this method. By visiting the entry block,
-  // we're computing the required frame size.
-  for (HInstructionIterator it(GetGraph()->GetEntryBlock()); !it.Done(); it.Advance()) {
-    HInstruction* current = it.Current();
-    // Instructions in the entry block should not generate code.
-    if (kIsDebugBuild) {
+  if (kIsDebugBuild) {
+    for (HInstructionIterator it(GetGraph()->GetEntryBlock()); !it.Done(); it.Advance()) {
+      HInstruction* current = it.Current();
+      // Instructions in the entry block should not generate code.
       current->Accept(location_builder);
       DCHECK(current->GetLocations() == nullptr);
+      current->Accept(instruction_visitor);
     }
-    current->Accept(instruction_visitor);
   }
   GenerateFrameEntry();
 }