Revision: 3982
Author: [email protected]
Date: Mon Mar  1 00:32:54 2010
Log: Update MIPS port to support recent changes

This lands http://codereview.chromium.org/660244.

Patch by Alexandre Rames from Sigma Designs Inc.
Review URL: http://codereview.chromium.org/661268
http://code.google.com/p/v8/source/detail?r=3982

Modified:
 /branches/bleeding_edge/src/mips/codegen-mips.cc
 /branches/bleeding_edge/src/mips/codegen-mips.h
 /branches/bleeding_edge/src/mips/fast-codegen-mips.cc
 /branches/bleeding_edge/src/mips/full-codegen-mips.cc
 /branches/bleeding_edge/src/mips/ic-mips.cc
 /branches/bleeding_edge/src/mips/jump-target-mips.cc
 /branches/bleeding_edge/src/mips/macro-assembler-mips.cc
 /branches/bleeding_edge/src/mips/macro-assembler-mips.h
 /branches/bleeding_edge/src/mips/stub-cache-mips.cc
 /branches/bleeding_edge/src/mips/virtual-frame-mips.cc
 /branches/bleeding_edge/src/mips/virtual-frame-mips.h

=======================================
--- /branches/bleeding_edge/src/mips/codegen-mips.cc Fri Feb 26 12:14:20 2010 +++ /branches/bleeding_edge/src/mips/codegen-mips.cc Mon Mar 1 00:32:54 2010
@@ -81,7 +81,7 @@
 // a1: called JS function
 // cp: callee's context

-void CodeGenerator::Generate(CompilationInfo* info, Mode mode) {
+void CodeGenerator::Generate(CompilationInfo* infomode) {
   UNIMPLEMENTED_MIPS();
 }

@@ -467,6 +467,34 @@

 void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
   UNIMPLEMENTED_MIPS();
+
+  // Save callee saved registers on the stack.
+  __ MultiPush(kCalleeSaved | ra.bit());
+
+  // ********** State **********
+  //
+  // * Registers:
+  // a0: entry_address
+  // a1: function
+  // a2: reveiver_pointer
+  // a3: argc
+  //
+  // * Stack:
+  // ---------------------------
+  // args
+  // ---------------------------
+  // 4 args slots
+  // ---------------------------
+  // callee saved registers + ra
+  // ---------------------------
+  //
+  // ***************************
+
+  __ break_(0x1234);
+
+  // Restore callee saved registers from the stack.
+  __ MultiPop(kCalleeSaved | ra.bit());
+
   // Load a result.
   __ li(v0, Operand(0x1234));
   __ jr(ra);
=======================================
--- /branches/bleeding_edge/src/mips/codegen-mips.h     Fri Feb 26 12:14:20 2010
+++ /branches/bleeding_edge/src/mips/codegen-mips.h     Mon Mar  1 00:32:54 2010
@@ -157,11 +157,10 @@
  private:
   // Construction/Destruction.
   explicit CodeGenerator(MacroAssembler* masm);
-  virtual ~CodeGenerator() { delete masm_; }

   // Accessors.
   inline bool is_eval();
-  Scope* scope() const { return scope_; }
+  inline Scope* scope();

   // Generating deferred code.
   void ProcessDeferred();
@@ -184,7 +183,7 @@
 #undef DEF_VISIT

   // Main code generation function
-  void Generate(CompilationInfo* info, Mode mode);
+  void Generate(CompilationInfo* info);

   struct InlineRuntimeLUT {
     void (CodeGenerator::*method)(ZoneList<Expression*>*);
@@ -307,6 +306,7 @@
   friend class JumpTarget;
   friend class Reference;
   friend class FastCodeGenerator;
+  friend class FullCodeGenerator;
   friend class FullCodeGenSyntaxChecker;

   DISALLOW_COPY_AND_ASSIGN(CodeGenerator);
=======================================
--- /branches/bleeding_edge/src/mips/fast-codegen-mips.cc Thu Feb 4 12:36:58 2010 +++ /branches/bleeding_edge/src/mips/fast-codegen-mips.cc Mon Mar 1 00:32:54 2010
@@ -35,6 +35,14 @@

 #define __ ACCESS_MASM(masm_)

+Register FastCodeGenerator::accumulator0() { return no_reg; }
+Register FastCodeGenerator::accumulator1() { return no_reg; }
+Register FastCodeGenerator::scratch0() { return no_reg; }
+Register FastCodeGenerator::scratch1() { return no_reg; }
+Register FastCodeGenerator::receiver_reg() { return no_reg; }
+Register FastCodeGenerator::context_reg() { return no_reg; }
+
+
 void FastCodeGenerator::Generate(CompilationInfo* info) {
   UNIMPLEMENTED_MIPS();
 }
@@ -45,7 +53,17 @@
 }


-void FastCodeGenerator::EmitGlobalVariableLoad(Handle<String> name) {
+void FastCodeGenerator::EmitGlobalVariableLoad(Handle<Object> name) {
+  UNIMPLEMENTED_MIPS();
+}
+
+
+void FastCodeGenerator::EmitThisPropertyLoad(Handle<String> name) {
+  UNIMPLEMENTED_MIPS();
+}
+
+
+void FastCodeGenerator::EmitBitOr() {
   UNIMPLEMENTED_MIPS();
 }

=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Thu Feb 4 12:36:58 2010 +++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Mon Mar 1 00:32:54 2010
@@ -144,6 +144,11 @@
 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
   UNIMPLEMENTED_MIPS();
 }
+
+
+void FullCodeGenerator::VisitAssignment(Assignment* expr) {
+  UNIMPLEMENTED_MIPS();
+}


 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
=======================================
--- /branches/bleeding_edge/src/mips/ic-mips.cc Thu Feb  4 12:36:58 2010
+++ /branches/bleeding_edge/src/mips/ic-mips.cc Mon Mar  1 00:32:54 2010
@@ -90,11 +90,6 @@


 void LoadIC::GenerateMiss(MacroAssembler* masm) {
-  Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss)));
-}
-
-
-void LoadIC::Generate(MacroAssembler* masm, const ExternalReference& f) {
   UNIMPLEMENTED_MIPS();
 }

@@ -120,11 +115,6 @@


 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
-  Generate(masm, ExternalReference(IC_Utility(kKeyedLoadIC_Miss)));
-}
-
-
-void KeyedLoadIC::Generate(MacroAssembler* masm, const ExternalReference& f) {
   UNIMPLEMENTED_MIPS();
 }

@@ -145,24 +135,23 @@
 }


-void KeyedStoreIC::Generate(MacroAssembler* masm,
-                            const ExternalReference& f) {
+void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
   UNIMPLEMENTED_MIPS();
 }


-void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
+void KeyedStoreIC::GenerateExternalArray(MacroAssembler* masm,
+                                         ExternalArrayType array_type) {
   UNIMPLEMENTED_MIPS();
 }


-void KeyedStoreIC::GenerateExternalArray(MacroAssembler* masm,
-                                         ExternalArrayType array_type) {
+void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
   UNIMPLEMENTED_MIPS();
 }


-void KeyedStoreIC::GenerateExtendStorage(MacroAssembler* masm) {
+void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
   UNIMPLEMENTED_MIPS();
 }

@@ -172,12 +161,12 @@
 }


-void StoreIC::GenerateExtendStorage(MacroAssembler* masm) {
+void StoreIC::GenerateMiss(MacroAssembler* masm) {
   UNIMPLEMENTED_MIPS();
 }


-void StoreIC::GenerateMiss(MacroAssembler* masm) {
+void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
   UNIMPLEMENTED_MIPS();
 }

=======================================
--- /branches/bleeding_edge/src/mips/jump-target-mips.cc Thu Feb 4 12:36:58 2010 +++ /branches/bleeding_edge/src/mips/jump-target-mips.cc Mon Mar 1 00:32:54 2010
@@ -31,6 +31,7 @@
 #include "codegen-inl.h"
 #include "jump-target-inl.h"
 #include "register-allocator-inl.h"
+#include "virtual-frame-inl.h"

 namespace v8 {
 namespace internal {
=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Wed Feb 24 00:33:51 2010 +++ /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Mon Mar 1 00:32:54 2010
@@ -422,7 +422,7 @@
 // Trashes the at register if no scratch register is provided.
 void MacroAssembler::Branch(Condition cond, int16_t offset, Register rs,
                             const Operand& rt, Register scratch) {
-  Register r2;
+  Register r2 = no_reg;
   if (rt.is_reg()) {
     // We don't want any other register but scratch clobbered.
     ASSERT(!scratch.is(rs) && !scratch.is(rt.rm_));
@@ -489,7 +489,7 @@

 void MacroAssembler::Branch(Condition cond,  Label* L, Register rs,
                             const Operand& rt, Register scratch) {
-  Register r2;
+  Register r2 = no_reg;
   if (rt.is_reg()) {
     r2 = rt.rm_;
   } else if (cond != cc_always) {
@@ -559,7 +559,7 @@
 // cases, so we keep slt and add an intermediate third instruction.
void MacroAssembler::BranchAndLink(Condition cond, int16_t offset, Register rs,
                                    const Operand& rt, Register scratch) {
-  Register r2;
+  Register r2 = no_reg;
   if (rt.is_reg()) {
     r2 = rt.rm_;
   } else if (cond != cc_always) {
@@ -634,7 +634,7 @@

 void MacroAssembler::BranchAndLink(Condition cond, Label* L, Register rs,
                                    const Operand& rt, Register scratch) {
-  Register r2;
+  Register r2 = no_reg;
   if (rt.is_reg()) {
     r2 = rt.rm_;
   } else if (cond != cc_always) {
@@ -785,6 +785,16 @@
 void MacroAssembler::Call(Label* target) {
   UNIMPLEMENTED_MIPS();
 }
+
+
+#ifdef ENABLE_DEBUGGER_SUPPORT
+ // ---------------------------------------------------------------------------
+  // Debugger Support
+
+  void MacroAssembler::DebugBreak() {
+    UNIMPLEMENTED_MIPS();
+  }
+#endif


// ---------------------------------------------------------------------------
=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.h Wed Feb 24 00:33:51 2010 +++ /branches/bleeding_edge/src/mips/macro-assembler-mips.h Mon Mar 1 00:32:54 2010
@@ -115,11 +115,7 @@
                 Heap::RootListIndex index,
                 Condition cond, Register src1, const Operand& src2);

-  // Sets the remembered set bit for [address+offset], where address is the
- // address of the heap object 'object'. The address must be in the first 8K
-  // of an allocated page. The 'scratch' register is used in the
-  // implementation and all 3 registers are clobbered by the operation, as
-  // well as the ip register.
+  // Sets the remembered set bit for [address+offset].
   void RecordWrite(Register object, Register offset, Register scratch);


@@ -182,19 +178,8 @@


   // Push multiple registers on the stack.
-  // With MultiPush, lower registers are pushed first on the stack.
-  // For example if you push t0, t1, s0, and ra you get:
-  // |                       |
-  // |-----------------------|
-  // |         t0            |                     +
-  // |-----------------------|                    |
-  // |         t1            |                    |
-  // |-----------------------|                    |
-  // |         s0            |                    v
-  // |-----------------------|                     -
-  // |         ra            |
-  // |-----------------------|
-  // |                       |
+  // Registers are saved in numerical order, with higher numbered registers
+  // saved in higher memory addresses
   void MultiPush(RegList regs);
   void MultiPushReversed(RegList regs);
   void Push(Register src) {
@@ -222,6 +207,20 @@
   void Pop() {
     Add(sp, sp, Operand(kPointerSize));
   }
+
+
+#ifdef ENABLE_DEBUGGER_SUPPORT
+ // ---------------------------------------------------------------------------
+  // Debugger Support
+
+  void SaveRegistersToMemory(RegList regs);
+  void RestoreRegistersFromMemory(RegList regs);
+  void CopyRegistersFromMemoryToStack(Register base, RegList regs);
+  void CopyRegistersFromStackToMemory(Register base,
+                                      Register scratch,
+                                      RegList regs);
+  void DebugBreak();
+#endif


// ---------------------------------------------------------------------------
=======================================
--- /branches/bleeding_edge/src/mips/stub-cache-mips.cc Thu Feb 4 12:36:58 2010 +++ /branches/bleeding_edge/src/mips/stub-cache-mips.cc Mon Mar 1 00:32:54 2010
@@ -70,20 +70,6 @@
                                            Label* miss_label) {
   UNIMPLEMENTED_MIPS();
 }
-
-
-// Generate code to load the length from a string object and return the length.
-// If the receiver object is not a string or a wrapped string object the
-// execution continues at the miss label. The register containing the
-// receiver is potentially clobbered.
-void StubCompiler::GenerateLoadStringLength2(MacroAssembler* masm,
-                                             Register receiver,
-                                             Register scratch1,
-                                             Register scratch2,
-                                             Label* miss) {
-  UNIMPLEMENTED_MIPS();
-  __ break_(0x249);
-}


 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
@@ -99,7 +85,6 @@
 // After executing generated code, the receiver_reg and name_reg
 // may be clobbered.
 void StubCompiler::GenerateStoreField(MacroAssembler* masm,
-                                      Builtins::Name storage_extend,
                                       JSObject* object,
                                       int index,
                                       Map* transition,
@@ -118,18 +103,6 @@

 #undef __
 #define __ ACCESS_MASM(masm())
-
-
-Register StubCompiler::CheckPrototypes(JSObject* object,
-                                       Register object_reg,
-                                       JSObject* holder,
-                                       Register holder_reg,
-                                       Register scratch,
-                                       String* name,
-                                       Label* miss) {
-  UNIMPLEMENTED_MIPS();
-  return at;    // UNIMPLEMENTED RETURN
-}


 void StubCompiler::GenerateLoadField(JSObject* object,
@@ -192,7 +165,7 @@
 }


-Object* CallStubCompiler::CompileCallField(Object* object,
+Object* CallStubCompiler::CompileCallField(JSObject* object,
                                            JSObject* holder,
                                            int index,
                                            String* name) {
@@ -211,7 +184,7 @@
 }


-Object* CallStubCompiler::CompileCallInterceptor(Object* object,
+Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
                                                  JSObject* holder,
                                                  String* name) {
   UNIMPLEMENTED_MIPS();
=======================================
--- /branches/bleeding_edge/src/mips/virtual-frame-mips.cc Thu Feb 4 12:36:58 2010 +++ /branches/bleeding_edge/src/mips/virtual-frame-mips.cc Mon Mar 1 00:32:54 2010
@@ -32,6 +32,7 @@
 #include "codegen-inl.h"
 #include "register-allocator-inl.h"
 #include "scopes.h"
+#include "virtual-frame-inl.h"

 namespace v8 {
 namespace internal {
@@ -41,17 +42,6 @@

 #define __ ACCESS_MASM(masm())

-
-// On entry to a function, the virtual frame already contains the
-// receiver and the parameters.  All initial frame elements are in
-// memory.
-VirtualFrame::VirtualFrame()
-    : elements_(parameter_count() + local_count() + kPreallocatedElements),
-      stack_pointer_(parameter_count()) {  // 0-based index of TOS.
-  UNIMPLEMENTED_MIPS();
-}
-
-
 void VirtualFrame::SyncElementBelowStackPointer(int index) {
   UNREACHABLE();
 }
=======================================
--- /branches/bleeding_edge/src/mips/virtual-frame-mips.h Thu Feb 4 12:36:58 2010 +++ /branches/bleeding_edge/src/mips/virtual-frame-mips.h Mon Mar 1 00:32:54 2010
@@ -61,16 +61,17 @@
   static const int kIllegalIndex = -1;

   // Construct an initial virtual frame on entry to a JS function.
-  VirtualFrame();
+  inline VirtualFrame();

   // Construct a virtual frame as a clone of an existing one.
-  explicit VirtualFrame(VirtualFrame* original);
+  explicit inline VirtualFrame(VirtualFrame* original);

   CodeGenerator* cgen() { return CodeGeneratorScope::Current(); }
   MacroAssembler* masm() { return cgen()->masm(); }

   // Create a duplicate of an existing valid frame element.
-  FrameElement CopyElementAt(int index);
+  FrameElement CopyElementAt(int index,
+                             NumberInfo::Type info = NumberInfo::kUnknown);

   // The number of elements on the virtual frame.
   int element_count() { return elements_.length(); }
@@ -366,9 +367,9 @@
   void EmitMultiPushReversed(RegList regs);  // higher first

   // Push an element on the virtual frame.
-  void Push(Register reg);
-  void Push(Handle<Object> value);
-  void Push(Smi* value) { Push(Handle<Object>(value)); }
+ inline void Push(Register reg, NumberInfo::Type info = NumberInfo::kUnknown);
+  inline void Push(Handle<Object> value);
+  inline void Push(Smi* value);

// Pushing a result invalidates it (its contents become owned by the frame).
   void Push(Result* result) {
@@ -384,7 +385,7 @@
   // Nip removes zero or more elements from immediately below the top
   // of the frame, leaving the previous top-of-frame value on top of
   // the frame.  Nip(k) is equivalent to x = Pop(), Drop(k), Push(x).
-  void Nip(int num_dropped);
+  inline void Nip(int num_dropped);

// This pushes 4 arguments slots on the stack and saves asked 'a' registers
   // 'a' registers are arguments register a0 to a3.
@@ -483,7 +484,7 @@

   // Push a copy of a frame slot (typically a local or parameter) on top of
   // the frame.
-  void PushFrameSlotAt(int index);
+  inline void PushFrameSlotAt(int index);

   // Push a the value of a frame slot (typically a local or parameter) on
   // top of the frame and invalidate the slot.
@@ -534,7 +535,7 @@
   // (via PrepareForCall).
   void RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode);

-  bool Equals(VirtualFrame* other);
+  inline bool Equals(VirtualFrame* other);

   // Classes that need raw access to the elements_ array.
   friend class DeferredCode;

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to