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_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 return has_frame_ || !stub->SometimesSetsUpAFrame(); | 541 return has_frame_ || !stub->SometimesSetsUpAFrame(); |
542 } | 542 } |
543 | 543 |
544 | 544 |
545 void MacroAssembler::IndexFromHash(Register hash, Register index) { | 545 void MacroAssembler::IndexFromHash(Register hash, Register index) { |
546 // The assert checks that the constants for the maximum number of digits | 546 // The assert checks that the constants for the maximum number of digits |
547 // for an array index cached in the hash field and the number of bits | 547 // for an array index cached in the hash field and the number of bits |
548 // reserved for it does not conflict. | 548 // reserved for it does not conflict. |
549 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < | 549 ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < |
550 (1 << String::kArrayIndexValueBits)); | 550 (1 << String::kArrayIndexValueBits)); |
551 // We want the smi-tagged index in key. Even if we subsequently go to | 551 if (!hash.is(index)) { |
552 // the slow case, converting the key to a smi is always valid. | 552 movl(index, hash); |
553 // key: string key | 553 } |
554 // hash: key's hash field, including its array index value. | 554 DecodeFieldToSmi<String::ArrayIndexValueBits>(index); |
555 andp(hash, Immediate(String::kArrayIndexValueMask)); | |
556 shrp(hash, Immediate(String::kHashShift)); | |
557 // Here we actually clobber the key which will be used if calling into | |
558 // runtime later. However as the new key is the numeric value of a string key | |
559 // there is no difference in using either key. | |
560 Integer32ToSmi(index, hash); | |
561 } | 555 } |
562 | 556 |
563 | 557 |
564 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 558 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
565 int num_arguments, | 559 int num_arguments, |
566 SaveFPRegsMode save_doubles) { | 560 SaveFPRegsMode save_doubles) { |
567 // If the expected number of arguments of the runtime function is | 561 // If the expected number of arguments of the runtime function is |
568 // constant, we check that the actual number of arguments match the | 562 // constant, we check that the actual number of arguments match the |
569 // expectation. | 563 // expectation. |
570 CHECK(f->nargs < 0 || f->nargs == num_arguments); | 564 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
(...skipping 4646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5217 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); | 5211 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); |
5218 movl(rax, dividend); | 5212 movl(rax, dividend); |
5219 shrl(rax, Immediate(31)); | 5213 shrl(rax, Immediate(31)); |
5220 addl(rdx, rax); | 5214 addl(rdx, rax); |
5221 } | 5215 } |
5222 | 5216 |
5223 | 5217 |
5224 } } // namespace v8::internal | 5218 } } // namespace v8::internal |
5225 | 5219 |
5226 #endif // V8_TARGET_ARCH_X64 | 5220 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |