Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index bec530800234619eb14ec874cceb902f6e75c534..9d0cdf3007c4bd548a3ea8ca84fb69c5a3caa639 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -4610,6 +4610,37 @@ void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) { |
} |
+void MacroAssembler::PerformAllocationSiteInfoCheck( |
+ Label* allocation_info_present) { |
+ Label no_info_available; |
+ // ----------- S t a t e ------------- |
+ // -- rdx : receiver |
+ // rdi is clobbered. |
+ // ----------------------------------- |
+ ExternalReference new_space_start = |
+ ExternalReference::new_space_start(isolate()); |
+ ExternalReference new_space_allocation_top = |
+ ExternalReference::new_space_allocation_top_address(isolate()); |
+ |
+ lea(rdi, Operand(rdx, JSArray::kSize + AllocationSiteInfo::kSize)); |
+ movq(kScratchRegister, new_space_start); |
+ cmpq(rdi, kScratchRegister); |
+ j(less, &no_info_available); |
+ cmpq(rdi, ExternalOperand(new_space_allocation_top)); |
+ j(greater_equal, &no_info_available); |
+ CompareRoot(MemOperand(rdi, 0), Heap::kAllocationSiteInfoMapRootIndex); |
+ |
+ // Use the j/jmp sequence below for debugging, but the j(equal) sequence |
+ // for production. |
+ // j(not_equal, &no_info_available); |
+ // int3(); |
+ // jmp(allocation_info_present); |
+ // or |
+ j(equal, allocation_info_present); |
+ bind(&no_info_available); |
+} |
+ |
+ |
} } // namespace v8::internal |
#endif // V8_TARGET_ARCH_X64 |