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

Unified Diff: src/frames.cc

Issue 1030353003: Enable constant pool support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index f52b3ce4e47a1bf0fd099723fb36d0f0ac604128..1c0cbbb10dd52335d8daf6e0cdc858dd34779c3d 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -321,9 +321,6 @@ bool SafeStackFrameIterator::IsValidExitFrame(Address fp) const {
if (!IsValidStackAddress(sp)) return false;
StackFrame::State state;
ExitFrame::FillState(fp, sp, &state);
- if (!IsValidStackAddress(reinterpret_cast<Address>(state.pc_address))) {
- return false;
- }
rmcilroy 2015/04/08 12:38:55 I'm not sure why you are making this change here,
MTBrandyberry 2015/05/07 20:38:32 By definition, the an exit frame's pc_address is a
return *state.pc_address != NULL;
}
@@ -385,9 +382,8 @@ static bool GcSafeCodeContains(HeapObject* object, Address addr);
#endif
-void StackFrame::IteratePc(ObjectVisitor* v,
- Address* pc_address,
- Code* holder) {
+void StackFrame::IteratePc(ObjectVisitor* v, Address* pc_address,
+ Address* constant_pool_address, Code* holder) {
Address pc = *pc_address;
DCHECK(GcSafeCodeContains(holder, pc));
unsigned pc_offset = static_cast<unsigned>(pc - holder->instruction_start());
@@ -397,6 +393,9 @@ void StackFrame::IteratePc(ObjectVisitor* v,
holder = reinterpret_cast<Code*>(code);
pc = holder->instruction_start() + pc_offset;
*pc_address = pc;
+ if (FLAG_enable_embedded_constant_pool && constant_pool_address) {
+ *constant_pool_address = holder->constant_pool();
+ }
}
}
@@ -506,7 +505,7 @@ void ExitFrame::ComputeCallerState(State* state) const {
state->fp = Memory::Address_at(fp() + ExitFrameConstants::kCallerFPOffset);
state->pc_address = ResolveReturnAddressLocation(
reinterpret_cast<Address*>(fp() + ExitFrameConstants::kCallerPCOffset));
- if (FLAG_enable_ool_constant_pool) {
+ if (FLAG_enable_ool_constant_pool || FLAG_enable_embedded_constant_pool) {
state->constant_pool_address = reinterpret_cast<Address*>(
fp() + ExitFrameConstants::kConstantPoolOffset);
}
@@ -521,7 +520,7 @@ void ExitFrame::SetCallerFp(Address caller_fp) {
void ExitFrame::Iterate(ObjectVisitor* v) const {
// The arguments are traversed as part of the expression stack of
// the calling frame.
- IteratePc(v, pc_address(), LookupCode());
+ IteratePc(v, pc_address(), constant_pool_address(), LookupCode());
v->VisitPointer(&code_slot());
if (FLAG_enable_ool_constant_pool) {
v->VisitPointer(&constant_pool_slot());
@@ -553,8 +552,11 @@ void ExitFrame::FillState(Address fp, Address sp, State* state) {
state->fp = fp;
state->pc_address = ResolveReturnAddressLocation(
reinterpret_cast<Address*>(sp - 1 * kPCOnStackSize));
- state->constant_pool_address =
- reinterpret_cast<Address*>(fp + ExitFrameConstants::kConstantPoolOffset);
+ // The constant pool recorded in the exit frame is not associated
+ // with the pc in this state (the return address into a C entry
+ // stub). ComputeCallerState will retrieve the constant pool
+ // together with the associated caller pc.
+ state->constant_pool_address = NULL;
}
@@ -663,7 +665,7 @@ void StandardFrame::IterateCompiledFrame(ObjectVisitor* v) const {
}
// Visit the return address in the callee and incoming arguments.
- IteratePc(v, pc_address(), code);
+ IteratePc(v, pc_address(), constant_pool_address(), code);
// Visit the context in stub frame and JavaScript frame.
// Visit the function in JavaScript frame.
@@ -1285,7 +1287,7 @@ void ArgumentsAdaptorFrame::Print(StringStream* accumulator,
void EntryFrame::Iterate(ObjectVisitor* v) const {
- IteratePc(v, pc_address(), LookupCode());
+ IteratePc(v, pc_address(), constant_pool_address(), LookupCode());
}
@@ -1299,7 +1301,7 @@ void StandardFrame::IterateExpressions(ObjectVisitor* v) const {
void JavaScriptFrame::Iterate(ObjectVisitor* v) const {
IterateExpressions(v);
- IteratePc(v, pc_address(), LookupCode());
+ IteratePc(v, pc_address(), constant_pool_address(), LookupCode());
}
@@ -1307,7 +1309,7 @@ void InternalFrame::Iterate(ObjectVisitor* v) const {
// Internal frames only have object pointers on the expression stack
// as they never have any arguments.
IterateExpressions(v);
- IteratePc(v, pc_address(), LookupCode());
+ IteratePc(v, pc_address(), constant_pool_address(), LookupCode());
}
@@ -1320,7 +1322,7 @@ void StubFailureTrampolineFrame::Iterate(ObjectVisitor* v) const {
const int offset = StandardFrameConstants::kLastObjectOffset;
limit = &Memory::Object_at(fp() + offset) + 1;
v->VisitPointers(base, limit);
- IteratePc(v, pc_address(), LookupCode());
+ IteratePc(v, pc_address(), constant_pool_address(), LookupCode());
}

Powered by Google App Engine
This is Rietveld 408576698