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

Side by Side Diff: Source/platform/heap/StackFrameDepth.cpp

Issue 818253005: Oilpan: Query stack frame register instead of manual bookkeeping (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: ENABLE(STACKFRAME_POINTER_ESTIMATION) Created 5 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "platform/heap/StackFrameDepth.h"
7
8 namespace blink {
9
10 static const char* s_avoidOptimization = nullptr;
11 NEVER_INLINE static uintptr_t estimateStackFrameBaseOnCallee(const char* dummy)
12 {
13 s_avoidOptimization = dummy;
14 return StackFrameDepth::estimateCurrentStackFrame();
15 }
16
17 void StackFrameDepth::configureLimit()
haraken 2015/01/08 01:14:22 Can we add NEVER_INLINE to configureLimit and remo
kouhei (in TOK) 2015/01/08 03:29:54 No. We want %rbp after dummy[] is pushed.
18 {
19 // Allocate a large object in stack and query stack frame pointer after it.
20 const size_t kTypicalPointersPerFrame = 4; // Return address + 3 local varia ble/argument
21 char dummy[kMaxDepth * kTypicalPointersPerFrame * sizeof(void*)];
22 m_safeStackFrame = estimateStackFrameBaseOnCallee(dummy);
23
24 // Assert that the stack frame can be used.
25 dummy[sizeof(dummy)-1] = 0;
haraken 2015/01/08 01:14:22 Add spaces around '-'.
haraken 2015/01/08 01:14:22 I guess if we move this code up to line 22, s_avoi
kouhei (in TOK) 2015/01/08 03:29:54 Done.
26 }
27
28 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698