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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 | 1535 |
1536 assembler->Bind(&do_fmod); | 1536 assembler->Bind(&do_fmod); |
1537 { | 1537 { |
1538 Node* value = assembler->Float64Mod(var_dividend_float64.value(), | 1538 Node* value = assembler->Float64Mod(var_dividend_float64.value(), |
1539 var_divisor_float64.value()); | 1539 var_divisor_float64.value()); |
1540 Node* result = assembler->ChangeFloat64ToTagged(value); | 1540 Node* result = assembler->ChangeFloat64ToTagged(value); |
1541 assembler->Return(result); | 1541 assembler->Return(result); |
1542 } | 1542 } |
1543 } | 1543 } |
1544 | 1544 |
| 1545 void ShiftLeftStub::GenerateAssembly( |
| 1546 compiler::CodeStubAssembler* assembler) const { |
| 1547 using compiler::Node; |
| 1548 |
| 1549 Node* lhs = assembler->Parameter(0); |
| 1550 Node* rhs = assembler->Parameter(1); |
| 1551 Node* context = assembler->Parameter(2); |
| 1552 Node* lhs_value = assembler->TruncateTaggedToWord32(context, lhs); |
| 1553 Node* rhs_value = assembler->TruncateTaggedToWord32(context, rhs); |
| 1554 Node* shift_count = |
| 1555 assembler->Word32And(rhs_value, assembler->Int32Constant(0x1f)); |
| 1556 Node* value = assembler->Word32Shl(lhs_value, shift_count); |
| 1557 Node* result = assembler->ChangeInt32ToTagged(value); |
| 1558 assembler->Return(result); |
| 1559 } |
| 1560 |
| 1561 void ShiftRightStub::GenerateAssembly( |
| 1562 compiler::CodeStubAssembler* assembler) const { |
| 1563 using compiler::Node; |
| 1564 |
| 1565 Node* lhs = assembler->Parameter(0); |
| 1566 Node* rhs = assembler->Parameter(1); |
| 1567 Node* context = assembler->Parameter(2); |
| 1568 Node* lhs_value = assembler->TruncateTaggedToWord32(context, lhs); |
| 1569 Node* rhs_value = assembler->TruncateTaggedToWord32(context, rhs); |
| 1570 Node* shift_count = |
| 1571 assembler->Word32And(rhs_value, assembler->Int32Constant(0x1f)); |
| 1572 Node* value = assembler->Word32Sar(lhs_value, shift_count); |
| 1573 Node* result = assembler->ChangeInt32ToTagged(value); |
| 1574 assembler->Return(result); |
| 1575 } |
| 1576 |
| 1577 void ShiftRightLogicalStub::GenerateAssembly( |
| 1578 compiler::CodeStubAssembler* assembler) const { |
| 1579 using compiler::Node; |
| 1580 |
| 1581 Node* lhs = assembler->Parameter(0); |
| 1582 Node* rhs = assembler->Parameter(1); |
| 1583 Node* context = assembler->Parameter(2); |
| 1584 Node* lhs_value = assembler->TruncateTaggedToWord32(context, lhs); |
| 1585 Node* rhs_value = assembler->TruncateTaggedToWord32(context, rhs); |
| 1586 Node* shift_count = |
| 1587 assembler->Word32And(rhs_value, assembler->Int32Constant(0x1f)); |
| 1588 Node* value = assembler->Word32Shr(lhs_value, shift_count); |
| 1589 Node* result = assembler->ChangeUint32ToTagged(value); |
| 1590 assembler->Return(result); |
| 1591 } |
| 1592 |
1545 void BitwiseOrStub::GenerateAssembly( | 1593 void BitwiseOrStub::GenerateAssembly( |
1546 compiler::CodeStubAssembler* assembler) const { | 1594 compiler::CodeStubAssembler* assembler) const { |
1547 using compiler::Node; | 1595 using compiler::Node; |
1548 | 1596 |
1549 Node* lhs = assembler->Parameter(0); | 1597 Node* lhs = assembler->Parameter(0); |
1550 Node* rhs = assembler->Parameter(1); | 1598 Node* rhs = assembler->Parameter(1); |
1551 Node* context = assembler->Parameter(2); | 1599 Node* context = assembler->Parameter(2); |
1552 Node* lhs_value = assembler->TruncateTaggedToWord32(context, lhs); | 1600 Node* lhs_value = assembler->TruncateTaggedToWord32(context, lhs); |
1553 Node* rhs_value = assembler->TruncateTaggedToWord32(context, rhs); | 1601 Node* rhs_value = assembler->TruncateTaggedToWord32(context, rhs); |
1554 Node* value = assembler->Word32Or(lhs_value, rhs_value); | 1602 Node* value = assembler->Word32Or(lhs_value, rhs_value); |
(...skipping 2451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4006 if (type->Is(Type::UntaggedPointer())) { | 4054 if (type->Is(Type::UntaggedPointer())) { |
4007 return Representation::External(); | 4055 return Representation::External(); |
4008 } | 4056 } |
4009 | 4057 |
4010 DCHECK(!type->Is(Type::Untagged())); | 4058 DCHECK(!type->Is(Type::Untagged())); |
4011 return Representation::Tagged(); | 4059 return Representation::Tagged(); |
4012 } | 4060 } |
4013 | 4061 |
4014 } // namespace internal | 4062 } // namespace internal |
4015 } // namespace v8 | 4063 } // namespace v8 |
OLD | NEW |