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

Unified Diff: src/execution.cc

Issue 1108013003: Introduce --zap-cpp-pointers (off by default) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixes Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/execution.h ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index 05a69acfdedcc2099500060d84f2f7ad41b7098b..922211a3161dccefd6c9f335e921c4eed3f5dd25 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -60,6 +60,10 @@ MUST_USE_RESULT MaybeHandle<Object> Invoke(
Handle<Object> receiver, int argc, Handle<Object> args[],
Handle<Object> new_target, Execution::MessageHandling message_handling) {
DCHECK(!receiver->IsJSGlobalObject());
+#if DEBUG
+ // Assume that any JS call can allocate.
+ if (FLAG_zap_cpp_pointers) ZapHeapPointersInCppFrames(isolate);
+#endif
#ifdef USE_SIMULATOR
// Simulators use separate stacks for C++ and JS. JS stack overflow checks
@@ -418,8 +422,12 @@ bool StackGuard::ThreadLocal::Initialize(Isolate* isolate) {
bool should_set_stack_limits = false;
if (real_climit_ == kIllegalLimit) {
const uintptr_t kLimitSize = FLAG_stack_size * KB;
- DCHECK(GetCurrentStackPosition() > kLimitSize);
- uintptr_t limit = GetCurrentStackPosition() - kLimitSize;
+ uintptr_t current_stack_position = GetCurrentStackPosition();
+#if DEBUG
+ DCHECK(current_stack_position > kLimitSize);
+ stack_base_position_ = current_stack_position;
+#endif
+ uintptr_t limit = current_stack_position - kLimitSize;
real_jslimit_ = SimulatorStack::JsLimitFromCLimit(isolate, limit);
set_jslimit(SimulatorStack::JsLimitFromCLimit(isolate, limit));
real_climit_ = limit;
« no previous file with comments | « src/execution.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698