OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 5605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5616 // This code should be unreachable. | 5616 // This code should be unreachable. |
5617 __ stop("Unreachable"); | 5617 __ stop("Unreachable"); |
5618 } | 5618 } |
5619 | 5619 |
5620 | 5620 |
5621 void StackCheckStub::Generate(MacroAssembler* masm) { | 5621 void StackCheckStub::Generate(MacroAssembler* masm) { |
5622 // Do tail-call to runtime routine. Runtime routines expect at least one | 5622 // Do tail-call to runtime routine. Runtime routines expect at least one |
5623 // argument, so give it a Smi. | 5623 // argument, so give it a Smi. |
5624 __ mov(r0, Operand(Smi::FromInt(0))); | 5624 __ mov(r0, Operand(Smi::FromInt(0))); |
5625 __ push(r0); | 5625 __ push(r0); |
5626 __ TailCallRuntime(ExternalReference(Runtime::kStackGuard), 1); | 5626 __ TailCallRuntime(ExternalReference(Runtime::kStackGuard), 1, 1); |
5627 | 5627 |
5628 __ StubReturn(1); | 5628 __ StubReturn(1); |
5629 } | 5629 } |
5630 | 5630 |
5631 | 5631 |
5632 void UnarySubStub::Generate(MacroAssembler* masm) { | 5632 void UnarySubStub::Generate(MacroAssembler* masm) { |
5633 Label undo; | 5633 Label undo; |
5634 Label slow; | 5634 Label slow; |
5635 Label not_smi; | 5635 Label not_smi; |
5636 | 5636 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5671 __ ldr(r2, FieldMemOperand(r0, HeapNumber::kExponentOffset)); | 5671 __ ldr(r2, FieldMemOperand(r0, HeapNumber::kExponentOffset)); |
5672 __ str(r3, FieldMemOperand(r1, HeapNumber::kMantissaOffset)); | 5672 __ str(r3, FieldMemOperand(r1, HeapNumber::kMantissaOffset)); |
5673 __ eor(r2, r2, Operand(HeapNumber::kSignMask)); // Flip sign. | 5673 __ eor(r2, r2, Operand(HeapNumber::kSignMask)); // Flip sign. |
5674 __ str(r2, FieldMemOperand(r1, HeapNumber::kExponentOffset)); | 5674 __ str(r2, FieldMemOperand(r1, HeapNumber::kExponentOffset)); |
5675 __ mov(r0, Operand(r1)); | 5675 __ mov(r0, Operand(r1)); |
5676 } | 5676 } |
5677 __ StubReturn(1); | 5677 __ StubReturn(1); |
5678 } | 5678 } |
5679 | 5679 |
5680 | 5680 |
| 5681 int CEntryStub::MinorKey() { |
| 5682 ASSERT(result_size_ <= 2); |
| 5683 // Result returned in r0 or r0+r1 by default. |
| 5684 return 0; |
| 5685 } |
| 5686 |
| 5687 |
5681 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { | 5688 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { |
5682 // r0 holds the exception. | 5689 // r0 holds the exception. |
5683 | 5690 |
5684 // Adjust this code if not the case. | 5691 // Adjust this code if not the case. |
5685 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); | 5692 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
5686 | 5693 |
5687 // Drop the sp to the top of the handler. | 5694 // Drop the sp to the top of the handler. |
5688 __ mov(r3, Operand(ExternalReference(Top::k_handler_address))); | 5695 __ mov(r3, Operand(ExternalReference(Top::k_handler_address))); |
5689 __ ldr(sp, MemOperand(r3)); | 5696 __ ldr(sp, MemOperand(r3)); |
5690 | 5697 |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6188 // Read the argument from the adaptor frame and return it. | 6195 // Read the argument from the adaptor frame and return it. |
6189 __ sub(r3, r0, r1); | 6196 __ sub(r3, r0, r1); |
6190 __ add(r3, r2, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6197 __ add(r3, r2, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); |
6191 __ ldr(r0, MemOperand(r3, kDisplacement)); | 6198 __ ldr(r0, MemOperand(r3, kDisplacement)); |
6192 __ Jump(lr); | 6199 __ Jump(lr); |
6193 | 6200 |
6194 // Slow-case: Handle non-smi or out-of-bounds access to arguments | 6201 // Slow-case: Handle non-smi or out-of-bounds access to arguments |
6195 // by calling the runtime system. | 6202 // by calling the runtime system. |
6196 __ bind(&slow); | 6203 __ bind(&slow); |
6197 __ push(r1); | 6204 __ push(r1); |
6198 __ TailCallRuntime(ExternalReference(Runtime::kGetArgumentsProperty), 1); | 6205 __ TailCallRuntime(ExternalReference(Runtime::kGetArgumentsProperty), 1, 1); |
6199 } | 6206 } |
6200 | 6207 |
6201 | 6208 |
6202 void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) { | 6209 void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) { |
6203 // Check if the calling frame is an arguments adaptor frame. | 6210 // Check if the calling frame is an arguments adaptor frame. |
6204 Label runtime; | 6211 Label runtime; |
6205 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 6212 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
6206 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset)); | 6213 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset)); |
6207 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 6214 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
6208 __ b(ne, &runtime); | 6215 __ b(ne, &runtime); |
6209 | 6216 |
6210 // Patch the arguments.length and the parameters pointer. | 6217 // Patch the arguments.length and the parameters pointer. |
6211 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 6218 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
6212 __ str(r0, MemOperand(sp, 0 * kPointerSize)); | 6219 __ str(r0, MemOperand(sp, 0 * kPointerSize)); |
6213 __ add(r3, r2, Operand(r0, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6220 __ add(r3, r2, Operand(r0, LSL, kPointerSizeLog2 - kSmiTagSize)); |
6214 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); | 6221 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); |
6215 __ str(r3, MemOperand(sp, 1 * kPointerSize)); | 6222 __ str(r3, MemOperand(sp, 1 * kPointerSize)); |
6216 | 6223 |
6217 // Do the runtime call to allocate the arguments object. | 6224 // Do the runtime call to allocate the arguments object. |
6218 __ bind(&runtime); | 6225 __ bind(&runtime); |
6219 __ TailCallRuntime(ExternalReference(Runtime::kNewArgumentsFast), 3); | 6226 __ TailCallRuntime(ExternalReference(Runtime::kNewArgumentsFast), 3, 1); |
6220 } | 6227 } |
6221 | 6228 |
6222 | 6229 |
6223 void CallFunctionStub::Generate(MacroAssembler* masm) { | 6230 void CallFunctionStub::Generate(MacroAssembler* masm) { |
6224 Label slow; | 6231 Label slow; |
6225 // Get the function to call from the stack. | 6232 // Get the function to call from the stack. |
6226 // function, receiver [, arguments] | 6233 // function, receiver [, arguments] |
6227 __ ldr(r1, MemOperand(sp, (argc_ + 1) * kPointerSize)); | 6234 __ ldr(r1, MemOperand(sp, (argc_ + 1) * kPointerSize)); |
6228 | 6235 |
6229 // Check that the function is really a JavaScript function. | 6236 // Check that the function is really a JavaScript function. |
(...skipping 21 matching lines...) Expand all Loading... |
6251 int CompareStub::MinorKey() { | 6258 int CompareStub::MinorKey() { |
6252 // Encode the two parameters in a unique 16 bit value. | 6259 // Encode the two parameters in a unique 16 bit value. |
6253 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); | 6260 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); |
6254 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); | 6261 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); |
6255 } | 6262 } |
6256 | 6263 |
6257 | 6264 |
6258 #undef __ | 6265 #undef __ |
6259 | 6266 |
6260 } } // namespace v8::internal | 6267 } } // namespace v8::internal |
OLD | NEW |