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

Side by Side 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, 7 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 unified diff | Download patch
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/compiler/code-assembler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #include "src/code-stub-assembler.h" 4 #include "src/code-stub-assembler.h"
5 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/frames-inl.h" 6 #include "src/frames-inl.h"
7 #include "src/frames.h" 7 #include "src/frames.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 8688 matching lines...) Expand 10 before | Expand all | Expand 10 after
8699 DCHECK_EQ(argc_mode_, mode); 8699 DCHECK_EQ(argc_mode_, mode);
8700 CSA_ASSERT(assembler_, 8700 CSA_ASSERT(assembler_,
8701 assembler_->UintPtrOrSmiLessThan(index, GetLength(), mode)); 8701 assembler_->UintPtrOrSmiLessThan(index, GetLength(), mode));
8702 return assembler_->Load(MachineType::AnyTagged(), AtIndexPtr(index, mode)); 8702 return assembler_->Load(MachineType::AnyTagged(), AtIndexPtr(index, mode));
8703 } 8703 }
8704 8704
8705 Node* CodeStubArguments::AtIndex(int index) const { 8705 Node* CodeStubArguments::AtIndex(int index) const {
8706 return AtIndex(assembler_->IntPtrConstant(index)); 8706 return AtIndex(assembler_->IntPtrConstant(index));
8707 } 8707 }
8708 8708
8709 Node* CodeStubArguments::GetOptionalArgumentValue(int index,
8710 Node* default_value) {
8711 typedef CodeStubAssembler::Variable Variable;
8712 Variable result(assembler_, MachineRepresentation::kTagged);
8713 CodeStubAssembler::Label argument_missing(assembler_),
8714 argument_done(assembler_, &result);
8715
8716 assembler_->GotoIf(assembler_->UintPtrOrSmiGreaterThanOrEqual(
8717 assembler_->IntPtrOrSmiConstant(index, argc_mode_),
8718 argc_, argc_mode_),
8719 &argument_missing);
8720 result.Bind(AtIndex(index));
8721 assembler_->Goto(&argument_done);
8722
8723 assembler_->BIND(&argument_missing);
8724 result.Bind(default_value);
8725 assembler_->Goto(&argument_done);
8726
8727 assembler_->BIND(&argument_done);
8728 return result.value();
8729 }
8730
8709 void CodeStubArguments::ForEach( 8731 void CodeStubArguments::ForEach(
8710 const CodeStubAssembler::VariableList& vars, 8732 const CodeStubAssembler::VariableList& vars,
8711 const CodeStubArguments::ForEachBodyFunction& body, Node* first, Node* last, 8733 const CodeStubArguments::ForEachBodyFunction& body, Node* first, Node* last,
8712 CodeStubAssembler::ParameterMode mode) { 8734 CodeStubAssembler::ParameterMode mode) {
8713 assembler_->Comment("CodeStubArguments::ForEach"); 8735 assembler_->Comment("CodeStubArguments::ForEach");
8714 if (first == nullptr) { 8736 if (first == nullptr) {
8715 first = assembler_->IntPtrOrSmiConstant(0, mode); 8737 first = assembler_->IntPtrOrSmiConstant(0, mode);
8716 } 8738 }
8717 if (last == nullptr) { 8739 if (last == nullptr) {
8718 DCHECK_EQ(mode, argc_mode_); 8740 DCHECK_EQ(mode, argc_mode_);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
8859 formatted.c_str(), TENURED); 8881 formatted.c_str(), TENURED);
8860 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), 8882 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(),
8861 HeapConstant(string)); 8883 HeapConstant(string));
8862 } 8884 }
8863 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); 8885 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value);
8864 #endif 8886 #endif
8865 } 8887 }
8866 8888
8867 } // namespace internal 8889 } // namespace internal
8868 } // namespace v8 8890 } // namespace v8
OLDNEW
« 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