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

Side by Side Diff: src/compiler/linkage.cc

Issue 1108563002: Detect simple tail calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed index type Created 5 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/compiler/linkage.h ('k') | src/compiler/linkage-impl.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 #include "src/code-stubs.h" 5 #include "src/code-stubs.h"
6 #include "src/compiler.h" 6 #include "src/compiler.h"
7 #include "src/compiler/linkage.h" 7 #include "src/compiler/linkage.h"
8 #include "src/compiler/node.h" 8 #include "src/compiler/node.h"
9 #include "src/compiler/pipeline.h" 9 #include "src/compiler/pipeline.h"
10 #include "src/scopes.h" 10 #include "src/scopes.h"
(...skipping 16 matching lines...) Expand all
27 break; 27 break;
28 } 28 }
29 return os; 29 return os;
30 } 30 }
31 31
32 32
33 std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) { 33 std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) {
34 // TODO(svenpanne) Output properties etc. and be less cryptic. 34 // TODO(svenpanne) Output properties etc. and be less cryptic.
35 return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount() 35 return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount()
36 << "j" << d.JSParameterCount() << "i" << d.InputCount() << "f" 36 << "j" << d.JSParameterCount() << "i" << d.InputCount() << "f"
37 << d.FrameStateCount(); 37 << d.FrameStateCount() << "t" << d.SupportsTailCalls();
38 } 38 }
39 39
40 40
41 bool CallDescriptor::HasSameReturnLocationsAs(
42 const CallDescriptor* other) const {
43 if (ReturnCount() != other->ReturnCount()) return false;
44 for (size_t i = 0; i < ReturnCount(); ++i) {
45 if (GetReturnLocation(i) != other->GetReturnLocation(i)) return false;
46 }
47 return true;
48 }
49
50
41 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { 51 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) {
42 if (info->code_stub() != NULL) { 52 if (info->code_stub() != NULL) {
43 // Use the code stub interface descriptor. 53 // Use the code stub interface descriptor.
44 CallInterfaceDescriptor descriptor = 54 CallInterfaceDescriptor descriptor =
45 info->code_stub()->GetCallInterfaceDescriptor(); 55 info->code_stub()->GetCallInterfaceDescriptor();
46 return GetStubCallDescriptor(info->isolate(), zone, descriptor, 0, 56 return GetStubCallDescriptor(info->isolate(), zone, descriptor, 0,
47 CallDescriptor::kNoFlags, 57 CallDescriptor::kNoFlags,
48 Operator::kNoProperties); 58 Operator::kNoProperties);
49 } 59 }
50 if (info->function() != NULL) { 60 if (info->function() != NULL) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 144
135 // Most inlined runtime functions (except the ones listed above) can be called 145 // Most inlined runtime functions (except the ones listed above) can be called
136 // without a FrameState or will be lowered by JSIntrinsicLowering internally. 146 // without a FrameState or will be lowered by JSIntrinsicLowering internally.
137 const Runtime::Function* const f = Runtime::FunctionForId(function); 147 const Runtime::Function* const f = Runtime::FunctionForId(function);
138 if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return false; 148 if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return false;
139 149
140 return true; 150 return true;
141 } 151 }
142 152
143 153
154 bool CallDescriptor::UsesOnlyRegisters() const {
155 for (size_t i = 0; i < InputCount(); ++i) {
156 if (!GetInputLocation(i).is_register()) return false;
157 }
158 for (size_t i = 0; i < ReturnCount(); ++i) {
159 if (!GetReturnLocation(i).is_register()) return false;
160 }
161 return true;
162 }
163
164
144 //============================================================================== 165 //==============================================================================
145 // Provide unimplemented methods on unsupported architectures, to at least link. 166 // Provide unimplemented methods on unsupported architectures, to at least link.
146 //============================================================================== 167 //==============================================================================
147 #if !V8_TURBOFAN_BACKEND 168 #if !V8_TURBOFAN_BACKEND
148 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, 169 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
149 int parameter_count, 170 int parameter_count,
150 CallDescriptor::Flags flags) { 171 CallDescriptor::Flags flags) {
151 UNIMPLEMENTED(); 172 UNIMPLEMENTED();
152 return NULL; 173 return NULL;
153 } 174 }
(...skipping 24 matching lines...) Expand all
178 199
179 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, 200 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone,
180 const MachineSignature* sig) { 201 const MachineSignature* sig) {
181 UNIMPLEMENTED(); 202 UNIMPLEMENTED();
182 return NULL; 203 return NULL;
183 } 204 }
184 #endif // !V8_TURBOFAN_BACKEND 205 #endif // !V8_TURBOFAN_BACKEND
185 } 206 }
186 } 207 }
187 } // namespace v8::internal::compiler 208 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « src/compiler/linkage.h ('k') | src/compiler/linkage-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698