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

Unified Diff: src/code-stubs.cc

Issue 2217193002: [Interpreter] Inline FastCloneRegExpStub to CreateRegExpLiteral bytecode handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/code-stubs.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 14e98beb675af2440b02b66d1ecd5181818bdade..079cfb1a9f9cc69642829c394bf2f2b8a1b8e872 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -4615,14 +4615,20 @@ void FastNewFunctionContextStub::GenerateAssembly(
assembler->Return(Generate(assembler, function, slots, context));
}
-void FastCloneRegExpStub::GenerateAssembly(CodeStubAssembler* assembler) const {
+// static
+compiler::Node* FastCloneRegExpStub::Generate(CodeStubAssembler* assembler,
+ compiler::Node* closure,
+ compiler::Node* literal_index,
+ compiler::Node* pattern,
+ compiler::Node* flags,
+ compiler::Node* context) {
typedef CodeStubAssembler::Label Label;
+ typedef CodeStubAssembler::Variable Variable;
typedef compiler::Node Node;
- Label call_runtime(assembler, Label::kDeferred);
+ Label call_runtime(assembler, Label::kDeferred), end(assembler);
- Node* closure = assembler->Parameter(Descriptor::kClosure);
- Node* literal_index = assembler->Parameter(Descriptor::kLiteralIndex);
+ Variable result(assembler, MachineRepresentation::kTagged);
Node* undefined = assembler->UndefinedConstant();
Node* literals_array =
@@ -4641,17 +4647,31 @@ void FastCloneRegExpStub::GenerateAssembly(CodeStubAssembler* assembler) const {
Node* value = assembler->LoadObjectField(boilerplate, offset);
assembler->StoreObjectFieldNoWriteBarrier(copy, offset, value);
}
- assembler->Return(copy);
+ result.Bind(copy);
+ assembler->Goto(&end);
}
assembler->Bind(&call_runtime);
{
- Node* context = assembler->Parameter(Descriptor::kContext);
- Node* pattern = assembler->Parameter(Descriptor::kPattern);
- Node* flags = assembler->Parameter(Descriptor::kFlags);
- assembler->TailCallRuntime(Runtime::kCreateRegExpLiteral, context, closure,
- literal_index, pattern, flags);
+ result.Bind(assembler->CallRuntime(Runtime::kCreateRegExpLiteral, context,
+ closure, literal_index, pattern, flags));
+ assembler->Goto(&end);
}
+
+ assembler->Bind(&end);
+ return result.value();
+}
+
+void FastCloneRegExpStub::GenerateAssembly(CodeStubAssembler* assembler) const {
+ typedef compiler::Node Node;
+ Node* closure = assembler->Parameter(Descriptor::kClosure);
+ Node* literal_index = assembler->Parameter(Descriptor::kLiteralIndex);
+ Node* pattern = assembler->Parameter(Descriptor::kPattern);
+ Node* flags = assembler->Parameter(Descriptor::kFlags);
+ Node* context = assembler->Parameter(Descriptor::kContext);
+
+ assembler->Return(
+ Generate(assembler, closure, literal_index, pattern, flags, context));
}
void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) {
« no previous file with comments | « src/code-stubs.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698