OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 __ bind(&done); | 1581 __ bind(&done); |
1582 } | 1582 } |
1583 | 1583 |
1584 | 1584 |
1585 void LCodeGen::DoLoadElements(LLoadElements* instr) { | 1585 void LCodeGen::DoLoadElements(LLoadElements* instr) { |
1586 Abort("DoLoadElements unimplemented."); | 1586 Abort("DoLoadElements unimplemented."); |
1587 } | 1587 } |
1588 | 1588 |
1589 | 1589 |
1590 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 1590 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
1591 Abort("DoAccessArgumentsAt unimplemented."); | 1591 Register arguments = ToRegister(instr->arguments()); |
| 1592 Register length = ToRegister(instr->length()); |
| 1593 Operand index = ToOperand(instr->index()); |
| 1594 Register result = ToRegister(instr->result()); |
| 1595 |
| 1596 __ sub(length, length, index); |
| 1597 DeoptimizeIf(hi, instr->environment()); |
| 1598 |
| 1599 // There are two words between the frame pointer and the last argument. |
| 1600 // Subtracting from length accounts for one of them add one more. |
| 1601 __ add(length, length, Operand(1)); |
| 1602 __ ldr(result, MemOperand(arguments, length, LSL, kPointerSizeLog2)); |
1592 } | 1603 } |
1593 | 1604 |
1594 | 1605 |
1595 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { | 1606 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { |
1596 Abort("DoLoadKeyedFastElement unimplemented."); | 1607 Abort("DoLoadKeyedFastElement unimplemented."); |
1597 } | 1608 } |
1598 | 1609 |
1599 | 1610 |
1600 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 1611 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
1601 ASSERT(ToRegister(instr->object()).is(r1)); | 1612 ASSERT(ToRegister(instr->object()).is(r1)); |
1602 ASSERT(ToRegister(instr->key()).is(r0)); | 1613 ASSERT(ToRegister(instr->key()).is(r0)); |
1603 | 1614 |
1604 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); | 1615 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); |
1605 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 1616 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
1606 } | 1617 } |
1607 | 1618 |
1608 | 1619 |
1609 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 1620 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
1610 Abort("DoArgumentsElements unimplemented."); | 1621 Register scratch = scratch0(); |
| 1622 Register result = ToRegister(instr->result()); |
| 1623 |
| 1624 // Check if the calling frame is an arguments adaptor frame. |
| 1625 Label done, adapted; |
| 1626 __ ldr(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 1627 __ ldr(result, MemOperand(scratch, StandardFrameConstants::kContextOffset)); |
| 1628 __ cmp(result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 1629 |
| 1630 // Result is the frame pointer for the frame if not adapted and for the real |
| 1631 // frame below the adaptor frame if adapted. |
| 1632 __ mov(result, fp, LeaveCC, ne); |
| 1633 __ mov(result, scratch, LeaveCC, eq); |
1611 } | 1634 } |
1612 | 1635 |
1613 | 1636 |
1614 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { | 1637 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
1615 Abort("DoArgumentsLength unimplemented."); | 1638 Operand elem = ToOperand(instr->input()); |
| 1639 Register result = ToRegister(instr->result()); |
| 1640 |
| 1641 Label done; |
| 1642 |
| 1643 // If no arguments adaptor frame the number of arguments is fixed. |
| 1644 __ cmp(fp, elem); |
| 1645 __ mov(result, Operand(scope()->num_parameters())); |
| 1646 __ b(eq, &done); |
| 1647 |
| 1648 // Arguments adaptor frame present. Get argument length from there. |
| 1649 __ ldr(result, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 1650 __ ldr(result, |
| 1651 MemOperand(result, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 1652 __ SmiUntag(result); |
| 1653 |
| 1654 // Argument length is in result register. |
| 1655 __ bind(&done); |
1616 } | 1656 } |
1617 | 1657 |
1618 | 1658 |
1619 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { | 1659 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
1620 Abort("DoApplyArguments unimplemented."); | 1660 Abort("DoApplyArguments unimplemented."); |
1621 } | 1661 } |
1622 | 1662 |
1623 | 1663 |
1624 void LCodeGen::DoPushArgument(LPushArgument* instr) { | 1664 void LCodeGen::DoPushArgument(LPushArgument* instr) { |
1625 LOperand* argument = instr->input(); | 1665 LOperand* argument = instr->input(); |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2370 | 2410 |
2371 | 2411 |
2372 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2412 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
2373 Abort("DoOsrEntry unimplemented."); | 2413 Abort("DoOsrEntry unimplemented."); |
2374 } | 2414 } |
2375 | 2415 |
2376 | 2416 |
2377 #undef __ | 2417 #undef __ |
2378 | 2418 |
2379 } } // namespace v8::internal | 2419 } } // namespace v8::internal |
OLD | NEW |