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

Side by Side Diff: src/api.cc

Issue 10706002: Implements a new API to set a function entry hook for profiling. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make test non-threaded as it manipulates process-global state, and thus can't deterministically run… Created 8 years, 5 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 | « include/v8.h ('k') | src/arm/code-stubs-arm.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 15 matching lines...) Expand all
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #include "api.h" 28 #include "api.h"
29 29
30 #include <math.h> // For isnan. 30 #include <math.h> // For isnan.
31 #include <string.h> // For memcpy, strlen. 31 #include <string.h> // For memcpy, strlen.
32 #include "../include/v8-debug.h" 32 #include "../include/v8-debug.h"
33 #include "../include/v8-profiler.h" 33 #include "../include/v8-profiler.h"
34 #include "../include/v8-testing.h" 34 #include "../include/v8-testing.h"
35 #include "bootstrapper.h" 35 #include "bootstrapper.h"
36 #include "code-stubs.h"
36 #include "compiler.h" 37 #include "compiler.h"
37 #include "conversions-inl.h" 38 #include "conversions-inl.h"
38 #include "counters.h" 39 #include "counters.h"
39 #include "debug.h" 40 #include "debug.h"
40 #include "deoptimizer.h" 41 #include "deoptimizer.h"
41 #include "execution.h" 42 #include "execution.h"
42 #include "global-handles.h" 43 #include "global-handles.h"
43 #include "heap-profiler.h" 44 #include "heap-profiler.h"
44 #include "messages.h" 45 #include "messages.h"
45 #ifdef COMPRESS_STARTUP_DATA_BZ2 46 #ifdef COMPRESS_STARTUP_DATA_BZ2
(...skipping 4179 matching lines...) Expand 10 before | Expand all | Expand 10 after
4225 i::V8::SetEntropySource(source); 4226 i::V8::SetEntropySource(source);
4226 } 4227 }
4227 4228
4228 4229
4229 void v8::V8::SetReturnAddressLocationResolver( 4230 void v8::V8::SetReturnAddressLocationResolver(
4230 ReturnAddressLocationResolver return_address_resolver) { 4231 ReturnAddressLocationResolver return_address_resolver) {
4231 i::V8::SetReturnAddressLocationResolver(return_address_resolver); 4232 i::V8::SetReturnAddressLocationResolver(return_address_resolver);
4232 } 4233 }
4233 4234
4234 4235
4236 bool v8::V8::SetFunctionEntryHook(FunctionEntryHook entry_hook) {
4237 return i::ProfileEntryHookStub::SetFunctionEntryHook(entry_hook);
4238 }
4239
4240
4235 bool v8::V8::Dispose() { 4241 bool v8::V8::Dispose() {
4236 i::Isolate* isolate = i::Isolate::Current(); 4242 i::Isolate* isolate = i::Isolate::Current();
4237 if (!ApiCheck(isolate != NULL && isolate->IsDefaultIsolate(), 4243 if (!ApiCheck(isolate != NULL && isolate->IsDefaultIsolate(),
4238 "v8::V8::Dispose()", 4244 "v8::V8::Dispose()",
4239 "Use v8::Isolate::Dispose() for a non-default isolate.")) { 4245 "Use v8::Isolate::Dispose() for a non-default isolate.")) {
4240 return false; 4246 return false;
4241 } 4247 }
4242 i::V8::TearDown(); 4248 i::V8::TearDown();
4243 return true; 4249 return true;
4244 } 4250 }
(...skipping 2273 matching lines...) Expand 10 before | Expand all | Expand 10 after
6518 6524
6519 v->VisitPointers(blocks_.first(), first_block_limit_); 6525 v->VisitPointers(blocks_.first(), first_block_limit_);
6520 6526
6521 for (int i = 1; i < blocks_.length(); i++) { 6527 for (int i = 1; i < blocks_.length(); i++) {
6522 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 6528 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
6523 } 6529 }
6524 } 6530 }
6525 6531
6526 6532
6527 } } // namespace v8::internal 6533 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698