Revision: 20257
Author:   [email protected]
Date:     Tue Mar 25 17:40:36 2014 UTC
Log:      MIPS: Refactor optimized in hydrogen only runtime functions.

Port r20252 (d0f806b)

Original commit message:
This splits all runtime function into 3 categories:
1) RUNTIME: implemented in runtime and called from both full and optimized code. 2) RUNTIME_HIDDEN: implemented in runtime, never called directly from JS builtins.
3) INLINE: inlined in both full and optimized code
4) INLINE_OPTIMIZED: inlined in optimized code, implemented in runtime for full code.

BUG=
[email protected]

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

Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=20257

Modified:
 /branches/bleeding_edge/src/mips/code-stubs-mips.cc
 /branches/bleeding_edge/src/mips/full-codegen-mips.cc
 /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Mon Mar 24 10:07:15 2014 UTC +++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Tue Mar 25 17:40:36 2014 UTC
@@ -77,7 +77,7 @@
   descriptor->register_param_count_ = 1;
   descriptor->register_params_ = registers;
   descriptor->deoptimization_handler_ =
-      Runtime::FunctionForId(Runtime::kNumberToString)->entry;
+      Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry;
 }


@@ -142,7 +142,7 @@
   descriptor->register_param_count_ = 3;
   descriptor->register_params_ = registers;
   descriptor->deoptimization_handler_ =
-      Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry;
+      Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry;
 }


@@ -386,7 +386,7 @@
   descriptor->register_param_count_ = 2;
   descriptor->register_params_ = registers;
   descriptor->deoptimization_handler_ =
-      Runtime::FunctionForId(Runtime::kStringAdd)->entry;
+      Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry;
 }


@@ -2589,7 +2589,7 @@
// time or if regexp entry in generated code is turned off runtime switch or
   // at compilation.
 #ifdef V8_INTERPRETED_REGEXP
-  __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
+  __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1);
 #else  // V8_INTERPRETED_REGEXP

   // Stack frame on entry.
@@ -2981,7 +2981,7 @@

   // Do the runtime call to execute the regexp.
   __ bind(&runtime);
-  __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
+  __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1);

   // Deferred code for string handling.
   // (6) Not a long external string?  If yes, go to (8).
@@ -3388,7 +3388,7 @@
   call_helper.BeforeCall(masm);
   __ sll(index_, index_, kSmiTagSize);
   __ Push(object_, index_);
-  __ CallRuntime(Runtime::kStringCharCodeAt, 2);
+  __ CallRuntime(Runtime::kHiddenStringCharCodeAt, 2);

   __ Move(result_, v0);

@@ -3823,7 +3823,7 @@

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

   __ bind(&single_char);
   // v0: original string
@@ -3988,7 +3988,7 @@
   GenerateCompareFlatAsciiStrings(masm, a1, a0, a2, a3, t0, t1);

   __ bind(&runtime);
-  __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
+  __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1);
 }


@@ -4499,7 +4499,7 @@
   if (equality) {
     __ TailCallRuntime(Runtime::kStringEquals, 2, 1);
   } else {
-    __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
+    __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1);
   }

   __ bind(&miss);
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Mon Mar 24 14:11:26 2014 UTC +++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Tue Mar 25 17:40:36 2014 UTC
@@ -3424,7 +3424,7 @@
   if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) {
     VisitForStackValue(args->at(1));
     VisitForStackValue(args->at(2));
-    __ CallRuntime(Runtime::kLog, 2);
+    __ CallRuntime(Runtime::kHiddenLog, 2);
   }

   // Finally, we're expected to leave a value on the top of the stack.
@@ -3912,7 +3912,7 @@
   __ bind(&not_found);
   // Call runtime to perform the lookup.
   __ Push(cache, key);
-  __ CallRuntime(Runtime::kGetFromCache, 2);
+  __ CallRuntime(Runtime::kHiddenGetFromCache, 2);

   __ bind(&done);
   context()->Plug(v0);
@@ -4193,8 +4193,8 @@


 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
-  Handle<String> name = expr->name();
-  if (name->length() > 0 && name->Get(0) == '_') {
+  if (expr->function() != NULL &&
+      expr->function()->intrinsic_type == Runtime::INLINE) {
     Comment cmnt(masm_, "[ InlineRuntimeCall");
     EmitInlineRuntimeCall(expr);
     return;
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Mar 24 18:17:14 2014 UTC +++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Tue Mar 25 17:40:36 2014 UTC
@@ -4484,7 +4484,7 @@
     __ SmiTag(index);
     __ push(index);
   }
-  CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr,
+  CallRuntimeFromDeferred(Runtime::kHiddenStringCharCodeAt, 2, instr,
                           instr->context());
   __ AssertSmi(v0);
   __ SmiUntag(v0);

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