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

Unified Diff: src/code-stub-assembler.cc

Issue 2829093004: [turbofan] Avoid going through ArgumentsAdaptorTrampoline for CSA/C++ builtins (Closed)
Patch Set: Add other files again Created 3 years, 8 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-stub-assembler.h ('k') | src/compiler/code-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 480be44f8bac83e570adcedc706a287f90e6e591..e573043437c263fefebc199653ce68991402bda2 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -8706,6 +8706,28 @@ Node* CodeStubArguments::AtIndex(int index) const {
return AtIndex(assembler_->IntPtrConstant(index));
}
+Node* CodeStubArguments::GetOptionalArgumentValue(int index,
+ Node* default_value) {
+ typedef CodeStubAssembler::Variable Variable;
+ Variable result(assembler_, MachineRepresentation::kTagged);
+ CodeStubAssembler::Label argument_missing(assembler_),
+ argument_done(assembler_, &result);
+
+ assembler_->GotoIf(assembler_->UintPtrOrSmiGreaterThanOrEqual(
+ assembler_->IntPtrOrSmiConstant(index, argc_mode_),
+ argc_, argc_mode_),
+ &argument_missing);
+ result.Bind(AtIndex(index));
+ assembler_->Goto(&argument_done);
+
+ assembler_->BIND(&argument_missing);
+ result.Bind(default_value);
+ assembler_->Goto(&argument_done);
+
+ assembler_->BIND(&argument_done);
+ return result.value();
+}
+
void CodeStubArguments::ForEach(
const CodeStubAssembler::VariableList& vars,
const CodeStubArguments::ForEachBodyFunction& body, Node* first, Node* last,
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/compiler/code-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698