Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Unified Diff: src/type-info.cc

Issue 1108013003: Introduce --zap-cpp-pointers (off by default) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixes Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/type-info.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index ee646afb749f18db2fdba43109c660811ea05ce1..ab9c594f98a566321786119e62ff69347efb3de3 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -490,21 +490,24 @@ void TypeFeedbackOracle::GetRelocInfos(Handle<Code> code,
void TypeFeedbackOracle::CreateDictionary(Handle<Code> code,
ZoneList<RelocInfo>* infos) {
- AllowHeapAllocation allocation_allowed;
- Code* old_code = *code;
+ AllowHeapAllocation will_relocate_manually;
+ // Store an (aligned) Address, so this doesn't look like a raw heap pointer
+ // to verification tools scanning the stack.
+ Address old_code_address = code->address();
dictionary_ = UnseededNumberDictionary::New(isolate(), infos->length());
- RelocateRelocInfos(infos, old_code, *code);
+ RelocateRelocInfos(infos, old_code_address, code->address());
}
-
void TypeFeedbackOracle::RelocateRelocInfos(ZoneList<RelocInfo>* infos,
- Code* old_code,
- Code* new_code) {
+ Address old_code_address,
+ Address new_code_address) {
+ intptr_t delta = new_code_address - old_code_address;
+ if (delta == 0) return;
+ Code* new_code = Code::cast(HeapObject::FromAddress(new_code_address));
for (int i = 0; i < infos->length(); i++) {
RelocInfo* info = &(*infos)[i];
info->set_host(new_code);
- info->set_pc(new_code->instruction_start() +
- (info->pc() - old_code->instruction_start()));
+ info->set_pc(info->pc() + delta);
}
}
« no previous file with comments | « src/type-info.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698