| 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/compiler/js-builtin-reducer.h" | 5 #include "src/compiler/js-builtin-reducer.h" |
| 6 | 6 |
| 7 #include "src/compilation-dependencies.h" | 7 #include "src/compilation-dependencies.h" |
| 8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
| 9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 value); | 427 value); |
| 428 } else if (elements_kind == FAST_HOLEY_DOUBLE_ELEMENTS) { | 428 } else if (elements_kind == FAST_HOLEY_DOUBLE_ELEMENTS) { |
| 429 // TODO(bmeurer): avoid deopt if not all uses of value are truncated. | 429 // TODO(bmeurer): avoid deopt if not all uses of value are truncated. |
| 430 CheckFloat64HoleMode mode = CheckFloat64HoleMode::kAllowReturnHole; | 430 CheckFloat64HoleMode mode = CheckFloat64HoleMode::kAllowReturnHole; |
| 431 value = etrue1 = graph()->NewNode( | 431 value = etrue1 = graph()->NewNode( |
| 432 simplified()->CheckFloat64Hole(mode), value, etrue1, if_true1); | 432 simplified()->CheckFloat64Hole(mode), value, etrue1, if_true1); |
| 433 } | 433 } |
| 434 | 434 |
| 435 if (kind == IterationKind::kEntries) { | 435 if (kind == IterationKind::kEntries) { |
| 436 // Allocate elements for key/value pair | 436 // Allocate elements for key/value pair |
| 437 vtrue1 = etrue1 = graph()->NewNode( | 437 vtrue1 = etrue1 = |
| 438 javascript()->CreateKeyValueArray(), index, value, etrue1); | 438 graph()->NewNode(javascript()->CreateKeyValueArray(), index, |
| 439 value, context, etrue1); |
| 439 } else { | 440 } else { |
| 440 DCHECK_EQ(kind, IterationKind::kValues); | 441 DCHECK_EQ(kind, IterationKind::kValues); |
| 441 vtrue1 = value; | 442 vtrue1 = value; |
| 442 } | 443 } |
| 443 } | 444 } |
| 444 | 445 |
| 445 Node* next_index = graph()->NewNode(simplified()->NumberAdd(), index, | 446 Node* next_index = graph()->NewNode(simplified()->NumberAdd(), index, |
| 446 jsgraph()->OneConstant()); | 447 jsgraph()->OneConstant()); |
| 447 next_index = graph()->NewNode(simplified()->NumberToUint32(), next_index); | 448 next_index = graph()->NewNode(simplified()->NumberToUint32(), next_index); |
| 448 | 449 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 UNREACHABLE(); | 595 UNREACHABLE(); |
| 595 #undef TYPED_ARRAY_CASE | 596 #undef TYPED_ARRAY_CASE |
| 596 } | 597 } |
| 597 | 598 |
| 598 Node* value = etrue2 = | 599 Node* value = etrue2 = |
| 599 graph()->NewNode(simplified()->LoadTypedElement(array_type), buffer, | 600 graph()->NewNode(simplified()->LoadTypedElement(array_type), buffer, |
| 600 base_ptr, external_ptr, index, etrue2, if_true2); | 601 base_ptr, external_ptr, index, etrue2, if_true2); |
| 601 | 602 |
| 602 if (kind == IterationKind::kEntries) { | 603 if (kind == IterationKind::kEntries) { |
| 603 // Allocate elements for key/value pair | 604 // Allocate elements for key/value pair |
| 604 vtrue2 = etrue2 = graph()->NewNode( | 605 vtrue2 = etrue2 = |
| 605 javascript()->CreateKeyValueArray(), index, value, etrue2); | 606 graph()->NewNode(javascript()->CreateKeyValueArray(), index, |
| 607 value, context, etrue2); |
| 606 } else { | 608 } else { |
| 607 DCHECK(kind == IterationKind::kValues); | 609 DCHECK(kind == IterationKind::kValues); |
| 608 vtrue2 = value; | 610 vtrue2 = value; |
| 609 } | 611 } |
| 610 } | 612 } |
| 611 } | 613 } |
| 612 | 614 |
| 613 Node* vdone_false2; | 615 Node* vdone_false2; |
| 614 Node* vfalse2; | 616 Node* vfalse2; |
| 615 Node* efalse2 = efalse0; | 617 Node* efalse2 = efalse0; |
| (...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2014 return jsgraph()->simplified(); | 2016 return jsgraph()->simplified(); |
| 2015 } | 2017 } |
| 2016 | 2018 |
| 2017 JSOperatorBuilder* JSBuiltinReducer::javascript() const { | 2019 JSOperatorBuilder* JSBuiltinReducer::javascript() const { |
| 2018 return jsgraph()->javascript(); | 2020 return jsgraph()->javascript(); |
| 2019 } | 2021 } |
| 2020 | 2022 |
| 2021 } // namespace compiler | 2023 } // namespace compiler |
| 2022 } // namespace internal | 2024 } // namespace internal |
| 2023 } // namespace v8 | 2025 } // namespace v8 |
| OLD | NEW |