| 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_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "codegen.h" | 10 #include "codegen.h" |
| (...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1928 return has_frame_ || !stub->SometimesSetsUpAFrame(); | 1928 return has_frame_ || !stub->SometimesSetsUpAFrame(); |
| 1929 } | 1929 } |
| 1930 | 1930 |
| 1931 | 1931 |
| 1932 void MacroAssembler::IndexFromHash(Register hash, Register index) { | 1932 void MacroAssembler::IndexFromHash(Register hash, Register index) { |
| 1933 // The assert checks that the constants for the maximum number of digits | 1933 // The assert checks that the constants for the maximum number of digits |
| 1934 // for an array index cached in the hash field and the number of bits | 1934 // for an array index cached in the hash field and the number of bits |
| 1935 // reserved for it does not conflict. | 1935 // reserved for it does not conflict. |
| 1936 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < | 1936 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < |
| 1937 (1 << String::kArrayIndexValueBits)); | 1937 (1 << String::kArrayIndexValueBits)); |
| 1938 // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in | |
| 1939 // the low kHashShift bits. | |
| 1940 and_(hash, String::kArrayIndexValueMask); | |
| 1941 STATIC_ASSERT(String::kHashShift >= kSmiTagSize && kSmiTag == 0); | |
| 1942 if (String::kHashShift > kSmiTagSize) { | |
| 1943 shr(hash, String::kHashShift - kSmiTagSize); | |
| 1944 } | |
| 1945 if (!index.is(hash)) { | 1938 if (!index.is(hash)) { |
| 1946 mov(index, hash); | 1939 mov(index, hash); |
| 1947 } | 1940 } |
| 1941 DecodeFieldToSmi<String::ArrayIndexValueBits>(index); |
| 1948 } | 1942 } |
| 1949 | 1943 |
| 1950 | 1944 |
| 1951 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 1945 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
| 1952 int num_arguments) { | 1946 int num_arguments) { |
| 1953 // If the expected number of arguments of the runtime function is | 1947 // If the expected number of arguments of the runtime function is |
| 1954 // constant, we check that the actual number of arguments match the | 1948 // constant, we check that the actual number of arguments match the |
| 1955 // expectation. | 1949 // expectation. |
| 1956 CHECK(f->nargs < 0 || f->nargs == num_arguments); | 1950 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
| 1957 | 1951 |
| (...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3324 if (ms.shift() > 0) sar(edx, ms.shift()); | 3318 if (ms.shift() > 0) sar(edx, ms.shift()); |
| 3325 mov(eax, dividend); | 3319 mov(eax, dividend); |
| 3326 shr(eax, 31); | 3320 shr(eax, 31); |
| 3327 add(edx, eax); | 3321 add(edx, eax); |
| 3328 } | 3322 } |
| 3329 | 3323 |
| 3330 | 3324 |
| 3331 } } // namespace v8::internal | 3325 } } // namespace v8::internal |
| 3332 | 3326 |
| 3333 #endif // V8_TARGET_ARCH_X87 | 3327 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |