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

Side by Side Diff: src/execution.cc

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/execution.h ('k') | src/isolate.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 #include "src/execution.h" 5 #include "src/execution.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 real_climit_ = kIllegalLimit; 436 real_climit_ = kIllegalLimit;
437 climit_ = kIllegalLimit; 437 climit_ = kIllegalLimit;
438 postpone_interrupts_ = NULL; 438 postpone_interrupts_ = NULL;
439 interrupt_flags_ = 0; 439 interrupt_flags_ = 0;
440 } 440 }
441 441
442 442
443 bool StackGuard::ThreadLocal::Initialize(Isolate* isolate) { 443 bool StackGuard::ThreadLocal::Initialize(Isolate* isolate) {
444 bool should_set_stack_limits = false; 444 bool should_set_stack_limits = false;
445 if (real_climit_ == kIllegalLimit) { 445 if (real_climit_ == kIllegalLimit) {
446 // Takes the address of the limit variable in order to find out where
447 // the top of stack is right now.
448 const uintptr_t kLimitSize = FLAG_stack_size * KB; 446 const uintptr_t kLimitSize = FLAG_stack_size * KB;
449 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit) - kLimitSize; 447 ASSERT(GetCurrentStackPosition() > kLimitSize);
450 ASSERT(reinterpret_cast<uintptr_t>(&limit) > kLimitSize); 448 uintptr_t limit = GetCurrentStackPosition() - kLimitSize;
451 real_jslimit_ = SimulatorStack::JsLimitFromCLimit(isolate, limit); 449 real_jslimit_ = SimulatorStack::JsLimitFromCLimit(isolate, limit);
452 jslimit_ = SimulatorStack::JsLimitFromCLimit(isolate, limit); 450 jslimit_ = SimulatorStack::JsLimitFromCLimit(isolate, limit);
453 real_climit_ = limit; 451 real_climit_ = limit;
454 climit_ = limit; 452 climit_ = limit;
455 should_set_stack_limits = true; 453 should_set_stack_limits = true;
456 } 454 }
457 postpone_interrupts_ = NULL; 455 postpone_interrupts_ = NULL;
458 interrupt_flags_ = 0; 456 interrupt_flags_ = 0;
459 return should_set_stack_limits; 457 return should_set_stack_limits;
460 } 458 }
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 } 698 }
701 699
702 isolate_->counters()->stack_interrupts()->Increment(); 700 isolate_->counters()->stack_interrupts()->Increment();
703 isolate_->counters()->runtime_profiler_ticks()->Increment(); 701 isolate_->counters()->runtime_profiler_ticks()->Increment();
704 isolate_->runtime_profiler()->OptimizeNow(); 702 isolate_->runtime_profiler()->OptimizeNow();
705 703
706 return isolate_->heap()->undefined_value(); 704 return isolate_->heap()->undefined_value();
707 } 705 }
708 706
709 } } // namespace v8::internal 707 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/execution.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698