| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 8 | 8 |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "codegen.h" | 10 #include "codegen.h" |
| (...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 return has_frame_ || !stub->SometimesSetsUpAFrame(); | 2040 return has_frame_ || !stub->SometimesSetsUpAFrame(); |
| 2041 } | 2041 } |
| 2042 | 2042 |
| 2043 | 2043 |
| 2044 void MacroAssembler::IndexFromHash(Register hash, Register index) { | 2044 void MacroAssembler::IndexFromHash(Register hash, Register index) { |
| 2045 // The assert checks that the constants for the maximum number of digits | 2045 // The assert checks that the constants for the maximum number of digits |
| 2046 // for an array index cached in the hash field and the number of bits | 2046 // for an array index cached in the hash field and the number of bits |
| 2047 // reserved for it does not conflict. | 2047 // reserved for it does not conflict. |
| 2048 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < | 2048 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < |
| 2049 (1 << String::kArrayIndexValueBits)); | 2049 (1 << String::kArrayIndexValueBits)); |
| 2050 // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in | |
| 2051 // the low kHashShift bits. | |
| 2052 and_(hash, String::kArrayIndexValueMask); | |
| 2053 STATIC_ASSERT(String::kHashShift >= kSmiTagSize && kSmiTag == 0); | |
| 2054 if (String::kHashShift > kSmiTagSize) { | |
| 2055 shr(hash, String::kHashShift - kSmiTagSize); | |
| 2056 } | |
| 2057 if (!index.is(hash)) { | 2050 if (!index.is(hash)) { |
| 2058 mov(index, hash); | 2051 mov(index, hash); |
| 2059 } | 2052 } |
| 2053 DecodeFieldToSmi<String::ArrayIndexValueBits>(index); |
| 2060 } | 2054 } |
| 2061 | 2055 |
| 2062 | 2056 |
| 2063 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 2057 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
| 2064 int num_arguments, | 2058 int num_arguments, |
| 2065 SaveFPRegsMode save_doubles) { | 2059 SaveFPRegsMode save_doubles) { |
| 2066 // If the expected number of arguments of the runtime function is | 2060 // If the expected number of arguments of the runtime function is |
| 2067 // constant, we check that the actual number of arguments match the | 2061 // constant, we check that the actual number of arguments match the |
| 2068 // expectation. | 2062 // expectation. |
| 2069 CHECK(f->nargs < 0 || f->nargs == num_arguments); | 2063 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
| (...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3442 if (ms.shift() > 0) sar(edx, ms.shift()); | 3436 if (ms.shift() > 0) sar(edx, ms.shift()); |
| 3443 mov(eax, dividend); | 3437 mov(eax, dividend); |
| 3444 shr(eax, 31); | 3438 shr(eax, 31); |
| 3445 add(edx, eax); | 3439 add(edx, eax); |
| 3446 } | 3440 } |
| 3447 | 3441 |
| 3448 | 3442 |
| 3449 } } // namespace v8::internal | 3443 } } // namespace v8::internal |
| 3450 | 3444 |
| 3451 #endif // V8_TARGET_ARCH_IA32 | 3445 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |