Revision: 23670
Author:   [email protected]
Date:     Thu Sep  4 05:37:17 2014 UTC
Log:      X87:  Unify some PlatformCodeStubs

port r23631.

original commit message:

  Unify some PlatformCodeStubs

BUG=
[email protected]

Review URL: https://codereview.chromium.org/540763002

Patch from Jing Bao <[email protected]>.
https://code.google.com/p/v8/source/detail?r=23670

Modified:
 /branches/bleeding_edge/src/x87/code-stubs-x87.cc
 /branches/bleeding_edge/src/x87/code-stubs-x87.h

=======================================
--- /branches/bleeding_edge/src/x87/code-stubs-x87.cc Wed Sep 3 07:48:57 2014 UTC +++ /branches/bleeding_edge/src/x87/code-stubs-x87.cc Thu Sep 4 05:37:17 2014 UTC
@@ -1437,18 +1437,10 @@

   // Inline comparison of ASCII strings.
   if (cc == equal) {
-    StringCompareStub::GenerateFlatAsciiStringEquals(masm,
-                                                     edx,
-                                                     eax,
-                                                     ecx,
-                                                     ebx);
+    StringHelper::GenerateFlatAsciiStringEquals(masm, edx, eax, ecx, ebx);
   } else {
-    StringCompareStub::GenerateCompareFlatAsciiStrings(masm,
-                                                       edx,
-                                                       eax,
-                                                       ecx,
-                                                       ebx,
-                                                       edi);
+    StringHelper::GenerateCompareFlatAsciiStrings(masm, edx, eax, ecx, ebx,
+                                                  edi);
   }
 #ifdef DEBUG
   __ Abort(kUnexpectedFallThroughFromStringComparison);
@@ -2871,11 +2863,10 @@
 }


-void StringCompareStub::GenerateFlatAsciiStringEquals(MacroAssembler* masm,
-                                                      Register left,
-                                                      Register right,
-                                                      Register scratch1,
-                                                      Register scratch2) {
+void StringHelper::GenerateFlatAsciiStringEquals(MacroAssembler* masm,
+ Register left, Register right,
+                                                 Register scratch1,
+                                                 Register scratch2) {
   Register length = scratch1;

   // Compare lengths.
@@ -2907,12 +2898,9 @@
 }


-void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
-                                                        Register left,
-                                                        Register right,
-                                                        Register scratch1,
-                                                        Register scratch2,
- Register scratch3) {
+void StringHelper::GenerateCompareFlatAsciiStrings(
+    MacroAssembler* masm, Register left, Register right, Register scratch1,
+    Register scratch2, Register scratch3) {
   Counters* counters = masm->isolate()->counters();
   __ IncrementCounter(counters->string_compare_native(), 1);

@@ -2973,13 +2961,9 @@
 }


-void StringCompareStub::GenerateAsciiCharsCompareLoop(
-    MacroAssembler* masm,
-    Register left,
-    Register right,
-    Register length,
-    Register scratch,
-    Label* chars_not_equal,
+void StringHelper::GenerateAsciiCharsCompareLoop(
+    MacroAssembler* masm, Register left, Register right, Register length,
+    Register scratch, Label* chars_not_equal,
     Label::Distance chars_not_equal_near) {
   // Change index to run from -length to -1 by adding length to string
   // start. This means that loop ends when index reaches zero, which
@@ -3033,7 +3017,7 @@
   __ pop(ecx);
   __ add(esp, Immediate(2 * kPointerSize));
   __ push(ecx);
-  GenerateCompareFlatAsciiStrings(masm, edx, eax, ecx, ebx, edi);
+ StringHelper::GenerateCompareFlatAsciiStrings(masm, edx, eax, ecx, ebx, edi);

   // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
   // tagged as a small integer.
@@ -3306,11 +3290,10 @@

   // Compare flat ASCII strings. Returns when done.
   if (equality) {
-    StringCompareStub::GenerateFlatAsciiStringEquals(
-        masm, left, right, tmp1, tmp2);
+ StringHelper::GenerateFlatAsciiStringEquals(masm, left, right, tmp1, tmp2);
   } else {
-    StringCompareStub::GenerateCompareFlatAsciiStrings(
-        masm, left, right, tmp1, tmp2, tmp3);
+ StringHelper::GenerateCompareFlatAsciiStrings(masm, left, right, tmp1, tmp2,
+                                                  tmp3);
   }

   // Handle more complex cases in runtime.
=======================================
--- /branches/bleeding_edge/src/x87/code-stubs-x87.h Wed Sep 3 04:18:06 2014 UTC +++ /branches/bleeding_edge/src/x87/code-stubs-x87.h Thu Sep 4 05:37:17 2014 UTC
@@ -16,22 +16,6 @@
                      Label* call_generic_code);


-class StoreBufferOverflowStub : public PlatformCodeStub {
- public:
-  explicit StoreBufferOverflowStub(Isolate* isolate)
-      : PlatformCodeStub(isolate) { }
-
-  void Generate(MacroAssembler* masm);
-
-  static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
-  virtual bool SometimesSetsUpAFrame() { return false; }
-
- private:
-  Major MajorKey() const { return StoreBufferOverflow; }
-  uint32_t MinorKey() const { return 0; }
-};
-
-
 class StringHelper : public AllStatic {
  public:
   // Generate code for copying characters using the rep movs instruction.
@@ -49,45 +33,24 @@
                                Register hash,
                                Register character,
                                Register scratch);
+
   static void GenerateHashAddCharacter(MacroAssembler* masm,
                                        Register hash,
                                        Register character,
                                        Register scratch);
+
   static void GenerateHashGetHash(MacroAssembler* masm,
                                   Register hash,
                                   Register scratch);
-
- private:
-  DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
-};
-
-
-class SubStringStub: public PlatformCodeStub {
- public:
-  explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
-
- private:
-  Major MajorKey() const { return SubString; }
-  uint32_t MinorKey() const { return 0; }
-
-  void Generate(MacroAssembler* masm);
-};
-
-
-class StringCompareStub: public PlatformCodeStub {
- public:
- explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { }

   // Compares two flat ASCII strings and returns result in eax.
   static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
-                                              Register left,
-                                              Register right,
+ Register left, Register right,
                                               Register scratch1,
                                               Register scratch2,
                                               Register scratch3);

-  // Compares two flat ASCII strings for equality and returns result
-  // in eax.
+ // Compares two flat ASCII strings for equality and returns result in eax.
   static void GenerateFlatAsciiStringEquals(MacroAssembler* masm,
                                             Register left,
                                             Register right,
@@ -95,10 +58,6 @@
                                             Register scratch2);

  private:
-  virtual Major MajorKey() const { return StringCompare; }
-  virtual uint32_t MinorKey() const { return 0; }
-  virtual void Generate(MacroAssembler* masm);
-
   static void GenerateAsciiCharsCompareLoop(
       MacroAssembler* masm,
       Register left,
@@ -107,6 +66,8 @@
       Register scratch,
       Label* chars_not_equal,
       Label::Distance chars_not_equal_near = Label::kFar);
+
+  DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
 };


--
--
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/d/optout.

Reply via email to