OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/compiler.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 DCHECK(dependencies()->IsEmpty()); | 168 DCHECK(dependencies()->IsEmpty()); |
169 #endif // DEBUG | 169 #endif // DEBUG |
170 } | 170 } |
171 | 171 |
172 | 172 |
173 int CompilationInfo::num_parameters() const { | 173 int CompilationInfo::num_parameters() const { |
174 return has_scope() ? scope()->num_parameters() : parameter_count_; | 174 return has_scope() ? scope()->num_parameters() : parameter_count_; |
175 } | 175 } |
176 | 176 |
177 | 177 |
| 178 int CompilationInfo::num_parameters_including_this() const { |
| 179 return num_parameters() + (is_this_defined() ? 1 : 0); |
| 180 } |
| 181 |
| 182 |
| 183 bool CompilationInfo::is_this_defined() const { return !IsStub(); } |
| 184 |
| 185 |
178 int CompilationInfo::num_heap_slots() const { | 186 int CompilationInfo::num_heap_slots() const { |
179 return has_scope() ? scope()->num_heap_slots() : 0; | 187 return has_scope() ? scope()->num_heap_slots() : 0; |
180 } | 188 } |
181 | 189 |
182 | 190 |
183 Code::Flags CompilationInfo::flags() const { | 191 Code::Flags CompilationInfo::flags() const { |
184 return code_stub() != nullptr | 192 return code_stub() != nullptr |
185 ? Code::ComputeFlags( | 193 ? Code::ComputeFlags( |
186 code_stub()->GetCodeKind(), code_stub()->GetICState(), | 194 code_stub()->GetCodeKind(), code_stub()->GetICState(), |
187 code_stub()->GetExtraICState(), code_stub()->GetStubType()) | 195 code_stub()->GetExtraICState(), code_stub()->GetStubType()) |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 } | 1554 } |
1547 | 1555 |
1548 | 1556 |
1549 #if DEBUG | 1557 #if DEBUG |
1550 void CompilationInfo::PrintAstForTesting() { | 1558 void CompilationInfo::PrintAstForTesting() { |
1551 PrintF("--- Source from AST ---\n%s\n", | 1559 PrintF("--- Source from AST ---\n%s\n", |
1552 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1560 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1553 } | 1561 } |
1554 #endif | 1562 #endif |
1555 } } // namespace v8::internal | 1563 } } // namespace v8::internal |
OLD | NEW |