Index: src/frames.cc |
diff --git a/src/frames.cc b/src/frames.cc |
index f3cda57652c3e5c8d68d36ae05a1da0a5abdaf52..64ed6dc04be016359e19a41755bb42eec2dc1f6e 100644 |
--- a/src/frames.cc |
+++ b/src/frames.cc |
@@ -1536,11 +1536,18 @@ int WasmFrame::position() const { |
isolate()); |
DCHECK_LE(0, position); |
position = WasmCompiledModule::GetAsmJsSourcePosition( |
- compiled_module, function_index(), static_cast<uint32_t>(position)); |
+ compiled_module, function_index(), static_cast<uint32_t>(position), |
+ at_to_number_conversion()); |
} |
return position; |
} |
+bool WasmFrame::at_to_number_conversion() const { |
+ // WasmToJsFrame::ComputeCallerState encoded this for us in the constant pool |
+ // address ;) |
+ return !!constant_pool_address(); |
+} |
+ |
int WasmFrame::LookupExceptionHandlerInTable(int* stack_slots) { |
DCHECK_NOT_NULL(stack_slots); |
Code* code = LookupCode(); |
@@ -1550,6 +1557,21 @@ int WasmFrame::LookupExceptionHandlerInTable(int* stack_slots) { |
return table->LookupReturn(pc_offset); |
} |
+void WasmToJsFrame::ComputeCallerState(State* state) const { |
+ // Remember at which of the two calls inside it we are, and transfer this |
+ // information to the subsequent WASM frame. |
+ Code* code = unchecked_code(); |
+ AbstractCode* abstract_code = AbstractCode::cast(code); |
+ int offset = static_cast<int>(pc() - code->instruction_start()); |
+ int at_to_number_call = abstract_code->SourcePosition(offset); |
+ DCHECK(at_to_number_call == 0 || at_to_number_call == 1); |
+ StubFrame::ComputeCallerState(state); |
+ DCHECK_EQ(StackFrame::WASM, ComputeType(iterator_, state)); |
+ // Use a little hack here: The constant pool address is not used for wasm |
+ // frames, so use it to encode whether we are at the to_number call. |
+ state->constant_pool_address = reinterpret_cast<Address*>(at_to_number_call); |
+} |
+ |
namespace { |