| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 8a73877eedec4b395078d7c7f2f84b103c5df763..c76539344e0694e60dbd4406db8a9ef201bcc0b3 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -283,9 +283,12 @@ static inline bool EmptyCheck(const char* location, const v8::Data* obj) {
|
|
|
|
|
| static bool InitializeHelper(i::Isolate* isolate) {
|
| - // If the isolate has a function entry hook, it needs to re-build all its
|
| - // code stubs with entry hooks embedded, so let's deserialize a snapshot.
|
| - if (isolate == NULL || isolate->function_entry_hook() == NULL) {
|
| + // If the isolate has a function entry hook or enabled allocation profiler,
|
| + // it needs to re-build all its code stubs with embedded entry hooks
|
| + // or RecordObjectAllocation calls, so let's skip snapshot deserialization.
|
| + if (isolate == NULL || (
|
| + isolate->function_entry_hook() == NULL &&
|
| + !isolate->is_allocation_profiler_enabled())) {
|
| if (i::Snapshot::Initialize())
|
| return true;
|
| }
|
| @@ -4993,6 +4996,20 @@ void v8::V8::SetReturnAddressLocationResolver(
|
| }
|
|
|
|
|
| +bool v8::V8::EnableAllocationProfiler(Isolate* ext_isolate) {
|
| + ASSERT(ext_isolate != NULL);
|
| + i::Isolate* isolate = reinterpret_cast<i::Isolate*>(ext_isolate);
|
| + return isolate->enable_allocation_profiler();
|
| +}
|
| +
|
| +
|
| +bool v8::V8::IsAllocationProfilerEnabled(Isolate* ext_isolate) {
|
| + ASSERT(ext_isolate != NULL);
|
| + i::Isolate* isolate = reinterpret_cast<i::Isolate*>(ext_isolate);
|
| + return isolate->is_allocation_profiler_enabled();
|
| +}
|
| +
|
| +
|
| bool v8::V8::SetFunctionEntryHook(Isolate* ext_isolate,
|
| FunctionEntryHook entry_hook) {
|
| ASSERT(ext_isolate != NULL);
|
|
|