Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Unified Diff: src/ppc/builtins-ppc.cc

Issue 2050853003: [stubs] StringToNumberStub --> StringToNumber builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index dad75f5dc38ec4c235d1ab95df3fea6cd6133a4b..4d38ec82131b7b10ff7175015ba1c805a29fb599 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -2750,6 +2750,24 @@ void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kAllocateInTargetSpace);
}
+// static
+void Builtins::Generate_StringToNumber(MacroAssembler* masm) {
+ // The StringToNumber stub takes one argument in r3.
+ __ AssertString(r3);
+
+ // Check if string has a cached array index.
+ Label runtime;
+ __ lwz(r5, FieldMemOperand(r3, String::kHashFieldOffset));
+ __ And(r0, r5, Operand(String::kContainsCachedArrayIndexMask), SetRC);
+ __ bne(&runtime, cr0);
+ __ IndexFromHash(r5, r3);
+ __ blr();
+
+ __ bind(&runtime);
+ __ push(r3); // Push argument.
+ __ TailCallRuntime(Runtime::kStringToNumber);
+}
+
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : actual number of arguments
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698