| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 } | 790 } |
| 791 | 791 |
| 792 | 792 |
| 793 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { | 793 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { |
| 794 Register result = ToRegister(instr->result()); | 794 Register result = ToRegister(instr->result()); |
| 795 Register array = ToRegister(instr->InputAt(0)); | 795 Register array = ToRegister(instr->InputAt(0)); |
| 796 __ movq(result, FieldOperand(array, FixedArray::kLengthOffset)); | 796 __ movq(result, FieldOperand(array, FixedArray::kLengthOffset)); |
| 797 } | 797 } |
| 798 | 798 |
| 799 | 799 |
| 800 void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) { |
| 801 Register result = ToRegister(instr->result()); |
| 802 Register array = ToRegister(instr->InputAt(0)); |
| 803 __ movq(result, FieldOperand(array, PixelArray::kLengthOffset)); |
| 804 } |
| 805 |
| 806 |
| 800 void LCodeGen::DoValueOf(LValueOf* instr) { | 807 void LCodeGen::DoValueOf(LValueOf* instr) { |
| 801 Abort("Unimplemented: %s", "DoValueOf"); | 808 Abort("Unimplemented: %s", "DoValueOf"); |
| 802 } | 809 } |
| 803 | 810 |
| 804 | 811 |
| 805 void LCodeGen::DoBitNotI(LBitNotI* instr) { | 812 void LCodeGen::DoBitNotI(LBitNotI* instr) { |
| 806 LOperand* input = instr->InputAt(0); | 813 LOperand* input = instr->InputAt(0); |
| 807 ASSERT(input->Equals(instr->result())); | 814 ASSERT(input->Equals(instr->result())); |
| 808 __ not_(ToRegister(input)); | 815 __ not_(ToRegister(input)); |
| 809 } | 816 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 __ jmp(deferred_stack_check->entry()); | 963 __ jmp(deferred_stack_check->entry()); |
| 957 deferred_stack_check->SetExit(chunk_->GetAssemblyLabel(block)); | 964 deferred_stack_check->SetExit(chunk_->GetAssemblyLabel(block)); |
| 958 } else { | 965 } else { |
| 959 __ jmp(chunk_->GetAssemblyLabel(block)); | 966 __ jmp(chunk_->GetAssemblyLabel(block)); |
| 960 } | 967 } |
| 961 } | 968 } |
| 962 } | 969 } |
| 963 | 970 |
| 964 | 971 |
| 965 void LCodeGen::DoDeferredStackCheck(LGoto* instr) { | 972 void LCodeGen::DoDeferredStackCheck(LGoto* instr) { |
| 966 Abort("Unimplemented: %s", "DoDeferredStackCheck"); | 973 __ Pushad(); |
| 974 __ CallRuntimeSaveDoubles(Runtime::kStackGuard); |
| 975 RecordSafepointWithRegisters( |
| 976 instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex); |
| 977 __ Popad(); |
| 967 } | 978 } |
| 968 | 979 |
| 969 | 980 |
| 970 void LCodeGen::DoGoto(LGoto* instr) { | 981 void LCodeGen::DoGoto(LGoto* instr) { |
| 971 class DeferredStackCheck: public LDeferredCode { | 982 class DeferredStackCheck: public LDeferredCode { |
| 972 public: | 983 public: |
| 973 DeferredStackCheck(LCodeGen* codegen, LGoto* instr) | 984 DeferredStackCheck(LCodeGen* codegen, LGoto* instr) |
| 974 : LDeferredCode(codegen), instr_(instr) { } | 985 : LDeferredCode(codegen), instr_(instr) { } |
| 975 virtual void Generate() { codegen()->DoDeferredStackCheck(instr_); } | 986 virtual void Generate() { codegen()->DoDeferredStackCheck(instr_); } |
| 976 private: | 987 private: |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 Abort("Unimplemented: %s", "DoLoadNamedGeneric"); | 1577 Abort("Unimplemented: %s", "DoLoadNamedGeneric"); |
| 1567 } | 1578 } |
| 1568 | 1579 |
| 1569 | 1580 |
| 1570 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 1581 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
| 1571 Abort("Unimplemented: %s", "DoLoadFunctionPrototype"); | 1582 Abort("Unimplemented: %s", "DoLoadFunctionPrototype"); |
| 1572 } | 1583 } |
| 1573 | 1584 |
| 1574 | 1585 |
| 1575 void LCodeGen::DoLoadElements(LLoadElements* instr) { | 1586 void LCodeGen::DoLoadElements(LLoadElements* instr) { |
| 1576 ASSERT(instr->result()->Equals(instr->InputAt(0))); | 1587 Register result = ToRegister(instr->result()); |
| 1577 Register reg = ToRegister(instr->InputAt(0)); | 1588 Register input = ToRegister(instr->InputAt(0)); |
| 1578 __ movq(reg, FieldOperand(reg, JSObject::kElementsOffset)); | 1589 __ movq(result, FieldOperand(input, JSObject::kElementsOffset)); |
| 1579 if (FLAG_debug_code) { | 1590 if (FLAG_debug_code) { |
| 1580 NearLabel done; | 1591 NearLabel done; |
| 1581 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), | 1592 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), |
| 1582 Factory::fixed_array_map()); | 1593 Factory::fixed_array_map()); |
| 1583 __ j(equal, &done); | 1594 __ j(equal, &done); |
| 1584 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), | 1595 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), |
| 1596 Factory::pixel_array_map()); |
| 1597 __ j(equal, &done); |
| 1598 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), |
| 1585 Factory::fixed_cow_array_map()); | 1599 Factory::fixed_cow_array_map()); |
| 1586 __ Check(equal, "Check for fast elements failed."); | 1600 __ Check(equal, "Check for fast elements failed."); |
| 1587 __ bind(&done); | 1601 __ bind(&done); |
| 1588 } | 1602 } |
| 1589 } | 1603 } |
| 1590 | 1604 |
| 1591 | 1605 |
| 1606 void LCodeGen::DoLoadPixelArrayExternalPointer( |
| 1607 LLoadPixelArrayExternalPointer* instr) { |
| 1608 Register result = ToRegister(instr->result()); |
| 1609 Register input = ToRegister(instr->InputAt(0)); |
| 1610 __ movq(result, FieldOperand(input, PixelArray::kExternalPointerOffset)); |
| 1611 } |
| 1612 |
| 1613 |
| 1592 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 1614 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
| 1593 Abort("Unimplemented: %s", "DoAccessArgumentsAt"); | 1615 Abort("Unimplemented: %s", "DoAccessArgumentsAt"); |
| 1594 } | 1616 } |
| 1595 | 1617 |
| 1596 | 1618 |
| 1597 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { | 1619 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { |
| 1598 Register elements = ToRegister(instr->elements()); | 1620 Register elements = ToRegister(instr->elements()); |
| 1599 Register key = ToRegister(instr->key()); | 1621 Register key = ToRegister(instr->key()); |
| 1600 Register result = ToRegister(instr->result()); | 1622 Register result = ToRegister(instr->result()); |
| 1601 ASSERT(result.is(elements)); | 1623 ASSERT(result.is(elements)); |
| 1602 | 1624 |
| 1603 // Load the result. | 1625 // Load the result. |
| 1604 __ movq(result, FieldOperand(elements, | 1626 __ movq(result, FieldOperand(elements, |
| 1605 key, | 1627 key, |
| 1606 times_pointer_size, | 1628 times_pointer_size, |
| 1607 FixedArray::kHeaderSize)); | 1629 FixedArray::kHeaderSize)); |
| 1608 | 1630 |
| 1609 // Check for the hole value. | 1631 // Check for the hole value. |
| 1610 __ Cmp(result, Factory::the_hole_value()); | 1632 __ Cmp(result, Factory::the_hole_value()); |
| 1611 DeoptimizeIf(equal, instr->environment()); | 1633 DeoptimizeIf(equal, instr->environment()); |
| 1612 } | 1634 } |
| 1613 | 1635 |
| 1614 | 1636 |
| 1637 void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) { |
| 1638 Register external_elements = ToRegister(instr->external_pointer()); |
| 1639 Register key = ToRegister(instr->key()); |
| 1640 Register result = ToRegister(instr->result()); |
| 1641 ASSERT(result.is(external_elements)); |
| 1642 |
| 1643 // Load the result. |
| 1644 __ movzxbq(result, Operand(external_elements, key, times_1, 0)); |
| 1645 } |
| 1646 |
| 1647 |
| 1615 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 1648 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
| 1616 Abort("Unimplemented: %s", "DoLoadKeyedGeneric"); | 1649 Abort("Unimplemented: %s", "DoLoadKeyedGeneric"); |
| 1617 } | 1650 } |
| 1618 | 1651 |
| 1619 | 1652 |
| 1620 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 1653 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
| 1621 Abort("Unimplemented: %s", "DoArgumentsElements"); | 1654 Abort("Unimplemented: %s", "DoArgumentsElements"); |
| 1622 } | 1655 } |
| 1623 | 1656 |
| 1624 | 1657 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1919 RecordSafepointWithRegisters( | 1952 RecordSafepointWithRegisters( |
| 1920 instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex); | 1953 instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex); |
| 1921 // Ensure that value in rax survives popping registers. | 1954 // Ensure that value in rax survives popping registers. |
| 1922 __ movq(kScratchRegister, rax); | 1955 __ movq(kScratchRegister, rax); |
| 1923 __ PopSafepointRegisters(); | 1956 __ PopSafepointRegisters(); |
| 1924 __ movq(reg, kScratchRegister); | 1957 __ movq(reg, kScratchRegister); |
| 1925 } | 1958 } |
| 1926 | 1959 |
| 1927 | 1960 |
| 1928 void LCodeGen::DoSmiTag(LSmiTag* instr) { | 1961 void LCodeGen::DoSmiTag(LSmiTag* instr) { |
| 1929 Abort("Unimplemented: %s", "DoSmiTag"); | 1962 Register to_reg = ToRegister(instr->result()); |
| 1963 Register from_reg = ToRegister(instr->InputAt(0)); |
| 1964 __ Integer32ToSmi(to_reg, from_reg); |
| 1930 } | 1965 } |
| 1931 | 1966 |
| 1932 | 1967 |
| 1933 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { | 1968 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { |
| 1934 Abort("Unimplemented: %s", "DoSmiUntag"); | 1969 Abort("Unimplemented: %s", "DoSmiUntag"); |
| 1935 } | 1970 } |
| 1936 | 1971 |
| 1937 | 1972 |
| 1938 void LCodeGen::EmitNumberUntagD(Register input_reg, | 1973 void LCodeGen::EmitNumberUntagD(Register input_reg, |
| 1939 XMMRegister result_reg, | 1974 XMMRegister result_reg, |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2329 | 2364 |
| 2330 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2365 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
| 2331 Abort("Unimplemented: %s", "DoOsrEntry"); | 2366 Abort("Unimplemented: %s", "DoOsrEntry"); |
| 2332 } | 2367 } |
| 2333 | 2368 |
| 2334 #undef __ | 2369 #undef __ |
| 2335 | 2370 |
| 2336 } } // namespace v8::internal | 2371 } } // namespace v8::internal |
| 2337 | 2372 |
| 2338 #endif // V8_TARGET_ARCH_X64 | 2373 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |