| 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 3483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3494 // sp: stack pointer (restored as callee's sp after C call) | 3494 // sp: stack pointer (restored as callee's sp after C call) |
| 3495 // cp: current context (C callee-saved) | 3495 // cp: current context (C callee-saved) |
| 3496 | 3496 |
| 3497 // Result returned in r0 or r0+r1 by default. | 3497 // Result returned in r0 or r0+r1 by default. |
| 3498 | 3498 |
| 3499 // NOTE: Invocations of builtins may return failure objects | 3499 // NOTE: Invocations of builtins may return failure objects |
| 3500 // instead of a proper result. The builtin entry handles | 3500 // instead of a proper result. The builtin entry handles |
| 3501 // this by performing a garbage collection and retrying the | 3501 // this by performing a garbage collection and retrying the |
| 3502 // builtin once. | 3502 // builtin once. |
| 3503 | 3503 |
| 3504 // Compute the argv pointer in a callee-saved register. |
| 3505 __ add(r6, sp, Operand(r0, LSL, kPointerSizeLog2)); |
| 3506 __ sub(r6, r6, Operand(kPointerSize)); |
| 3507 |
| 3504 // Enter the exit frame that transitions from JavaScript to C++. | 3508 // Enter the exit frame that transitions from JavaScript to C++. |
| 3505 __ EnterExitFrame(save_doubles_); | 3509 __ EnterExitFrame(save_doubles_); |
| 3506 | 3510 |
| 3511 // Setup argc and the builtin function in callee-saved registers. |
| 3512 __ mov(r4, Operand(r0)); |
| 3513 __ mov(r5, Operand(r1)); |
| 3514 |
| 3507 // r4: number of arguments (C callee-saved) | 3515 // r4: number of arguments (C callee-saved) |
| 3508 // r5: pointer to builtin function (C callee-saved) | 3516 // r5: pointer to builtin function (C callee-saved) |
| 3509 // r6: pointer to first argument (C callee-saved) | 3517 // r6: pointer to first argument (C callee-saved) |
| 3510 | 3518 |
| 3511 Label throw_normal_exception; | 3519 Label throw_normal_exception; |
| 3512 Label throw_termination_exception; | 3520 Label throw_termination_exception; |
| 3513 Label throw_out_of_memory_exception; | 3521 Label throw_out_of_memory_exception; |
| 3514 | 3522 |
| 3515 // Call into the runtime system. | 3523 // Call into the runtime system. |
| 3516 GenerateCore(masm, | 3524 GenerateCore(masm, |
| (...skipping 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5899 // Compute the entry point of the rewritten stub. | 5907 // Compute the entry point of the rewritten stub. |
| 5900 __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); | 5908 __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 5901 // Restore registers. | 5909 // Restore registers. |
| 5902 __ pop(lr); | 5910 __ pop(lr); |
| 5903 __ pop(r0); | 5911 __ pop(r0); |
| 5904 __ pop(r1); | 5912 __ pop(r1); |
| 5905 __ Jump(r2); | 5913 __ Jump(r2); |
| 5906 } | 5914 } |
| 5907 | 5915 |
| 5908 | 5916 |
| 5917 void DirectCEntryStub::Generate(MacroAssembler* masm) { |
| 5918 __ ldr(pc, MemOperand(sp, 0)); |
| 5919 } |
| 5920 |
| 5921 |
| 5922 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, |
| 5923 ApiFunction *function) { |
| 5924 __ mov(lr, Operand(reinterpret_cast<intptr_t>(GetCode().location()), |
| 5925 RelocInfo::CODE_TARGET)); |
| 5926 // Push return address (accessible to GC through exit frame pc). |
| 5927 __ mov(r2, |
| 5928 Operand(ExternalReference(function, ExternalReference::DIRECT_CALL))); |
| 5929 __ str(pc, MemOperand(sp, 0)); |
| 5930 __ Jump(r2); // Call the api function. |
| 5931 } |
| 5932 |
| 5933 |
| 5909 void GenerateFastPixelArrayLoad(MacroAssembler* masm, | 5934 void GenerateFastPixelArrayLoad(MacroAssembler* masm, |
| 5910 Register receiver, | 5935 Register receiver, |
| 5911 Register key, | 5936 Register key, |
| 5912 Register elements_map, | 5937 Register elements_map, |
| 5913 Register elements, | 5938 Register elements, |
| 5914 Register scratch1, | 5939 Register scratch1, |
| 5915 Register scratch2, | 5940 Register scratch2, |
| 5916 Register result, | 5941 Register result, |
| 5917 Label* not_pixel_array, | 5942 Label* not_pixel_array, |
| 5918 Label* key_not_smi, | 5943 Label* key_not_smi, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5971 __ SmiTag(r0, scratch1); | 5996 __ SmiTag(r0, scratch1); |
| 5972 __ Ret(); | 5997 __ Ret(); |
| 5973 } | 5998 } |
| 5974 | 5999 |
| 5975 | 6000 |
| 5976 #undef __ | 6001 #undef __ |
| 5977 | 6002 |
| 5978 } } // namespace v8::internal | 6003 } } // namespace v8::internal |
| 5979 | 6004 |
| 5980 #endif // V8_TARGET_ARCH_ARM | 6005 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |