OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #include "v8.h" | 7 #include "v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_ARM | 9 #if V8_TARGET_ARCH_ARM |
10 | 10 |
(...skipping 2429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2440 mov(r0, r4); | 2440 mov(r0, r4); |
2441 jmp(&leave_exit_frame); | 2441 jmp(&leave_exit_frame); |
2442 } | 2442 } |
2443 | 2443 |
2444 | 2444 |
2445 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { | 2445 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { |
2446 return has_frame_ || !stub->SometimesSetsUpAFrame(); | 2446 return has_frame_ || !stub->SometimesSetsUpAFrame(); |
2447 } | 2447 } |
2448 | 2448 |
2449 | 2449 |
2450 void MacroAssembler::IllegalOperation(int num_arguments) { | |
2451 if (num_arguments > 0) { | |
2452 add(sp, sp, Operand(num_arguments * kPointerSize)); | |
2453 } | |
2454 LoadRoot(r0, Heap::kUndefinedValueRootIndex); | |
2455 } | |
2456 | |
2457 | |
2458 void MacroAssembler::IndexFromHash(Register hash, Register index) { | 2450 void MacroAssembler::IndexFromHash(Register hash, Register index) { |
2459 // If the hash field contains an array index pick it out. The assert checks | 2451 // If the hash field contains an array index pick it out. The assert checks |
2460 // that the constants for the maximum number of digits for an array index | 2452 // that the constants for the maximum number of digits for an array index |
2461 // cached in the hash field and the number of bits reserved for it does not | 2453 // cached in the hash field and the number of bits reserved for it does not |
2462 // conflict. | 2454 // conflict. |
2463 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < | 2455 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < |
2464 (1 << String::kArrayIndexValueBits)); | 2456 (1 << String::kArrayIndexValueBits)); |
2465 // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in | 2457 // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in |
2466 // the low kHashShift bits. | 2458 // the low kHashShift bits. |
2467 Ubfx(hash, hash, String::kHashShift, String::kArrayIndexValueBits); | 2459 Ubfx(hash, hash, String::kHashShift, String::kArrayIndexValueBits); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2643 | 2635 |
2644 | 2636 |
2645 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 2637 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
2646 int num_arguments, | 2638 int num_arguments, |
2647 SaveFPRegsMode save_doubles) { | 2639 SaveFPRegsMode save_doubles) { |
2648 // All parameters are on the stack. r0 has the return value after call. | 2640 // All parameters are on the stack. r0 has the return value after call. |
2649 | 2641 |
2650 // If the expected number of arguments of the runtime function is | 2642 // If the expected number of arguments of the runtime function is |
2651 // constant, we check that the actual number of arguments match the | 2643 // constant, we check that the actual number of arguments match the |
2652 // expectation. | 2644 // expectation. |
2653 if (f->nargs >= 0 && f->nargs != num_arguments) { | 2645 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
2654 IllegalOperation(num_arguments); | |
2655 return; | |
2656 } | |
2657 | 2646 |
2658 // TODO(1236192): Most runtime routines don't need the number of | 2647 // TODO(1236192): Most runtime routines don't need the number of |
2659 // arguments passed in because it is constant. At some point we | 2648 // arguments passed in because it is constant. At some point we |
2660 // should remove this need and make the runtime routine entry code | 2649 // should remove this need and make the runtime routine entry code |
2661 // smarter. | 2650 // smarter. |
2662 mov(r0, Operand(num_arguments)); | 2651 mov(r0, Operand(num_arguments)); |
2663 mov(r1, Operand(ExternalReference(f, isolate()))); | 2652 mov(r1, Operand(ExternalReference(f, isolate()))); |
2664 CEntryStub stub(isolate(), 1, save_doubles); | 2653 CEntryStub stub(isolate(), 1, save_doubles); |
2665 CallStub(&stub); | 2654 CallStub(&stub); |
2666 } | 2655 } |
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4068 sub(result, result, Operand(dividend)); | 4057 sub(result, result, Operand(dividend)); |
4069 } | 4058 } |
4070 if (ms.shift() > 0) mov(result, Operand(result, ASR, ms.shift())); | 4059 if (ms.shift() > 0) mov(result, Operand(result, ASR, ms.shift())); |
4071 add(result, result, Operand(dividend, LSR, 31)); | 4060 add(result, result, Operand(dividend, LSR, 31)); |
4072 } | 4061 } |
4073 | 4062 |
4074 | 4063 |
4075 } } // namespace v8::internal | 4064 } } // namespace v8::internal |
4076 | 4065 |
4077 #endif // V8_TARGET_ARCH_ARM | 4066 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |