Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/code-stubs.cc

Issue 2407103003: [Interpreter] Collect feedback about Oddballs in Bitwise, Inc, Dec operations. (Closed)
Patch Set: Moved the assert to higher level. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/interpreter/interpreter-assembler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 1484
1485 assembler->Bind(&if_valueisnumber); 1485 assembler->Bind(&if_valueisnumber);
1486 { 1486 {
1487 // Load the HeapNumber value. 1487 // Load the HeapNumber value.
1488 var_finc_value.Bind(assembler->LoadHeapNumberValue(value)); 1488 var_finc_value.Bind(assembler->LoadHeapNumberValue(value));
1489 assembler->Goto(&do_finc); 1489 assembler->Goto(&do_finc);
1490 } 1490 }
1491 1491
1492 assembler->Bind(&if_valuenotnumber); 1492 assembler->Bind(&if_valuenotnumber);
1493 { 1493 {
1494 // Convert to a Number first and try again. 1494 // We do not require an Or with earlier feedback here because once we
1495 Callable callable = 1495 // convert the value to a number, we cannot reach this path. We can
1496 CodeFactory::NonNumberToNumber(assembler->isolate()); 1496 // only reach this path on the first pass when the feedback is kNone.
1497 var_type_feedback.Bind( 1497 assembler->Assert(assembler->Word32Equal(
1498 assembler->Int32Constant(BinaryOperationFeedback::kAny)); 1498 var_type_feedback.value(),
1499 value_var.Bind(assembler->CallStub(callable, context, value)); 1499 assembler->Int32Constant(BinaryOperationFeedback::kNone)));
1500 assembler->Goto(&start); 1500
1501 Label if_valueisoddball(assembler), if_valuenotoddball(assembler);
1502 Node* instance_type = assembler->LoadMapInstanceType(value_map);
1503 Node* is_oddball = assembler->Word32Equal(
1504 instance_type, assembler->Int32Constant(ODDBALL_TYPE));
1505 assembler->Branch(is_oddball, &if_valueisoddball, &if_valuenotoddball);
1506
1507 assembler->Bind(&if_valueisoddball);
1508 {
1509 // Convert Oddball to Number and check again.
1510 value_var.Bind(
1511 assembler->LoadObjectField(value, Oddball::kToNumberOffset));
1512 var_type_feedback.Bind(assembler->Int32Constant(
1513 BinaryOperationFeedback::kNumberOrOddball));
1514 assembler->Goto(&start);
1515 }
1516
1517 assembler->Bind(&if_valuenotoddball);
1518 {
1519 // Convert to a Number first and try again.
1520 Callable callable =
1521 CodeFactory::NonNumberToNumber(assembler->isolate());
1522 var_type_feedback.Bind(
1523 assembler->Int32Constant(BinaryOperationFeedback::kAny));
1524 value_var.Bind(assembler->CallStub(callable, context, value));
1525 assembler->Goto(&start);
1526 }
1501 } 1527 }
1502 } 1528 }
1503 } 1529 }
1504 1530
1505 assembler->Bind(&do_finc); 1531 assembler->Bind(&do_finc);
1506 { 1532 {
1507 Node* finc_value = var_finc_value.value(); 1533 Node* finc_value = var_finc_value.value();
1508 Node* one = assembler->Float64Constant(1.0); 1534 Node* one = assembler->Float64Constant(1.0);
1509 Node* finc_result = assembler->Float64Add(finc_value, one); 1535 Node* finc_result = assembler->Float64Add(finc_value, one);
1510 var_type_feedback.Bind(assembler->Word32Or( 1536 var_type_feedback.Bind(assembler->Word32Or(
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 1620
1595 assembler->Bind(&if_valueisnumber); 1621 assembler->Bind(&if_valueisnumber);
1596 { 1622 {
1597 // Load the HeapNumber value. 1623 // Load the HeapNumber value.
1598 var_fdec_value.Bind(assembler->LoadHeapNumberValue(value)); 1624 var_fdec_value.Bind(assembler->LoadHeapNumberValue(value));
1599 assembler->Goto(&do_fdec); 1625 assembler->Goto(&do_fdec);
1600 } 1626 }
1601 1627
1602 assembler->Bind(&if_valuenotnumber); 1628 assembler->Bind(&if_valuenotnumber);
1603 { 1629 {
1604 // Convert to a Number first and try again. 1630 // We do not require an Or with earlier feedback here because once we
1605 Callable callable = 1631 // convert the value to a number, we cannot reach this path. We can
1606 CodeFactory::NonNumberToNumber(assembler->isolate()); 1632 // only reach this path on the first pass when the feedback is kNone.
1607 var_type_feedback.Bind( 1633 assembler->Assert(assembler->Word32Equal(
1608 assembler->Int32Constant(BinaryOperationFeedback::kAny)); 1634 var_type_feedback.value(),
1609 value_var.Bind(assembler->CallStub(callable, context, value)); 1635 assembler->Int32Constant(BinaryOperationFeedback::kNone)));
1610 assembler->Goto(&start); 1636
1637 Label if_valueisoddball(assembler), if_valuenotoddball(assembler);
1638 Node* instance_type = assembler->LoadMapInstanceType(value_map);
1639 Node* is_oddball = assembler->Word32Equal(
1640 instance_type, assembler->Int32Constant(ODDBALL_TYPE));
1641 assembler->Branch(is_oddball, &if_valueisoddball, &if_valuenotoddball);
1642
1643 assembler->Bind(&if_valueisoddball);
1644 {
1645 // Convert Oddball to Number and check again.
1646 value_var.Bind(
1647 assembler->LoadObjectField(value, Oddball::kToNumberOffset));
1648 var_type_feedback.Bind(assembler->Int32Constant(
1649 BinaryOperationFeedback::kNumberOrOddball));
1650 assembler->Goto(&start);
1651 }
1652
1653 assembler->Bind(&if_valuenotoddball);
1654 {
1655 // Convert to a Number first and try again.
1656 Callable callable =
1657 CodeFactory::NonNumberToNumber(assembler->isolate());
1658 var_type_feedback.Bind(
1659 assembler->Int32Constant(BinaryOperationFeedback::kAny));
1660 value_var.Bind(assembler->CallStub(callable, context, value));
1661 assembler->Goto(&start);
1662 }
1611 } 1663 }
1612 } 1664 }
1613 } 1665 }
1614 1666
1615 assembler->Bind(&do_fdec); 1667 assembler->Bind(&do_fdec);
1616 { 1668 {
1617 Node* fdec_value = var_fdec_value.value(); 1669 Node* fdec_value = var_fdec_value.value();
1618 Node* one = assembler->Float64Constant(1.0); 1670 Node* one = assembler->Float64Constant(1.0);
1619 Node* fdec_result = assembler->Float64Sub(fdec_value, one); 1671 Node* fdec_result = assembler->Float64Sub(fdec_value, one);
1620 var_type_feedback.Bind(assembler->Word32Or( 1672 var_type_feedback.Bind(assembler->Word32Or(
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
3026 3078
3027 if (type == MachineType::Pointer()) { 3079 if (type == MachineType::Pointer()) {
3028 return Representation::External(); 3080 return Representation::External();
3029 } 3081 }
3030 3082
3031 return Representation::Tagged(); 3083 return Representation::Tagged();
3032 } 3084 }
3033 3085
3034 } // namespace internal 3086 } // namespace internal
3035 } // namespace v8 3087 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/interpreter-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698