Reviewers: Michael Starzinger,

Message:
Includes some funky "git cl format" stuff... :-/

Description:
Intrinsics in the INLINE_FUNCTION_LIST are now avaliable without '_', too.

This involved renaming apart a few more intrinsics. In the long run,
we want to clean up redundant intrinsics which just delegate.

BUG=v8:3947
LOG=n

Please review this at https://codereview.chromium.org/984963002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+51, -27 lines):
  M src/code-stubs.cc
  M src/compiler/linkage.cc
  M src/compiler/simplified-lowering.cc
  M src/hydrogen.cc
  M src/runtime/runtime.h
  M src/runtime/runtime.cc
  M src/runtime/runtime-regexp.cc
  M src/runtime/runtime-strings.cc
  M src/x64/code-stubs-x64.cc
  M test/mjsunit/regress/string-compare-memcmp.js


Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 6c68271bcda53691b0a8a902f432829ec7785743..0d32028aa74e7cd7c3deef8e4b5ef8c4641e2000 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -684,7 +684,7 @@ void CreateWeakCellStub::InitializeDescriptor(CodeStubDescriptor* d) {}
 void RegExpConstructResultStub::InitializeDescriptor(
     CodeStubDescriptor* descriptor) {
   descriptor->Initialize(
-      Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry);
+      Runtime::FunctionForId(Runtime::kRegExpConstructResultRT)->entry);
 }


@@ -730,7 +730,7 @@ void BinaryOpWithAllocationSiteStub::InitializeDescriptor(


 void StringAddStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
- descriptor->Initialize(Runtime::FunctionForId(Runtime::kStringAdd)->entry); + descriptor->Initialize(Runtime::FunctionForId(Runtime::kStringAddRT)->entry);
 }


Index: src/compiler/linkage.cc
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc
index 8f3f61d1e3b699f08a85d57105a0e92548c98de2..b4c479170e2e72e0189d9da7523ede5067fb9055 100644
--- a/src/compiler/linkage.cc
+++ b/src/compiler/linkage.cc
@@ -119,7 +119,7 @@ bool Linkage::NeedsFrameState(Runtime::FunctionId function) {
     case Runtime::kPushCatchContext:
     case Runtime::kReThrow:
     case Runtime::kSetProperty:  // TODO(jarin): Is it safe?
-    case Runtime::kStringCompare:
+    case Runtime::kStringCompareRT:
     case Runtime::kStringEquals:
     case Runtime::kToFastProperties:  // TODO(jarin): Is it safe?
     case Runtime::kTraceEnter:
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc index 051d3feb88dfd180865c9265589ba8891acab84d..07d0a0da48a0904ea8d595ddd22ecf84f3cffde2 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -1323,7 +1323,7 @@ void SimplifiedLowering::DoStringAdd(Node* node) {
Node* SimplifiedLowering::StringComparison(Node* node, bool requires_ordering) {
   CEntryStub stub(jsgraph()->isolate(), 1);
   Runtime::FunctionId f =
-      requires_ordering ? Runtime::kStringCompare : Runtime::kStringEquals;
+ requires_ordering ? Runtime::kStringCompareRT : Runtime::kStringEquals;
   ExternalReference ref(f, jsgraph()->isolate());
   Operator::Properties props = node->op()->properties();
// TODO(mstarzinger): We should call StringCompareStub here instead, once an
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index d735a6b04fc66ddb8d7212d8e8e26a6820e27afa..475b9ffeb03f692df2671f075918534812902783 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2320,10 +2320,8 @@ HValue* HGraphBuilder::BuildUncheckedStringAdd(
     {
       // Fallback to the runtime to add the two strings.
       Add<HPushArguments>(left, right);
-      Push(Add<HCallRuntime>(
-            isolate()->factory()->empty_string(),
-            Runtime::FunctionForId(Runtime::kStringAdd),
-            2));
+      Push(Add<HCallRuntime>(isolate()->factory()->empty_string(),
+ Runtime::FunctionForId(Runtime::kStringAddRT), 2));
     }
     if_sameencodingandsequential.End();
   }
Index: src/runtime/runtime-regexp.cc
diff --git a/src/runtime/runtime-regexp.cc b/src/runtime/runtime-regexp.cc
index 02b5a94ea4db33fd0fb7ce277e7238eded4b8f50..d7df25622a3d3e7b4f43a29286b8f49fd878f80c 100644
--- a/src/runtime/runtime-regexp.cc
+++ b/src/runtime/runtime-regexp.cc
@@ -779,7 +779,7 @@ RUNTIME_FUNCTION(Runtime_RegExpExecRT) {
 }


-RUNTIME_FUNCTION(Runtime_RegExpConstructResult) {
+RUNTIME_FUNCTION(Runtime_RegExpConstructResultRT) {
   HandleScope handle_scope(isolate);
   DCHECK(args.length() == 3);
   CONVERT_SMI_ARG_CHECKED(size, 0);
@@ -800,6 +800,12 @@ RUNTIME_FUNCTION(Runtime_RegExpConstructResult) {
 }


+RUNTIME_FUNCTION(Runtime_RegExpConstructResult) {
+  SealHandleScope shs(isolate);
+  return __RT_impl_Runtime_RegExpConstructResultRT(args, isolate);
+}
+
+
 static JSRegExp::Flags RegExpFlagsFromString(Handle<String> flags,
                                              bool* success) {
   uint32_t value = JSRegExp::NONE;
Index: src/runtime/runtime-strings.cc
diff --git a/src/runtime/runtime-strings.cc b/src/runtime/runtime-strings.cc
index 9bfd69aca08e6bfc0368d7c830b0d6aac37c937d..89b0d2bfa8fe08e430a19f65397f0d15a46604f7 100644
--- a/src/runtime/runtime-strings.cc
+++ b/src/runtime/runtime-strings.cc
@@ -279,7 +279,7 @@ RUNTIME_FUNCTION(Runtime_StringLocaleCompare) {
 }


-RUNTIME_FUNCTION(Runtime_SubString) {
+RUNTIME_FUNCTION(Runtime_SubStringRT) {
   HandleScope scope(isolate);
   DCHECK(args.length() == 3);

@@ -307,7 +307,13 @@ RUNTIME_FUNCTION(Runtime_SubString) {
 }


-RUNTIME_FUNCTION(Runtime_StringAdd) {
+RUNTIME_FUNCTION(Runtime_SubString) {
+  SealHandleScope shs(isolate);
+  return __RT_impl_Runtime_SubStringRT(args, isolate);
+}
+
+
+RUNTIME_FUNCTION(Runtime_StringAddRT) {
   HandleScope scope(isolate);
   DCHECK(args.length() == 2);
   CONVERT_ARG_HANDLE_CHECKED(String, str1, 0);
@@ -320,6 +326,12 @@ RUNTIME_FUNCTION(Runtime_StringAdd) {
 }


+RUNTIME_FUNCTION(Runtime_StringAdd) {
+  SealHandleScope shs(isolate);
+  return __RT_impl_Runtime_StringAddRT(args, isolate);
+}
+
+
 RUNTIME_FUNCTION(Runtime_InternalizeString) {
   HandleScope handles(isolate);
   RUNTIME_ASSERT(args.length() == 1);
@@ -414,7 +426,7 @@ RUNTIME_FUNCTION(Runtime_CharFromCode) {
 }


-RUNTIME_FUNCTION(Runtime_StringCompare) {
+RUNTIME_FUNCTION(Runtime_StringCompareRT) {
   HandleScope handle_scope(isolate);
   DCHECK(args.length() == 2);

@@ -483,6 +495,12 @@ RUNTIME_FUNCTION(Runtime_StringCompare) {
 }


+RUNTIME_FUNCTION(Runtime_StringCompare) {
+  SealHandleScope shs(isolate);
+  return __RT_impl_Runtime_StringCompareRT(args, isolate);
+}
+
+
 RUNTIME_FUNCTION(Runtime_StringBuilderConcat) {
   HandleScope scope(isolate);
   DCHECK(args.length() == 3);
Index: src/runtime/runtime.cc
diff --git a/src/runtime/runtime.cc b/src/runtime/runtime.cc
index 9ec3f4c8f982b44745d6fefd26830dfbdeaae644..78c83abfdc5d9ebb62faecf8a81df5a86284f085 100644
--- a/src/runtime/runtime.cc
+++ b/src/runtime/runtime.cc
@@ -48,8 +48,9 @@ INLINE_FUNCTION_LIST(F)


 static const Runtime::Function kIntrinsicFunctions[] = {
-    RUNTIME_FUNCTION_LIST(F) INLINE_OPTIMIZED_FUNCTION_LIST(F)
-        INLINE_FUNCTION_LIST(I) INLINE_OPTIMIZED_FUNCTION_LIST(I)};
+    RUNTIME_FUNCTION_LIST(F) INLINE_FUNCTION_LIST(F)
+        INLINE_OPTIMIZED_FUNCTION_LIST(F) INLINE_FUNCTION_LIST(I)
+            INLINE_OPTIMIZED_FUNCTION_LIST(I)};

 #undef I
 #undef F
Index: src/runtime/runtime.h
diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h
index 4a036fd5c4bfd522420e5cb8e3ed55ec3dac5c9e..75ddd45e00b934c8679ad9331d39c27c967ebb18 100644
--- a/src/runtime/runtime.h
+++ b/src/runtime/runtime.h
@@ -429,12 +429,12 @@ namespace internal {
 #define RUNTIME_FUNCTION_LIST_ALWAYS_3(F)                    \
   /* String and Regexp */                                    \
   F(NumberToStringRT, 1, 1)                                  \
-  F(RegExpConstructResult, 3, 1)                             \
+  F(RegExpConstructResultRT, 3, 1)                           \
   F(RegExpExecRT, 4, 1)                                      \
-  F(StringAdd, 2, 1)                                         \
-  F(SubString, 3, 1)                                         \
+  F(StringAddRT, 2, 1)                                       \
+  F(SubStringRT, 3, 1)                                       \
   F(InternalizeString, 1, 1)                                 \
-  F(StringCompare, 2, 1)                                     \
+  F(StringCompareRT, 2, 1)                                   \
   F(StringCharCodeAtRT, 2, 1)                                \
   F(GetFromCacheRT, 2, 1)                                    \
                                                              \
@@ -769,12 +769,13 @@ class Runtime : public AllStatic {
  public:
   enum FunctionId {
 #define F(name, nargs, ressize) k##name,
-    RUNTIME_FUNCTION_LIST(F) INLINE_OPTIMIZED_FUNCTION_LIST(F)
+#define I(name, nargs, ressize) kInline##name,
+    RUNTIME_FUNCTION_LIST(F) INLINE_FUNCTION_LIST(F)
+        INLINE_OPTIMIZED_FUNCTION_LIST(F) INLINE_FUNCTION_LIST(I)
+            INLINE_OPTIMIZED_FUNCTION_LIST(I)
+#undef I
 #undef F
-#define F(name, nargs, ressize) kInline##name,
-        INLINE_FUNCTION_LIST(F) INLINE_OPTIMIZED_FUNCTION_LIST(F)
-#undef F
-            kNumFunctions,
+                kNumFunctions,
     // TODO(svenpanne) The values below are cruel hacks, remove them!
     kFirstInlineFunction = kInlineIsSmi,
     kLastInlineFunction = kInlineDebugIsActive
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 2e1510897a9b481c8160cc0ac83005f5affd978b..99196da425442eefd18fb735e54a97f554848e22 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -3235,7 +3235,7 @@ void SubStringStub::Generate(MacroAssembler* masm) {

   // Just jump to runtime to create the sub string.
   __ bind(&runtime);
-  __ TailCallRuntime(Runtime::kSubString, 3, 1);
+  __ TailCallRuntime(Runtime::kSubStringRT, 3, 1);

   __ bind(&single_char);
   // rax: string
@@ -3472,7 +3472,7 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
   // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
   // tagged as a small integer.
   __ bind(&runtime);
-  __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
+  __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1);
 }


@@ -3770,7 +3770,7 @@ void CompareICStub::GenerateStrings(MacroAssembler* masm) {
   if (equality) {
     __ TailCallRuntime(Runtime::kStringEquals, 2, 1);
   } else {
-    __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
+    __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1);
   }

   __ bind(&miss);
Index: test/mjsunit/regress/string-compare-memcmp.js
diff --git a/test/mjsunit/regress/string-compare-memcmp.js b/test/mjsunit/regress/string-compare-memcmp.js index 45f47343ee84fcd71c94d63a32210c83ca8c091d..ae4b33ace970d9cad90531466fa690bbb2951003 100644
--- a/test/mjsunit/regress/string-compare-memcmp.js
+++ b/test/mjsunit/regress/string-compare-memcmp.js
@@ -4,4 +4,4 @@

 // Flags: --allow-natives-syntax

-assertEquals(-1, %StringCompare("abc\u0102", "abc\u0201"));
+assertEquals(-1, %StringCompareRT("abc\u0102", "abc\u0201"));


--
--
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