Reviewers: danno,
Message:
Address danno's comment on https://codereview.chromium.org/18014003/.
https://codereview.chromium.org/20073004/diff/1/src/frames.h
File src/frames.h (left):
https://codereview.chromium.org/20073004/diff/1/src/frames.h#oldcode180
src/frames.h:180: };
+2 * kPCOnStackSize assumes kFPOnStackSize == kPCOnStackSize.
Description:
Introduce the SetFp function in StackHandler
The FP setting is different for X32 than the other platforms as
kFPOnStackSize is double the kPointerSize and we have to clear the
higher 32 bits to 0.
Please review this at https://codereview.chromium.org/20073004/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/arm/frames-arm.h
M src/frames.h
M src/frames.cc
M src/ia32/frames-ia32.h
M src/mips/frames-mips.h
M src/x64/frames-x64.h
Index: src/arm/frames-arm.h
diff --git a/src/arm/frames-arm.h b/src/arm/frames-arm.h
index
19b29b8553de85eb8ad298ae3be53aee7de93858..d022b414b436685735f3926f2b67fa42662015de
100644
--- a/src/arm/frames-arm.h
+++ b/src/arm/frames-arm.h
@@ -171,6 +171,11 @@ inline Object* JavaScriptFrame::function_slot_object()
const {
}
+inline void StackHandler::SetFp(Address slot, Address fp) {
+ Memory::Address_at(slot) = fp;
+}
+
+
} } // namespace v8::internal
#endif // V8_ARM_FRAMES_ARM_H_
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index
61792a628cd2cae82b87547dc9b17a0a02b17932..3f12cd21b26dd0a566cfe8ec51973cf33f9dac36
100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1521,9 +1521,10 @@ void StackHandler::Unwind(Isolate* isolate,
FixedArray* array,
int offset,
int previous_handler_offset) const {
- STATIC_ASSERT(StackHandlerConstants::kSlotCount == 5);
+ STATIC_ASSERT(StackHandlerConstants::kSlotCount == 5 ||
+ StackHandlerConstants::kSlotCount == 6);
ASSERT_LE(0, offset);
- ASSERT_GE(array->length(), offset + 5);
+ ASSERT_GE(array->length(), offset + StackHandlerConstants::kSlotCount);
// Unwinding a stack handler into an array chains it in the opposite
// direction, re-using the "next" slot as a "previous" link, so that
stack
// handlers can be later re-wound in the correct order. Decode
the "state"
@@ -1542,9 +1543,10 @@ int StackHandler::Rewind(Isolate* isolate,
FixedArray* array,
int offset,
Address fp) {
- STATIC_ASSERT(StackHandlerConstants::kSlotCount == 5);
+ STATIC_ASSERT(StackHandlerConstants::kSlotCount == 5 ||
+ StackHandlerConstants::kSlotCount == 6);
ASSERT_LE(0, offset);
- ASSERT_GE(array->length(), offset + 5);
+ ASSERT_GE(array->length(), offset + StackHandlerConstants::kSlotCount);
Smi* prev_handler_offset = Smi::cast(array->get(offset));
Code* code = Code::cast(array->get(offset + 1));
Smi* smi_index = Smi::cast(array->get(offset + 2));
@@ -1560,7 +1562,7 @@ int StackHandler::Rewind(Isolate* isolate,
Memory::uintptr_at(address() + StackHandlerConstants::kStateOffset) =
state;
Memory::Object_at(address() + StackHandlerConstants::kContextOffset) =
context;
- Memory::Address_at(address() + StackHandlerConstants::kFPOffset) = fp;
+ SetFp(address() + StackHandlerConstants::kFPOffset, fp);
*isolate->handler_address() = address();
Index: src/frames.h
diff --git a/src/frames.h b/src/frames.h
index
634ff8a7cb39869b41f858039f064f561258f4d6..2bbbd98ac07e81e720532813fa29a04aaf529ad1
100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -145,6 +145,7 @@ class StackHandler BASE_EMBEDDED {
inline Object** context_address() const;
inline Object** code_address() const;
+ inline void SetFp(Address slot, Address fp);
DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler);
};
@@ -176,7 +177,7 @@ class StandardFrameConstants : public AllStatic {
static const int kContextOffset = -1 * kPointerSize;
static const int kCallerFPOffset = 0 * kPointerSize;
static const int kCallerPCOffset = +1 * kFPOnStackSize;
- static const int kCallerSPOffset = +2 * kPCOnStackSize;
+ static const int kCallerSPOffset = kCallerPCOffset + 1 *
kPCOnStackSize;
};
Index: src/ia32/frames-ia32.h
diff --git a/src/ia32/frames-ia32.h b/src/ia32/frames-ia32.h
index
6223748d6409a687bcf87434ef0feb6386470881..8606125101856fcfd4624bad6c5464442025fce9
100644
--- a/src/ia32/frames-ia32.h
+++ b/src/ia32/frames-ia32.h
@@ -136,6 +136,11 @@ inline Object* JavaScriptFrame::function_slot_object()
const {
}
+inline void StackHandler::SetFp(Address slot, Address fp) {
+ Memory::Address_at(slot) = fp;
+}
+
+
} } // namespace v8::internal
#endif // V8_IA32_FRAMES_IA32_H_
Index: src/mips/frames-mips.h
diff --git a/src/mips/frames-mips.h b/src/mips/frames-mips.h
index
f6f20cd20cd976f00af6b94a88d994e74bece8fb..437bf3a9f13d10c65cfa56b4427372006bb007db
100644
--- a/src/mips/frames-mips.h
+++ b/src/mips/frames-mips.h
@@ -230,6 +230,11 @@ inline Object* JavaScriptFrame::function_slot_object()
const {
}
+inline void StackHandler::SetFp(Address slot, Address fp) {
+ Memory::Address_at(slot) = fp;
+}
+
+
} } // namespace v8::internal
#endif
Index: src/x64/frames-x64.h
diff --git a/src/x64/frames-x64.h b/src/x64/frames-x64.h
index
a24ab5310723c0e108adbd27f4aafb5a081aa317..2af5a81bb5f3df194bf8ca1e692591ed680feb2a
100644
--- a/src/x64/frames-x64.h
+++ b/src/x64/frames-x64.h
@@ -126,6 +126,12 @@ inline Object* JavaScriptFrame::function_slot_object()
const {
return Memory::Object_at(fp() + offset);
}
+
+inline void StackHandler::SetFp(Address slot, Address fp) {
+ Memory::Address_at(slot) = fp;
+}
+
+
} } // namespace v8::internal
#endif // V8_X64_FRAMES_X64_H_
--
--
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/groups/opt_out.