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 | |
1593 void BitwiseOrStub::GenerateAssembly( | 1545 void BitwiseOrStub::GenerateAssembly( |
1594 compiler::CodeStubAssembler* assembler) const { | 1546 compiler::CodeStubAssembler* assembler) const { |
1595 using compiler::Node; | 1547 using compiler::Node; |
1596 | 1548 |
1597 Node* lhs = assembler->Parameter(0); | 1549 Node* lhs = assembler->Parameter(0); |
1598 Node* rhs = assembler->Parameter(1); | 1550 Node* rhs = assembler->Parameter(1); |
1599 Node* context = assembler->Parameter(2); | 1551 Node* context = assembler->Parameter(2); |
1600 Node* lhs_value = assembler->TruncateTaggedToWord32(context, lhs); | 1552 Node* lhs_value = assembler->TruncateTaggedToWord32(context, lhs); |
1601 Node* rhs_value = assembler->TruncateTaggedToWord32(context, rhs); | 1553 Node* rhs_value = assembler->TruncateTaggedToWord32(context, rhs); |
1602 Node* value = assembler->Word32Or(lhs_value, rhs_value); | 1554 Node* value = assembler->Word32Or(lhs_value, rhs_value); |
(...skipping 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4058 if (type->Is(Type::UntaggedPointer())) { | 4010 if (type->Is(Type::UntaggedPointer())) { |
4059 return Representation::External(); | 4011 return Representation::External(); |
4060 } | 4012 } |
4061 | 4013 |
4062 DCHECK(!type->Is(Type::Untagged())); | 4014 DCHECK(!type->Is(Type::Untagged())); |
4063 return Representation::Tagged(); | 4015 return Representation::Tagged(); |
4064 } | 4016 } |
4065 | 4017 |
4066 } // namespace internal | 4018 } // namespace internal |
4067 } // namespace v8 | 4019 } // namespace v8 |
OLD | NEW |