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

Side by Side Diff: src/base/macros.h

Issue 368053002: Stack overflow checkers are now compatible with ASAN's detect_stack_use_after_return mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/execution.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_BASE_MACROS_H_ 5 #ifndef V8_BASE_MACROS_H_
6 #define V8_BASE_MACROS_H_ 6 #define V8_BASE_MACROS_H_
7 7
8 #include "include/v8stdint.h" 8 #include "include/v8stdint.h"
9 #include "src/base/build_config.h" 9 #include "src/base/build_config.h"
10 #include "src/base/logging.h" 10 #include "src/base/logging.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 return x + 1; 239 return x + 1;
240 } 240 }
241 241
242 242
243 inline uint32_t RoundDownToPowerOf2(uint32_t x) { 243 inline uint32_t RoundDownToPowerOf2(uint32_t x) {
244 uint32_t rounded_up = RoundUpToPowerOf2(x); 244 uint32_t rounded_up = RoundUpToPowerOf2(x);
245 if (rounded_up > x) return rounded_up >> 1; 245 if (rounded_up > x) return rounded_up >> 1;
246 return rounded_up; 246 return rounded_up;
247 } 247 }
248 248
249
250 // Returns current value of top of the stack. Works correctly with ASAN.
251 DISABLE_ASAN
252 inline uintptr_t GetCurrentStackPosition() {
253 // Takes the address of the limit variable in order to find out where
254 // the top of stack is right now.
255 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit);
256 return limit;
257 }
258
249 #endif // V8_BASE_MACROS_H_ 259 #endif // V8_BASE_MACROS_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/execution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698