Support passing arguments to invoke-static* instructions.

- Stop using the frame pointer for accessing locals.
- Stop emulating a stack when doing code generation. Instead,
  rely on dex register model, where instructions only reference
  registers.

Change-Id: Id51bd7d33ac430cb87a53c9f4b0c864eeb1006f9
diff --git a/compiler/optimizing/code_generator_x86.h b/compiler/optimizing/code_generator_x86.h
index 505237b..dd5044f 100644
--- a/compiler/optimizing/code_generator_x86.h
+++ b/compiler/optimizing/code_generator_x86.h
@@ -23,9 +23,6 @@
 
 namespace art {
 
-class Assembler;
-class Label;
-
 namespace x86 {
 
 class LocationsBuilderX86 : public HGraphVisitor {
@@ -43,12 +40,11 @@
   DISALLOW_COPY_AND_ASSIGN(LocationsBuilderX86);
 };
 
+class CodeGeneratorX86;
+
 class InstructionCodeGeneratorX86 : public HGraphVisitor {
  public:
-  explicit InstructionCodeGeneratorX86(HGraph* graph, CodeGenerator* codegen)
-      : HGraphVisitor(graph),
-        assembler_(codegen->GetAssembler()),
-        codegen_(codegen) { }
+  InstructionCodeGeneratorX86(HGraph* graph, CodeGeneratorX86* codegen);
 
 #define DECLARE_VISIT_INSTRUCTION(name)     \
   virtual void Visit##name(H##name* instr);
@@ -59,11 +55,11 @@
 
   void LoadCurrentMethod(Register reg);
 
-  Assembler* GetAssembler() const { return assembler_; }
+  X86Assembler* GetAssembler() const { return assembler_; }
 
  private:
-  Assembler* const assembler_;
-  CodeGenerator* const codegen_;
+  X86Assembler* const assembler_;
+  CodeGeneratorX86* const codegen_;
 
   DISALLOW_COPY_AND_ASSIGN(InstructionCodeGeneratorX86);
 };
@@ -76,12 +72,10 @@
         instruction_visitor_(graph, this) { }
   virtual ~CodeGeneratorX86() { }
 
- protected:
   virtual void GenerateFrameEntry() OVERRIDE;
   virtual void GenerateFrameExit() OVERRIDE;
   virtual void Bind(Label* label) OVERRIDE;
-  virtual void Move(HInstruction* instruction, Location location) OVERRIDE;
-  virtual void Push(HInstruction* instruction, Location location) OVERRIDE;
+  virtual void Move(HInstruction* instruction, Location location, HInstruction* move_for) OVERRIDE;
 
   virtual HGraphVisitor* GetLocationBuilder() OVERRIDE {
     return &location_builder_;
@@ -95,6 +89,8 @@
     return &assembler_;
   }
 
+  int32_t GetStackSlot(HLocal* local) const;
+
  private:
   LocationsBuilderX86 location_builder_;
   InstructionCodeGeneratorX86 instruction_visitor_;