Commit 2a9df4c8 authored by rmcilroy@chromium.org's avatar rmcilroy@chromium.org

Ensure that relocinfo's host code object is correctly reset on GC in...

Ensure that relocinfo's host code object is correctly reset on GC in TypeFeedbackOracle::RelocateRelocInfos

TBR=ulan@chromium.org

Review URL: https://codereview.chromium.org/197593003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19860 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f0621620
......@@ -379,6 +379,7 @@ class RelocInfo BASE_EMBEDDED {
return BitCast<uint64_t>(data64_);
}
Code* host() const { return host_; }
void set_host(Code* host) { host_ = host; }
// Apply a relocation by delta bytes
INLINE(void apply(intptr_t delta));
......
......@@ -434,20 +434,21 @@ void TypeFeedbackOracle::GetRelocInfos(Handle<Code> code,
void TypeFeedbackOracle::CreateDictionary(Handle<Code> code,
ZoneList<RelocInfo>* infos) {
AllowHeapAllocation allocation_allowed;
byte* old_start = code->instruction_start();
Code* old_code = *code;
dictionary_ =
isolate()->factory()->NewUnseededNumberDictionary(infos->length());
byte* new_start = code->instruction_start();
RelocateRelocInfos(infos, old_start, new_start);
RelocateRelocInfos(infos, old_code, *code);
}
void TypeFeedbackOracle::RelocateRelocInfos(ZoneList<RelocInfo>* infos,
byte* old_start,
byte* new_start) {
Code* old_code,
Code* new_code) {
for (int i = 0; i < infos->length(); i++) {
RelocInfo* info = &(*infos)[i];
info->set_pc(new_start + (info->pc() - old_start));
info->set_host(new_code);
info->set_pc(new_code->instruction_start() +
(info->pc() - old_code->instruction_start()));
}
}
......
......@@ -130,8 +130,8 @@ class TypeFeedbackOracle: public ZoneObject {
void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos);
void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos);
void RelocateRelocInfos(ZoneList<RelocInfo>* infos,
byte* old_start,
byte* new_start);
Code* old_code,
Code* new_code);
void ProcessRelocInfos(ZoneList<RelocInfo>* infos);
// Returns an element from the backing store. Returns undefined if
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment