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

Side by Side Diff: src/compiler/linkage-impl.h

Issue 1254073003: Tail call from TurboFan into select runtime calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Smaller patch Created 5 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-context-relaxation.cc ('k') | src/runtime/runtime.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 4
5 #ifndef V8_COMPILER_LINKAGE_IMPL_H_ 5 #ifndef V8_COMPILER_LINKAGE_IMPL_H_
6 #define V8_COMPILER_LINKAGE_IMPL_H_ 6 #define V8_COMPILER_LINKAGE_IMPL_H_
7 7
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler/osr.h" 9 #include "src/compiler/osr.h"
10 #include "src/runtime/runtime.h"
10 11
11 namespace v8 { 12 namespace v8 {
12 namespace internal { 13 namespace internal {
13 namespace compiler { 14 namespace compiler {
14 15
15 // TODO(titzer): replace uses of int with size_t in LinkageHelper. 16 // TODO(titzer): replace uses of int with size_t in LinkageHelper.
16 template <typename LinkageTraits> 17 template <typename LinkageTraits>
17 class LinkageHelper { 18 class LinkageHelper {
18 public: 19 public:
19 static const RegList kNoCalleeSaved = 0; 20 static const RegList kNoCalleeSaved = 0;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 locations.AddParam(regloc(LinkageTraits::RuntimeCallArgCountReg())); 113 locations.AddParam(regloc(LinkageTraits::RuntimeCallArgCountReg()));
113 types.AddParam(kMachPtr); 114 types.AddParam(kMachPtr);
114 115
115 // Add context. 116 // Add context.
116 locations.AddParam(regloc(LinkageTraits::ContextReg())); 117 locations.AddParam(regloc(LinkageTraits::ContextReg()));
117 types.AddParam(kMachAnyTagged); 118 types.AddParam(kMachAnyTagged);
118 119
119 CallDescriptor::Flags flags = Linkage::FrameStateInputCount(function_id) > 0 120 CallDescriptor::Flags flags = Linkage::FrameStateInputCount(function_id) > 0
120 ? CallDescriptor::kNeedsFrameState 121 ? CallDescriptor::kNeedsFrameState
121 : CallDescriptor::kNoFlags; 122 : CallDescriptor::kNoFlags;
123 if (Runtime::SupportsTailCall(function_id)) {
Michael Starzinger 2015/08/04 15:01:54 This new predicate on {Runtime} is similar to Link
124 flags |= CallDescriptor::kSupportsTailCalls;
125 }
122 126
123 // The target for runtime calls is a code object. 127 // The target for runtime calls is a code object.
124 MachineType target_type = kMachAnyTagged; 128 MachineType target_type = kMachAnyTagged;
125 LinkageLocation target_loc = LinkageLocation::AnyRegister(); 129 LinkageLocation target_loc = LinkageLocation::AnyRegister();
126 return new (zone) CallDescriptor( // -- 130 return new (zone) CallDescriptor( // --
127 CallDescriptor::kCallCodeObject, // kind 131 CallDescriptor::kCallCodeObject, // kind
128 target_type, // target MachineType 132 target_type, // target MachineType
129 target_loc, // target location 133 target_loc, // target location
130 types.Build(), // machine_sig 134 types.Build(), // machine_sig
131 locations.Build(), // location_sig 135 locations.Build(), // location_sig
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 int parameter_index = 1 + index; // skip index 0, which is the target. 326 int parameter_index = 1 + index; // skip index 0, which is the target.
323 return incoming_->GetInputLocation(parameter_index); 327 return incoming_->GetInputLocation(parameter_index);
324 } 328 }
325 } 329 }
326 330
327 } // namespace compiler 331 } // namespace compiler
328 } // namespace internal 332 } // namespace internal
329 } // namespace v8 333 } // namespace v8
330 334
331 #endif // V8_COMPILER_LINKAGE_IMPL_H_ 335 #endif // V8_COMPILER_LINKAGE_IMPL_H_
OLDNEW
« no previous file with comments | « src/compiler/js-context-relaxation.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698