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

Side by Side Diff: src/bootstrapper.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
« no previous file with comments | « no previous file | src/contexts.h » ('j') | src/contexts.cc » ('J')
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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/base/utils/random-number-generator.h" 9 #include "src/base/utils/random-number-generator.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) { 366 static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) {
367 // object.__proto__ = proto; 367 // object.__proto__ = proto;
368 Handle<Map> old_map = Handle<Map>(object->map()); 368 Handle<Map> old_map = Handle<Map>(object->map());
369 Handle<Map> new_map = Map::Copy(old_map, "SetObjectPrototype"); 369 Handle<Map> new_map = Map::Copy(old_map, "SetObjectPrototype");
370 Map::SetPrototype(new_map, proto, FAST_PROTOTYPE); 370 Map::SetPrototype(new_map, proto, FAST_PROTOTYPE);
371 JSObject::MigrateToMap(object, new_map); 371 JSObject::MigrateToMap(object, new_map);
372 } 372 }
373 373
374 374
375 void Bootstrapper::DetachGlobal(Handle<Context> env) { 375 void Bootstrapper::DetachGlobal(Handle<Context> env) {
376 // add thrown javascript exceptions
Michael Starzinger 2015/10/30 12:27:10 nit: Please capitalize and punctuate comment.
Michael Hablich 2015/10/30 15:55:02 I removed the comment entirely because the code is
377 env->GetIsolate()->counters()->exceptions_thrown_per_context()->AddSample(
378 env->GetExceptionsThrown());
379
376 Factory* factory = env->GetIsolate()->factory(); 380 Factory* factory = env->GetIsolate()->factory();
377 Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy())); 381 Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy()));
378 global_proxy->set_native_context(*factory->null_value()); 382 global_proxy->set_native_context(*factory->null_value());
379 SetObjectPrototype(global_proxy, factory->null_value()); 383 SetObjectPrototype(global_proxy, factory->null_value());
380 global_proxy->map()->SetConstructor(*factory->null_value()); 384 global_proxy->map()->SetConstructor(*factory->null_value());
381 if (FLAG_track_detached_contexts) { 385 if (FLAG_track_detached_contexts) {
382 env->GetIsolate()->AddDetachedContext(env); 386 env->GetIsolate()->AddDetachedContext(env);
383 } 387 }
384 } 388 }
385 389
(...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after
3320 } 3324 }
3321 3325
3322 3326
3323 // Called when the top-level V8 mutex is destroyed. 3327 // Called when the top-level V8 mutex is destroyed.
3324 void Bootstrapper::FreeThreadResources() { 3328 void Bootstrapper::FreeThreadResources() {
3325 DCHECK(!IsActive()); 3329 DCHECK(!IsActive());
3326 } 3330 }
3327 3331
3328 } // namespace internal 3332 } // namespace internal
3329 } // namespace v8 3333 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/contexts.h » ('j') | src/contexts.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698