Index: src/frames.cc |
diff --git a/src/frames.cc b/src/frames.cc |
index 61fab874d6148bcbc7e3d711948e172c91cf13d4..e3584476b675f7c56fe9ae90c199186e68adcb85 100644 |
--- a/src/frames.cc |
+++ b/src/frames.cc |
@@ -1534,17 +1534,16 @@ void StackHandler::Unwind(Isolate* isolate, |
FixedArray* array, |
int offset, |
int previous_handler_offset) const { |
- STATIC_ASSERT(StackHandlerConstants::kSlotCount >= 4); |
+ STATIC_ASSERT(StackHandlerConstants::kSlotCount >= 3); |
DCHECK_LE(0, offset); |
DCHECK_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" |
- // slot into "index" and "kind" and store them separately, using the fp slot. |
- array->set(offset, Smi::FromInt(previous_handler_offset)); // next |
- array->set(offset + 1, Smi::FromInt(static_cast<int>(index()))); // state |
- array->set(offset + 2, *context_address()); // context |
- array->set(offset + 3, Smi::FromInt(static_cast<int>(kind()))); // fp |
+ // handlers can be later re-wound in the correct order. |
+ int s = Memory::int_at(address() + StackHandlerConstants::kStateIntOffset); |
+ array->set(offset, Smi::FromInt(previous_handler_offset)); // next |
+ array->set(offset + 1, Smi::FromInt(static_cast<int>(s))); // state |
+ array->set(offset + 2, *context_address()); // context |
*isolate->handler_address() = next()->address(); |
} |
@@ -1554,23 +1553,19 @@ int StackHandler::Rewind(Isolate* isolate, |
FixedArray* array, |
int offset, |
Address fp) { |
- STATIC_ASSERT(StackHandlerConstants::kSlotCount >= 4); |
+ STATIC_ASSERT(StackHandlerConstants::kSlotCount >= 3); |
DCHECK_LE(0, offset); |
DCHECK_GE(array->length(), offset + StackHandlerConstants::kSlotCount); |
Smi* prev_handler_offset = Smi::cast(array->get(offset)); |
- Smi* smi_index = Smi::cast(array->get(offset + 1)); |
+ Smi* smi_state = Smi::cast(array->get(offset + 1)); |
Object* context = array->get(offset + 2); |
- Smi* smi_kind = Smi::cast(array->get(offset + 3)); |
- |
- unsigned state = KindField::encode(static_cast<Kind>(smi_kind->value())) | |
- IndexField::encode(static_cast<unsigned>(smi_index->value())); |
Memory::Address_at(address() + StackHandlerConstants::kNextOffset) = |
*isolate->handler_address(); |
- Memory::uintptr_at(address() + StackHandlerConstants::kStateOffset) = state; |
+ Memory::int_at(address() + StackHandlerConstants::kStateIntOffset) = |
+ smi_state->value(); |
Memory::Object_at(address() + StackHandlerConstants::kContextOffset) = |
context; |
- SetFp(address() + StackHandlerConstants::kFPOffset, fp); |
*isolate->handler_address() = address(); |