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

Side by Side Diff: src/runtime/runtime-observe.cc

Issue 1048213002: Add a UseCounter for Object.observe (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use HandleScope instead of SealHandleScope in %GetObservationState Created 5 years, 8 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
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-object-observe.cc » ('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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/debug.h" 8 #include "src/debug.h"
9 #include "src/runtime/runtime-utils.h" 9 #include "src/runtime/runtime-utils.h"
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if (isolate->has_pending_exception()) { 81 if (isolate->has_pending_exception()) {
82 isolate->ReportPendingMessages(); 82 isolate->ReportPendingMessages();
83 isolate->clear_pending_exception(); 83 isolate->clear_pending_exception();
84 isolate->set_external_caught_exception(false); 84 isolate->set_external_caught_exception(false);
85 } 85 }
86 return isolate->heap()->undefined_value(); 86 return isolate->heap()->undefined_value();
87 } 87 }
88 88
89 89
90 RUNTIME_FUNCTION(Runtime_GetObservationState) { 90 RUNTIME_FUNCTION(Runtime_GetObservationState) {
91 SealHandleScope shs(isolate); 91 HandleScope scope(isolate);
92 DCHECK(args.length() == 0); 92 DCHECK(args.length() == 0);
93 isolate->CountUsage(v8::Isolate::kObjectObserve);
93 return isolate->heap()->observation_state(); 94 return isolate->heap()->observation_state();
94 } 95 }
95 96
96 97
97 static bool ContextsHaveSameOrigin(Handle<Context> context1, 98 static bool ContextsHaveSameOrigin(Handle<Context> context1,
98 Handle<Context> context2) { 99 Handle<Context> context2) {
99 return context1->security_token() == context2->security_token(); 100 return context1->security_token() == context2->security_token();
100 } 101 }
101 102
102 103
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 RUNTIME_FUNCTION(Runtime_GetObjectContextNotifierPerformChange) { 152 RUNTIME_FUNCTION(Runtime_GetObjectContextNotifierPerformChange) {
152 HandleScope scope(isolate); 153 HandleScope scope(isolate);
153 DCHECK(args.length() == 1); 154 DCHECK(args.length() == 1);
154 CONVERT_ARG_HANDLE_CHECKED(JSObject, object_info, 0); 155 CONVERT_ARG_HANDLE_CHECKED(JSObject, object_info, 0);
155 156
156 Handle<Context> context(object_info->GetCreationContext(), isolate); 157 Handle<Context> context(object_info->GetCreationContext(), isolate);
157 return context->native_object_notifier_perform_change(); 158 return context->native_object_notifier_perform_change();
158 } 159 }
159 } 160 }
160 } // namespace v8::internal 161 } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-object-observe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698