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

Side by Side Diff: src/isolate.cc

Issue 346233002: Add a use counter API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 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/isolate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2336 v8::MicrotaskCallback callback = 2336 v8::MicrotaskCallback callback =
2337 v8::ToCData<v8::MicrotaskCallback>(callback_info->callback()); 2337 v8::ToCData<v8::MicrotaskCallback>(callback_info->callback());
2338 void* data = v8::ToCData<void*>(callback_info->data()); 2338 void* data = v8::ToCData<void*>(callback_info->data());
2339 callback(data); 2339 callback(data);
2340 } 2340 }
2341 } 2341 }
2342 } 2342 }
2343 } 2343 }
2344 2344
2345 2345
2346 void Isolate::SetUseCounterCallback(v8::Isolate::UseCounterCallback callback) {
2347 ASSERT(!use_counter_callback_);
2348 use_counter_callback_ = callback;
2349 }
2350
2351
2352 void Isolate::CountUsage(v8::Isolate::UseCounterFeature feature) {
2353 if (use_counter_callback_) {
2354 use_counter_callback_(reinterpret_cast<v8::Isolate*>(this), feature);
2355 }
2356 }
2357
2358
2346 bool StackLimitCheck::JsHasOverflowed() const { 2359 bool StackLimitCheck::JsHasOverflowed() const {
2347 StackGuard* stack_guard = isolate_->stack_guard(); 2360 StackGuard* stack_guard = isolate_->stack_guard();
2348 #ifdef USE_SIMULATOR 2361 #ifdef USE_SIMULATOR
2349 // The simulator uses a separate JS stack. 2362 // The simulator uses a separate JS stack.
2350 Address jssp_address = Simulator::current(isolate_)->get_sp(); 2363 Address jssp_address = Simulator::current(isolate_)->get_sp();
2351 uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address); 2364 uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address);
2352 if (jssp < stack_guard->real_jslimit()) return true; 2365 if (jssp < stack_guard->real_jslimit()) return true;
2353 #endif // USE_SIMULATOR 2366 #endif // USE_SIMULATOR
2354 return reinterpret_cast<uintptr_t>(this) < stack_guard->real_climit(); 2367 return reinterpret_cast<uintptr_t>(this) < stack_guard->real_climit();
2355 } 2368 }
2356 2369
2357 2370
2358 } } // namespace v8::internal 2371 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698