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 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1755 Label build_args; | 1755 Label build_args; |
1756 // Get rid of the arguments object probe. | 1756 // Get rid of the arguments object probe. |
1757 frame_->Drop(); | 1757 frame_->Drop(); |
1758 // Stack now has 3 elements on it. | 1758 // Stack now has 3 elements on it. |
1759 // Contents of stack at this point: | 1759 // Contents of stack at this point: |
1760 // sp[0]: receiver - in the receiver_reg register. | 1760 // sp[0]: receiver - in the receiver_reg register. |
1761 // sp[1]: applicand.apply | 1761 // sp[1]: applicand.apply |
1762 // sp[2]: applicand. | 1762 // sp[2]: applicand. |
1763 | 1763 |
1764 // Check that the receiver really is a JavaScript object. | 1764 // Check that the receiver really is a JavaScript object. |
1765 __ BranchOnSmi(receiver_reg, &build_args); | 1765 __ JumpIfSmi(receiver_reg, &build_args); |
1766 // We allow all JSObjects including JSFunctions. As long as | 1766 // We allow all JSObjects including JSFunctions. As long as |
1767 // JS_FUNCTION_TYPE is the last instance type and it is right | 1767 // JS_FUNCTION_TYPE is the last instance type and it is right |
1768 // after LAST_JS_OBJECT_TYPE, we do not have to check the upper | 1768 // after LAST_JS_OBJECT_TYPE, we do not have to check the upper |
1769 // bound. | 1769 // bound. |
1770 STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); | 1770 STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); |
1771 STATIC_ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1); | 1771 STATIC_ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1); |
1772 __ CompareObjectType(receiver_reg, r2, r3, FIRST_JS_OBJECT_TYPE); | 1772 __ CompareObjectType(receiver_reg, r2, r3, FIRST_JS_OBJECT_TYPE); |
1773 __ b(lt, &build_args); | 1773 __ b(lt, &build_args); |
1774 | 1774 |
1775 // Check that applicand.apply is Function.prototype.apply. | 1775 // Check that applicand.apply is Function.prototype.apply. |
1776 __ ldr(r0, MemOperand(sp, kPointerSize)); | 1776 __ ldr(r0, MemOperand(sp, kPointerSize)); |
1777 __ BranchOnSmi(r0, &build_args); | 1777 __ JumpIfSmi(r0, &build_args); |
1778 __ CompareObjectType(r0, r1, r2, JS_FUNCTION_TYPE); | 1778 __ CompareObjectType(r0, r1, r2, JS_FUNCTION_TYPE); |
1779 __ b(ne, &build_args); | 1779 __ b(ne, &build_args); |
1780 Handle<Code> apply_code(Builtins::builtin(Builtins::FunctionApply)); | 1780 Handle<Code> apply_code(Builtins::builtin(Builtins::FunctionApply)); |
1781 __ ldr(r1, FieldMemOperand(r0, JSFunction::kCodeEntryOffset)); | 1781 __ ldr(r1, FieldMemOperand(r0, JSFunction::kCodeEntryOffset)); |
1782 __ sub(r1, r1, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1782 __ sub(r1, r1, Operand(Code::kHeaderSize - kHeapObjectTag)); |
1783 __ cmp(r1, Operand(apply_code)); | 1783 __ cmp(r1, Operand(apply_code)); |
1784 __ b(ne, &build_args); | 1784 __ b(ne, &build_args); |
1785 | 1785 |
1786 // Check that applicand is a function. | 1786 // Check that applicand is a function. |
1787 __ ldr(r1, MemOperand(sp, 2 * kPointerSize)); | 1787 __ ldr(r1, MemOperand(sp, 2 * kPointerSize)); |
1788 __ BranchOnSmi(r1, &build_args); | 1788 __ JumpIfSmi(r1, &build_args); |
1789 __ CompareObjectType(r1, r2, r3, JS_FUNCTION_TYPE); | 1789 __ CompareObjectType(r1, r2, r3, JS_FUNCTION_TYPE); |
1790 __ b(ne, &build_args); | 1790 __ b(ne, &build_args); |
1791 | 1791 |
1792 // Copy the arguments to this function possibly from the | 1792 // Copy the arguments to this function possibly from the |
1793 // adaptor frame below it. | 1793 // adaptor frame below it. |
1794 Label invoke, adapted; | 1794 Label invoke, adapted; |
1795 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1795 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1796 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset)); | 1796 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset)); |
1797 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1797 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
1798 __ b(eq, &adapted); | 1798 __ b(eq, &adapted); |
(...skipping 2812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4611 // Get base and exponent to registers. | 4611 // Get base and exponent to registers. |
4612 Register exponent = frame_->PopToRegister(); | 4612 Register exponent = frame_->PopToRegister(); |
4613 Register base = frame_->PopToRegister(exponent); | 4613 Register base = frame_->PopToRegister(exponent); |
4614 Register heap_number_map = no_reg; | 4614 Register heap_number_map = no_reg; |
4615 | 4615 |
4616 // Set the frame for the runtime jump target. The code below jumps to the | 4616 // Set the frame for the runtime jump target. The code below jumps to the |
4617 // jump target label so the frame needs to be established before that. | 4617 // jump target label so the frame needs to be established before that. |
4618 ASSERT(runtime.entry_frame() == NULL); | 4618 ASSERT(runtime.entry_frame() == NULL); |
4619 runtime.set_entry_frame(frame_); | 4619 runtime.set_entry_frame(frame_); |
4620 | 4620 |
4621 __ BranchOnNotSmi(exponent, &exponent_nonsmi); | 4621 __ JumpIfNotSmi(exponent, &exponent_nonsmi); |
4622 __ BranchOnNotSmi(base, &base_nonsmi); | 4622 __ JumpIfNotSmi(base, &base_nonsmi); |
4623 | 4623 |
4624 heap_number_map = r6; | 4624 heap_number_map = r6; |
4625 __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); | 4625 __ LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); |
4626 | 4626 |
4627 // Exponent is a smi and base is a smi. Get the smi value into vfp register | 4627 // Exponent is a smi and base is a smi. Get the smi value into vfp register |
4628 // d1. | 4628 // d1. |
4629 __ SmiToDoubleVFPRegister(base, d1, scratch1, s0); | 4629 __ SmiToDoubleVFPRegister(base, d1, scratch1, s0); |
4630 __ b(&powi); | 4630 __ b(&powi); |
4631 | 4631 |
4632 __ bind(&base_nonsmi); | 4632 __ bind(&base_nonsmi); |
(...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7363 BinaryOpIC::GetName(runtime_operands_type_)); | 7363 BinaryOpIC::GetName(runtime_operands_type_)); |
7364 return name_; | 7364 return name_; |
7365 } | 7365 } |
7366 | 7366 |
7367 | 7367 |
7368 #undef __ | 7368 #undef __ |
7369 | 7369 |
7370 } } // namespace v8::internal | 7370 } } // namespace v8::internal |
7371 | 7371 |
7372 #endif // V8_TARGET_ARCH_ARM | 7372 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |