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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 more_this = false; | 113 more_this = false; |
114 } | 114 } |
115 ++current_input; | 115 ++current_input; |
116 ++other_input; | 116 ++other_input; |
117 } | 117 } |
118 return HasSameReturnLocationsAs(OpParameter<CallDescriptor const*>(node)); | 118 return HasSameReturnLocationsAs(OpParameter<CallDescriptor const*>(node)); |
119 } | 119 } |
120 | 120 |
121 | 121 |
122 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { | 122 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { |
123 if (info->code_stub() != NULL) { | 123 if (info->code_stub() != nullptr) { |
124 // Use the code stub interface descriptor. | 124 // Use the code stub interface descriptor. |
125 CodeStub* stub = info->code_stub(); | 125 CodeStub* stub = info->code_stub(); |
126 CallInterfaceDescriptor descriptor = stub->GetCallInterfaceDescriptor(); | 126 CallInterfaceDescriptor descriptor = stub->GetCallInterfaceDescriptor(); |
127 return GetStubCallDescriptor( | 127 return GetStubCallDescriptor( |
128 info->isolate(), zone, descriptor, stub->GetStackParameterCount(), | 128 info->isolate(), zone, descriptor, stub->GetStackParameterCount(), |
129 CallDescriptor::kNoFlags, Operator::kNoProperties); | 129 CallDescriptor::kNoFlags, Operator::kNoProperties); |
130 } | 130 } |
131 if (info->has_literal()) { | 131 if (info->has_literal()) { |
132 // If we already have the function literal, use the number of parameters | 132 // If we already have the function literal, use the number of parameters |
133 // plus the receiver. | 133 // plus the receiver. |
134 return GetJSCallDescriptor(zone, info->is_osr(), | 134 return GetJSCallDescriptor(zone, info->is_osr(), |
135 1 + info->literal()->parameter_count(), | 135 1 + info->literal()->parameter_count(), |
136 CallDescriptor::kNoFlags); | 136 CallDescriptor::kNoFlags); |
137 } | 137 } |
138 if (!info->closure().is_null()) { | 138 if (!info->closure().is_null()) { |
139 // If we are compiling a JS function, use a JS call descriptor, | 139 // If we are compiling a JS function, use a JS call descriptor, |
140 // plus the receiver. | 140 // plus the receiver. |
141 SharedFunctionInfo* shared = info->closure()->shared(); | 141 SharedFunctionInfo* shared = info->closure()->shared(); |
142 return GetJSCallDescriptor(zone, info->is_osr(), | 142 return GetJSCallDescriptor(zone, info->is_osr(), |
143 1 + shared->internal_formal_parameter_count(), | 143 1 + shared->internal_formal_parameter_count(), |
144 CallDescriptor::kNoFlags); | 144 CallDescriptor::kNoFlags); |
145 } | 145 } |
146 return NULL; // TODO(titzer): ? | 146 return nullptr; // TODO(titzer): ? |
147 } | 147 } |
148 | 148 |
149 | 149 |
150 // static | 150 // static |
151 int Linkage::FrameStateInputCount(Runtime::FunctionId function) { | 151 int Linkage::FrameStateInputCount(Runtime::FunctionId function) { |
152 // Most runtime functions need a FrameState. A few chosen ones that we know | 152 // Most runtime functions need a FrameState. A few chosen ones that we know |
153 // not to call into arbitrary JavaScript, not to throw, and not to deoptimize | 153 // not to call into arbitrary JavaScript, not to throw, and not to deoptimize |
154 // are blacklisted here and can be called without a FrameState. | 154 // are blacklisted here and can be called without a FrameState. |
155 switch (function) { | 155 switch (function) { |
156 case Runtime::kAllocateInTargetSpace: | 156 case Runtime::kAllocateInTargetSpace: |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 } else { | 531 } else { |
532 DCHECK(loc == regloc(kContextRegister)); | 532 DCHECK(loc == regloc(kContextRegister)); |
533 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); | 533 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); |
534 } | 534 } |
535 } | 535 } |
536 | 536 |
537 | 537 |
538 } // namespace compiler | 538 } // namespace compiler |
539 } // namespace internal | 539 } // namespace internal |
540 } // namespace v8 | 540 } // namespace v8 |
OLD | NEW |