OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 |
11 // with the distribution. | 11 // with the distribution. |
12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
15 // | 15 // |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #if defined(V8_TARGET_ARCH_ARM) | 30 #if V8_TARGET_ARCH_ARM |
31 | 31 |
32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
33 #include "code-stubs.h" | 33 #include "code-stubs.h" |
34 #include "regexp-macro-assembler.h" | 34 #include "regexp-macro-assembler.h" |
35 #include "stub-cache.h" | 35 #include "stub-cache.h" |
36 | 36 |
37 namespace v8 { | 37 namespace v8 { |
38 namespace internal { | 38 namespace internal { |
39 | 39 |
40 | 40 |
(...skipping 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3066 __ ldr(r1, MemOperand(r0)); | 3066 __ ldr(r1, MemOperand(r0)); |
3067 __ add(r1, r1, Operand(1)); | 3067 __ add(r1, r1, Operand(1)); |
3068 __ str(r1, MemOperand(r0)); | 3068 __ str(r1, MemOperand(r0)); |
3069 } | 3069 } |
3070 | 3070 |
3071 // Call C built-in. | 3071 // Call C built-in. |
3072 // r0 = argc, r1 = argv | 3072 // r0 = argc, r1 = argv |
3073 __ mov(r0, Operand(r4)); | 3073 __ mov(r0, Operand(r4)); |
3074 __ mov(r1, Operand(r6)); | 3074 __ mov(r1, Operand(r6)); |
3075 | 3075 |
3076 #if defined(V8_HOST_ARCH_ARM) | 3076 #if V8_HOST_ARCH_ARM |
3077 int frame_alignment = MacroAssembler::ActivationFrameAlignment(); | 3077 int frame_alignment = MacroAssembler::ActivationFrameAlignment(); |
3078 int frame_alignment_mask = frame_alignment - 1; | 3078 int frame_alignment_mask = frame_alignment - 1; |
3079 if (FLAG_debug_code) { | 3079 if (FLAG_debug_code) { |
3080 if (frame_alignment > kPointerSize) { | 3080 if (frame_alignment > kPointerSize) { |
3081 Label alignment_as_expected; | 3081 Label alignment_as_expected; |
3082 ASSERT(IsPowerOf2(frame_alignment)); | 3082 ASSERT(IsPowerOf2(frame_alignment)); |
3083 __ tst(sp, Operand(frame_alignment_mask)); | 3083 __ tst(sp, Operand(frame_alignment_mask)); |
3084 __ b(eq, &alignment_as_expected); | 3084 __ b(eq, &alignment_as_expected); |
3085 // Don't use Check here, as it will call Runtime_Abort re-entering here. | 3085 // Don't use Check here, as it will call Runtime_Abort re-entering here. |
3086 __ stop("Unexpected alignment"); | 3086 __ stop("Unexpected alignment"); |
(...skipping 4021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7108 __ add(r1, sp, Operand(kNumSavedRegs * kPointerSize)); | 7108 __ add(r1, sp, Operand(kNumSavedRegs * kPointerSize)); |
7109 | 7109 |
7110 // Align the stack if necessary. | 7110 // Align the stack if necessary. |
7111 int frame_alignment = masm->ActivationFrameAlignment(); | 7111 int frame_alignment = masm->ActivationFrameAlignment(); |
7112 if (frame_alignment > kPointerSize) { | 7112 if (frame_alignment > kPointerSize) { |
7113 __ mov(r5, sp); | 7113 __ mov(r5, sp); |
7114 ASSERT(IsPowerOf2(frame_alignment)); | 7114 ASSERT(IsPowerOf2(frame_alignment)); |
7115 __ and_(sp, sp, Operand(-frame_alignment)); | 7115 __ and_(sp, sp, Operand(-frame_alignment)); |
7116 } | 7116 } |
7117 | 7117 |
7118 #if defined(V8_HOST_ARCH_ARM) | 7118 #if V8_HOST_ARCH_ARM |
7119 __ mov(ip, Operand(reinterpret_cast<int32_t>(&entry_hook_))); | 7119 __ mov(ip, Operand(reinterpret_cast<int32_t>(&entry_hook_))); |
7120 __ ldr(ip, MemOperand(ip)); | 7120 __ ldr(ip, MemOperand(ip)); |
7121 #else | 7121 #else |
7122 // Under the simulator we need to indirect the entry hook through a | 7122 // Under the simulator we need to indirect the entry hook through a |
7123 // trampoline function at a known address. | 7123 // trampoline function at a known address. |
7124 Address trampoline_address = reinterpret_cast<Address>( | 7124 Address trampoline_address = reinterpret_cast<Address>( |
7125 reinterpret_cast<intptr_t>(EntryHookTrampoline)); | 7125 reinterpret_cast<intptr_t>(EntryHookTrampoline)); |
7126 ApiFunction dispatcher(trampoline_address); | 7126 ApiFunction dispatcher(trampoline_address); |
7127 __ mov(ip, Operand(ExternalReference(&dispatcher, | 7127 __ mov(ip, Operand(ExternalReference(&dispatcher, |
7128 ExternalReference::BUILTIN_CALL, | 7128 ExternalReference::BUILTIN_CALL, |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7411 __ bind(&fast_elements_case); | 7411 __ bind(&fast_elements_case); |
7412 GenerateCase(masm, FAST_ELEMENTS); | 7412 GenerateCase(masm, FAST_ELEMENTS); |
7413 } | 7413 } |
7414 | 7414 |
7415 | 7415 |
7416 #undef __ | 7416 #undef __ |
7417 | 7417 |
7418 } } // namespace v8::internal | 7418 } } // namespace v8::internal |
7419 | 7419 |
7420 #endif // V8_TARGET_ARCH_ARM | 7420 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |