Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 36b3177b7c02c474b058bc3f0f8f2a8c1aa5b4c1..c4b2185d757d10a6156435425b59b14404895599 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -11192,8 +11192,9 @@ static const int kFrameDetailsLocalCountIndex = 4; |
| static const int kFrameDetailsSourcePositionIndex = 5; |
| static const int kFrameDetailsConstructCallIndex = 6; |
| static const int kFrameDetailsAtReturnIndex = 7; |
| -static const int kFrameDetailsFlagsIndex = 8; |
| -static const int kFrameDetailsFirstDynamicIndex = 9; |
| +static const int kFrameDetailsFramePointerIndex = 8; |
| +static const int kFrameDetailsFlagsIndex = 9; |
| +static const int kFrameDetailsFirstDynamicIndex = 10; |
| static SaveContext* FindSavedContextForFrame(Isolate* isolate, |
| @@ -11220,7 +11221,8 @@ static SaveContext* FindSavedContextForFrame(Isolate* isolate, |
| // 5: Source position |
| // 6: Constructor call |
| // 7: Is at return |
| -// 8: Flags |
| +// 8: Frame pointer |
| +// 9: Flags |
| // Arguments name, value |
| // Locals name, value |
| // Return value if any |
| @@ -11405,6 +11407,17 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) { |
| // Add the at return information. |
| details->set(kFrameDetailsAtReturnIndex, heap->ToBoolean(at_return)); |
| + // No memory address will actually be larger than 2^48 on a current x64 |
| + // machine but we truncate to 53 bits to future proof this method. Users |
| + // should not care about the exact frame pointer values only the |
| + // order of frame pointers. Truncating to 53 bits will still generate the |
| + // correct ordering with very high probability. |
| + uintptr_t frame_pointer = |
| + reinterpret_cast<uintptr_t>(it.frame()->UnpaddedFP()) & |
| + ((static_cast<uintptr_t>(1)<<53) - 1); |
|
hausner
2014/09/05 18:08:36
How about building the mask as a const uint64_t va
|
| + details->set(kFrameDetailsFramePointerIndex, |
| + *isolate->factory()->NewNumber(static_cast<double>(frame_pointer))); |
| + |
| // Add flags to indicate information on whether this frame is |
| // bit 0: invoked in the debugger context. |
| // bit 1: optimized frame. |