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

Side by Side Diff: src/contexts.cc

Issue 1413503007: Provide a counter for thrown JavaScript errors per context (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adaptations to feedback and now all V8 exceptions are counted Created 5 years, 1 month 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
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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/contexts.h" 5 #include "src/contexts.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/scopeinfo.h" 10 #include "src/scopeinfo.h"
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 581
582 582
583 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { 583 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) {
584 // During bootstrapping we allow all objects to pass as global 584 // During bootstrapping we allow all objects to pass as global
585 // objects. This is necessary to fix circular dependencies. 585 // objects. This is necessary to fix circular dependencies.
586 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || 586 return isolate->heap()->gc_state() != Heap::NOT_IN_GC ||
587 isolate->bootstrapper()->IsActive() || 587 isolate->bootstrapper()->IsActive() ||
588 object->IsGlobalObject(); 588 object->IsGlobalObject();
589 } 589 }
590 #endif 590 #endif
591 591
Michael Starzinger 2015/10/30 12:27:10 nit: Two empty newlines between top-level declarat
Michael Hablich 2015/10/30 15:55:03 Done.
592 void Context::IncrementExceptionsThrown() {
593 DCHECK(IsNativeContext());
594
595 int previous_value = Smi::cast(exceptions_thrown())->value();
596 set_exceptions_thrown(Smi::FromInt(previous_value+1));
597 }
598
599
600 int Context::GetExceptionsThrown() {
601 return Smi::cast(exceptions_thrown())->value();
602 }
603
592 } // namespace internal 604 } // namespace internal
593 } // namespace v8 605 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698