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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 ++current_input; | 112 ++current_input; |
113 ++other_input; | 113 ++other_input; |
114 } | 114 } |
115 return HasSameReturnLocationsAs(OpParameter<CallDescriptor const*>(node)); | 115 return HasSameReturnLocationsAs(OpParameter<CallDescriptor const*>(node)); |
116 } | 116 } |
117 | 117 |
118 | 118 |
119 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { | 119 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { |
120 DCHECK(!info->IsStub()); | 120 DCHECK(!info->IsStub()); |
121 if (info->has_literal()) { | |
122 // If we already have the function literal, use the number of parameters | |
123 // plus the receiver. | |
124 return GetJSCallDescriptor(zone, info->is_osr(), | |
125 1 + info->literal()->parameter_count(), | |
126 CallDescriptor::kNoFlags); | |
127 } | |
128 if (!info->closure().is_null()) { | 121 if (!info->closure().is_null()) { |
129 // If we are compiling a JS function, use a JS call descriptor, | 122 // If we are compiling a JS function, use a JS call descriptor, |
130 // plus the receiver. | 123 // plus the receiver. |
131 SharedFunctionInfo* shared = info->closure()->shared(); | 124 SharedFunctionInfo* shared = info->closure()->shared(); |
132 return GetJSCallDescriptor(zone, info->is_osr(), | 125 return GetJSCallDescriptor(zone, info->is_osr(), |
133 1 + shared->internal_formal_parameter_count(), | 126 1 + shared->internal_formal_parameter_count(), |
134 CallDescriptor::kNoFlags); | 127 CallDescriptor::kNoFlags); |
135 } | 128 } |
136 return nullptr; // TODO(titzer): ? | 129 return nullptr; // TODO(titzer): ? |
137 } | 130 } |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 } else { | 445 } else { |
453 DCHECK(loc == regloc(kContextRegister)); | 446 DCHECK(loc == regloc(kContextRegister)); |
454 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); | 447 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); |
455 } | 448 } |
456 } | 449 } |
457 | 450 |
458 | 451 |
459 } // namespace compiler | 452 } // namespace compiler |
460 } // namespace internal | 453 } // namespace internal |
461 } // namespace v8 | 454 } // namespace v8 |
OLD | NEW |