OLD | NEW |
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/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/frame.h" | 9 #include "src/compiler/frame.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 case Runtime::kReThrow: | 169 case Runtime::kReThrow: |
170 case Runtime::kStringCompare: | 170 case Runtime::kStringCompare: |
171 case Runtime::kStringEquals: | 171 case Runtime::kStringEquals: |
172 case Runtime::kToFastProperties: // TODO(jarin): Is it safe? | 172 case Runtime::kToFastProperties: // TODO(jarin): Is it safe? |
173 case Runtime::kTraceEnter: | 173 case Runtime::kTraceEnter: |
174 case Runtime::kTraceExit: | 174 case Runtime::kTraceExit: |
175 return 0; | 175 return 0; |
176 case Runtime::kInlineArguments: | 176 case Runtime::kInlineArguments: |
177 case Runtime::kInlineArgumentsLength: | 177 case Runtime::kInlineArgumentsLength: |
178 case Runtime::kInlineDefaultConstructorCallSuper: | 178 case Runtime::kInlineDefaultConstructorCallSuper: |
179 case Runtime::kInlineGetCallerJSFunction: | |
180 case Runtime::kInlineGetPrototype: | 179 case Runtime::kInlineGetPrototype: |
181 case Runtime::kInlineIsConstructCall: | 180 case Runtime::kInlineIsConstructCall: |
182 case Runtime::kInlineRegExpExec: | 181 case Runtime::kInlineRegExpExec: |
183 case Runtime::kInlineSubString: | 182 case Runtime::kInlineSubString: |
184 case Runtime::kInlineToInteger: | 183 case Runtime::kInlineToInteger: |
185 case Runtime::kInlineToLength: | 184 case Runtime::kInlineToLength: |
186 case Runtime::kInlineToName: | 185 case Runtime::kInlineToName: |
187 case Runtime::kInlineToNumber: | 186 case Runtime::kInlineToNumber: |
188 case Runtime::kInlineToObject: | 187 case Runtime::kInlineToObject: |
189 case Runtime::kInlineToPrimitive_Number: | 188 case Runtime::kInlineToPrimitive_Number: |
(...skipping 25 matching lines...) Expand all Loading... |
215 } | 214 } |
216 for (size_t i = 0; i < ReturnCount(); ++i) { | 215 for (size_t i = 0; i < ReturnCount(); ++i) { |
217 if (!GetReturnLocation(i).IsRegister()) return false; | 216 if (!GetReturnLocation(i).IsRegister()) return false; |
218 } | 217 } |
219 return true; | 218 return true; |
220 } | 219 } |
221 | 220 |
222 | 221 |
223 CallDescriptor* Linkage::GetRuntimeCallDescriptor( | 222 CallDescriptor* Linkage::GetRuntimeCallDescriptor( |
224 Zone* zone, Runtime::FunctionId function_id, int js_parameter_count, | 223 Zone* zone, Runtime::FunctionId function_id, int js_parameter_count, |
225 Operator::Properties properties, bool needs_frame_state) { | 224 Operator::Properties properties, CallDescriptor::Flags flags) { |
226 const size_t function_count = 1; | 225 const size_t function_count = 1; |
227 const size_t num_args_count = 1; | 226 const size_t num_args_count = 1; |
228 const size_t context_count = 1; | 227 const size_t context_count = 1; |
229 const size_t parameter_count = function_count + | 228 const size_t parameter_count = function_count + |
230 static_cast<size_t>(js_parameter_count) + | 229 static_cast<size_t>(js_parameter_count) + |
231 num_args_count + context_count; | 230 num_args_count + context_count; |
232 | 231 |
233 const Runtime::Function* function = Runtime::FunctionForId(function_id); | 232 const Runtime::Function* function = Runtime::FunctionForId(function_id); |
234 const size_t return_count = static_cast<size_t>(function->result_size); | 233 const size_t return_count = static_cast<size_t>(function->result_size); |
235 | 234 |
(...skipping 22 matching lines...) Expand all Loading... |
258 types.AddParam(kMachAnyTagged); | 257 types.AddParam(kMachAnyTagged); |
259 | 258 |
260 // Add runtime call argument count. | 259 // Add runtime call argument count. |
261 locations.AddParam(regloc(kRuntimeCallArgCountRegister)); | 260 locations.AddParam(regloc(kRuntimeCallArgCountRegister)); |
262 types.AddParam(kMachPtr); | 261 types.AddParam(kMachPtr); |
263 | 262 |
264 // Add context. | 263 // Add context. |
265 locations.AddParam(regloc(kContextRegister)); | 264 locations.AddParam(regloc(kContextRegister)); |
266 types.AddParam(kMachAnyTagged); | 265 types.AddParam(kMachAnyTagged); |
267 | 266 |
268 CallDescriptor::Flags flags = | 267 if (Linkage::FrameStateInputCount(function_id) == 0) { |
269 needs_frame_state && (Linkage::FrameStateInputCount(function_id) > 0) | 268 flags = static_cast<CallDescriptor::Flags>( |
270 ? CallDescriptor::kNeedsFrameState | 269 flags & ~CallDescriptor::kNeedsFrameState); |
271 : CallDescriptor::kNoFlags; | 270 } |
272 | 271 |
273 // The target for runtime calls is a code object. | 272 // The target for runtime calls is a code object. |
274 MachineType target_type = kMachAnyTagged; | 273 MachineType target_type = kMachAnyTagged; |
275 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); | 274 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); |
276 return new (zone) CallDescriptor( // -- | 275 return new (zone) CallDescriptor( // -- |
277 CallDescriptor::kCallCodeObject, // kind | 276 CallDescriptor::kCallCodeObject, // kind |
278 target_type, // target MachineType | 277 target_type, // target MachineType |
279 target_loc, // target location | 278 target_loc, // target location |
280 types.Build(), // machine_sig | 279 types.Build(), // machine_sig |
281 locations.Build(), // location_sig | 280 locations.Build(), // location_sig |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } else { | 523 } else { |
525 DCHECK(loc == regloc(kContextRegister)); | 524 DCHECK(loc == regloc(kContextRegister)); |
526 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); | 525 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); |
527 } | 526 } |
528 } | 527 } |
529 | 528 |
530 | 529 |
531 } // namespace compiler | 530 } // namespace compiler |
532 } // namespace internal | 531 } // namespace internal |
533 } // namespace v8 | 532 } // namespace v8 |
OLD | NEW |