OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/node-properties.h" | 5 #include "src/compiler/node-properties.h" |
6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
7 #include "src/compiler/graph.h" | 7 #include "src/compiler/graph.h" |
8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 break; | 332 break; |
333 } | 333 } |
334 default: | 334 default: |
335 break; | 335 break; |
336 } | 336 } |
337 return MaybeHandle<Context>(); | 337 return MaybeHandle<Context>(); |
338 } | 338 } |
339 | 339 |
340 | 340 |
341 // static | 341 // static |
| 342 Node* NodeProperties::GetOuterContext(Node* node, size_t* depth) { |
| 343 Node* context = NodeProperties::GetContextInput(node); |
| 344 while (*depth > 0 && |
| 345 IrOpcode::IsContextChainExtendingOpcode(context->opcode())) { |
| 346 context = NodeProperties::GetContextInput(context); |
| 347 (*depth)--; |
| 348 } |
| 349 return context; |
| 350 } |
| 351 |
| 352 // static |
342 Type* NodeProperties::GetTypeOrAny(Node* node) { | 353 Type* NodeProperties::GetTypeOrAny(Node* node) { |
343 return IsTyped(node) ? node->type() : Type::Any(); | 354 return IsTyped(node) ? node->type() : Type::Any(); |
344 } | 355 } |
345 | 356 |
346 | 357 |
347 // static | 358 // static |
348 bool NodeProperties::AllValueInputsAreTyped(Node* node) { | 359 bool NodeProperties::AllValueInputsAreTyped(Node* node) { |
349 int input_count = node->op()->ValueInputCount(); | 360 int input_count = node->op()->ValueInputCount(); |
350 for (int index = 0; index < input_count; ++index) { | 361 for (int index = 0; index < input_count; ++index) { |
351 if (!IsTyped(GetValueInput(node, index))) return false; | 362 if (!IsTyped(GetValueInput(node, index))) return false; |
352 } | 363 } |
353 return true; | 364 return true; |
354 } | 365 } |
355 | 366 |
356 | 367 |
357 // static | 368 // static |
358 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { | 369 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { |
359 if (num == 0) return false; | 370 if (num == 0) return false; |
360 int const index = edge.index(); | 371 int const index = edge.index(); |
361 return first <= index && index < first + num; | 372 return first <= index && index < first + num; |
362 } | 373 } |
363 | 374 |
364 } // namespace compiler | 375 } // namespace compiler |
365 } // namespace internal | 376 } // namespace internal |
366 } // namespace v8 | 377 } // namespace v8 |
OLD | NEW |