Revision: 19860
Author: [email protected]
Date: Wed Mar 12 17:18:49 2014 UTC
Log: Ensure that relocinfo's host code object is correctly reset on GC
in TypeFeedbackOracle::RelocateRelocInfos
[email protected]
Review URL: https://codereview.chromium.org/197593003
http://code.google.com/p/v8/source/detail?r=19860
Modified:
/branches/bleeding_edge/src/assembler.h
/branches/bleeding_edge/src/type-info.cc
/branches/bleeding_edge/src/type-info.h
=======================================
--- /branches/bleeding_edge/src/assembler.h Wed Mar 12 15:40:41 2014 UTC
+++ /branches/bleeding_edge/src/assembler.h Wed Mar 12 17:18:49 2014 UTC
@@ -379,6 +379,7 @@
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));
=======================================
--- /branches/bleeding_edge/src/type-info.cc Fri Mar 7 10:12:17 2014 UTC
+++ /branches/bleeding_edge/src/type-info.cc Wed Mar 12 17:18:49 2014 UTC
@@ -434,20 +434,21 @@
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()));
}
}
=======================================
--- /branches/bleeding_edge/src/type-info.h Fri Mar 7 10:12:17 2014 UTC
+++ /branches/bleeding_edge/src/type-info.h Wed Mar 12 17:18:49 2014 UTC
@@ -130,8 +130,8 @@
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
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.