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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2056 void MacroAssembler::StubReturn(int argc) { | 2056 void MacroAssembler::StubReturn(int argc) { |
2057 DCHECK(argc >= 1 && generating_stub()); | 2057 DCHECK(argc >= 1 && generating_stub()); |
2058 ret((argc - 1) * kPointerSize); | 2058 ret((argc - 1) * kPointerSize); |
2059 } | 2059 } |
2060 | 2060 |
2061 | 2061 |
2062 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { | 2062 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { |
2063 return has_frame_ || !stub->SometimesSetsUpAFrame(); | 2063 return has_frame_ || !stub->SometimesSetsUpAFrame(); |
2064 } | 2064 } |
2065 | 2065 |
2066 | |
2067 void MacroAssembler::IndexFromHash(Register hash, Register index) { | |
2068 // The assert checks that the constants for the maximum number of digits | |
2069 // for an array index cached in the hash field and the number of bits | |
2070 // reserved for it does not conflict. | |
2071 DCHECK(TenToThe(String::kMaxCachedArrayIndexLength) < | |
2072 (1 << String::kArrayIndexValueBits)); | |
2073 if (!index.is(hash)) { | |
2074 mov(index, hash); | |
2075 } | |
2076 DecodeFieldToSmi<String::ArrayIndexValueBits>(index); | |
2077 } | |
2078 | |
2079 | |
2080 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 2066 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
2081 int num_arguments, | 2067 int num_arguments, |
2082 SaveFPRegsMode save_doubles) { | 2068 SaveFPRegsMode save_doubles) { |
2083 // If the expected number of arguments of the runtime function is | 2069 // If the expected number of arguments of the runtime function is |
2084 // constant, we check that the actual number of arguments match the | 2070 // constant, we check that the actual number of arguments match the |
2085 // expectation. | 2071 // expectation. |
2086 CHECK(f->nargs < 0 || f->nargs == num_arguments); | 2072 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
2087 | 2073 |
2088 // TODO(1236192): Most runtime routines don't need the number of | 2074 // TODO(1236192): Most runtime routines don't need the number of |
2089 // arguments passed in because it is constant. At some point we | 2075 // arguments passed in because it is constant. At some point we |
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3367 mov(eax, dividend); | 3353 mov(eax, dividend); |
3368 shr(eax, 31); | 3354 shr(eax, 31); |
3369 add(edx, eax); | 3355 add(edx, eax); |
3370 } | 3356 } |
3371 | 3357 |
3372 | 3358 |
3373 } // namespace internal | 3359 } // namespace internal |
3374 } // namespace v8 | 3360 } // namespace v8 |
3375 | 3361 |
3376 #endif // V8_TARGET_ARCH_IA32 | 3362 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |