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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 5377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5388 DCHECK(strcmp(Marking::kGreyBitPattern, "10") == 0); | 5388 DCHECK(strcmp(Marking::kGreyBitPattern, "10") == 0); |
5389 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); | 5389 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); |
5390 | 5390 |
5391 // Since both black and grey have a 1 in the first position and white does | 5391 // Since both black and grey have a 1 in the first position and white does |
5392 // not have a 1 there we only need to check one bit. | 5392 // not have a 1 there we only need to check one bit. |
5393 testp(Operand(bitmap_scratch, MemoryChunk::kHeaderSize), mask_scratch); | 5393 testp(Operand(bitmap_scratch, MemoryChunk::kHeaderSize), mask_scratch); |
5394 j(zero, value_is_white, distance); | 5394 j(zero, value_is_white, distance); |
5395 } | 5395 } |
5396 | 5396 |
5397 | 5397 |
5398 void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) { | 5398 void MacroAssembler::CheckEnumCache(Label* call_runtime) { |
5399 Label next, start; | 5399 Label next, start; |
5400 Register empty_fixed_array_value = r8; | 5400 Register empty_fixed_array_value = r8; |
5401 LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex); | 5401 LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex); |
5402 movp(rcx, rax); | 5402 movp(rcx, rax); |
5403 | 5403 |
5404 // Check if the enum length field is properly initialized, indicating that | 5404 // Check if the enum length field is properly initialized, indicating that |
5405 // there is an enum cache. | 5405 // there is an enum cache. |
5406 movp(rbx, FieldOperand(rcx, HeapObject::kMapOffset)); | 5406 movp(rbx, FieldOperand(rcx, HeapObject::kMapOffset)); |
5407 | 5407 |
5408 EnumLength(rdx, rbx); | 5408 EnumLength(rdx, rbx); |
(...skipping 20 matching lines...) Expand all Loading... |
5429 FieldOperand(rcx, JSObject::kElementsOffset)); | 5429 FieldOperand(rcx, JSObject::kElementsOffset)); |
5430 j(equal, &no_elements); | 5430 j(equal, &no_elements); |
5431 | 5431 |
5432 // Second chance, the object may be using the empty slow element dictionary. | 5432 // Second chance, the object may be using the empty slow element dictionary. |
5433 LoadRoot(kScratchRegister, Heap::kEmptySlowElementDictionaryRootIndex); | 5433 LoadRoot(kScratchRegister, Heap::kEmptySlowElementDictionaryRootIndex); |
5434 cmpp(kScratchRegister, FieldOperand(rcx, JSObject::kElementsOffset)); | 5434 cmpp(kScratchRegister, FieldOperand(rcx, JSObject::kElementsOffset)); |
5435 j(not_equal, call_runtime); | 5435 j(not_equal, call_runtime); |
5436 | 5436 |
5437 bind(&no_elements); | 5437 bind(&no_elements); |
5438 movp(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); | 5438 movp(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); |
5439 cmpp(rcx, null_value); | 5439 CompareRoot(rcx, Heap::kNullValueRootIndex); |
5440 j(not_equal, &next); | 5440 j(not_equal, &next); |
5441 } | 5441 } |
5442 | 5442 |
| 5443 |
5443 void MacroAssembler::TestJSArrayForAllocationMemento( | 5444 void MacroAssembler::TestJSArrayForAllocationMemento( |
5444 Register receiver_reg, | 5445 Register receiver_reg, |
5445 Register scratch_reg, | 5446 Register scratch_reg, |
5446 Label* no_memento_found) { | 5447 Label* no_memento_found) { |
5447 ExternalReference new_space_start = | 5448 ExternalReference new_space_start = |
5448 ExternalReference::new_space_start(isolate()); | 5449 ExternalReference::new_space_start(isolate()); |
5449 ExternalReference new_space_allocation_top = | 5450 ExternalReference new_space_allocation_top = |
5450 ExternalReference::new_space_allocation_top_address(isolate()); | 5451 ExternalReference::new_space_allocation_top_address(isolate()); |
5451 | 5452 |
5452 leap(scratch_reg, Operand(receiver_reg, | 5453 leap(scratch_reg, Operand(receiver_reg, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5510 movl(rax, dividend); | 5511 movl(rax, dividend); |
5511 shrl(rax, Immediate(31)); | 5512 shrl(rax, Immediate(31)); |
5512 addl(rdx, rax); | 5513 addl(rdx, rax); |
5513 } | 5514 } |
5514 | 5515 |
5515 | 5516 |
5516 } // namespace internal | 5517 } // namespace internal |
5517 } // namespace v8 | 5518 } // namespace v8 |
5518 | 5519 |
5519 #endif // V8_TARGET_ARCH_X64 | 5520 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |