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

Unified Diff: src/api.cc

Issue 142813003: A64: Synchronize with r15358. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.h ('k') | src/arguments.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 9b1d01cd8f4ead1bab6e46f03c3ed362157f8c13..014d82ee4f0aab86c5f16ca339c22b335c42753b 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -961,6 +961,22 @@ void FunctionTemplate::Inherit(v8::Handle<FunctionTemplate> value) {
}
+// TODO(dcarney): Remove this abstraction when old callbacks are removed.
+class CallHandlerHelper {
+ public:
+ static inline void Set(Local<FunctionTemplate> function_template,
+ InvocationCallback callback,
+ v8::Handle<Value> data) {
+ function_template->SetCallHandlerInternal(callback, data);
+ }
+ static inline void Set(Local<FunctionTemplate> function_template,
+ FunctionCallback callback,
+ v8::Handle<Value> data) {
+ function_template->SetCallHandler(callback, data);
+ }
+};
+
+
template<typename Callback>
static Local<FunctionTemplate> FunctionTemplateNew(
Callback callback,
@@ -981,7 +997,7 @@ static Local<FunctionTemplate> FunctionTemplateNew(
obj->set_serial_number(i::Smi::FromInt(next_serial_number));
if (callback != 0) {
if (data.IsEmpty()) data = v8::Undefined();
- Utils::ToLocal(obj)->SetCallHandler(callback, data);
+ CallHandlerHelper::Set(Utils::ToLocal(obj), callback, data);
}
obj->set_length(length);
obj->set_undetectable(false);
@@ -1225,6 +1241,11 @@ void FunctionTemplate::SetCallHandler(InvocationCallback callback,
FunctionTemplateSetCallHandler(this, callback, data);
}
+void FunctionTemplate::SetCallHandlerInternal(InvocationCallback callback,
+ v8::Handle<Value> data) {
+ FunctionTemplateSetCallHandler(this, callback, data);
+}
+
void FunctionTemplate::SetCallHandler(FunctionCallback callback,
v8::Handle<Value> data) {
FunctionTemplateSetCallHandler(this, callback, data);
@@ -2005,6 +2026,19 @@ Local<Value> Script::Id() {
}
+int Script::GetId() {
+ i::Isolate* isolate = i::Isolate::Current();
+ ON_BAILOUT(isolate, "v8::Script::Id()", return -1);
+ LOG_API(isolate, "Script::Id");
+ {
+ i::HandleScope scope(isolate);
+ i::Handle<i::SharedFunctionInfo> function_info = OpenScript(this);
+ i::Handle<i::Script> script(i::Script::cast(function_info->script()));
+ return script->id()->value();
+ }
+}
+
+
int Script::GetLineNumber(int code_pos) {
i::Isolate* isolate = i::Isolate::Current();
ON_BAILOUT(isolate, "v8::Script::GetLineNumber()", return -1);
@@ -2573,6 +2607,11 @@ bool Value::IsArrayBuffer() const {
}
+bool Value::IsArrayBufferView() const {
+ return Utils::OpenHandle(this)->IsJSArrayBufferView();
+}
+
+
bool Value::IsTypedArray() const {
if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsArrayBuffer()"))
return false;
@@ -2606,6 +2645,11 @@ TYPED_ARRAY_LIST(VALUE_IS_TYPED_ARRAY)
#undef VALUE_IS_TYPED_ARRAY
+bool Value::IsDataView() const {
+ return Utils::OpenHandle(this)->IsJSDataView();
+}
+
+
bool Value::IsObject() const {
if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsObject()")) return false;
return Utils::OpenHandle(this)->IsJSObject();
@@ -2872,6 +2916,16 @@ Local<Integer> Value::ToInteger() const {
}
+#ifdef V8_ENABLE_CHECKS
+void i::Internals::CheckInitialized(v8::Isolate* external_isolate) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate);
+ ApiCheck(isolate != NULL && isolate->IsInitialized() && !i::V8::IsDead(),
+ "v8::internal::Internals::CheckInitialized()",
+ "Isolate is not initialized or V8 has died");
+}
+#endif
+
+
void External::CheckCast(v8::Value* that) {
if (IsDeadCheck(i::Isolate::Current(), "v8::External::Cast()")) return;
ApiCheck(Utils::OpenHandle(that)->IsExternal(),
@@ -2952,6 +3006,14 @@ void v8::ArrayBuffer::CheckCast(Value* that) {
}
+void v8::ArrayBufferView::CheckCast(Value* that) {
+ i::Handle<i::Object> obj = Utils::OpenHandle(that);
+ ApiCheck(obj->IsJSArrayBufferView(),
+ "v8::ArrayBufferView::Cast()",
+ "Could not convert to ArrayBufferView");
+}
+
+
void v8::TypedArray::CheckCast(Value* that) {
if (IsDeadCheck(i::Isolate::Current(), "v8::TypedArray::Cast()")) return;
i::Handle<i::Object> obj = Utils::OpenHandle(that);
@@ -2978,6 +3040,14 @@ TYPED_ARRAY_LIST(CHECK_TYPED_ARRAY_CAST)
#undef CHECK_TYPED_ARRAY_CAST
+void v8::DataView::CheckCast(Value* that) {
+ i::Handle<i::Object> obj = Utils::OpenHandle(that);
+ ApiCheck(obj->IsJSDataView(),
+ "v8::DataView::Cast()",
+ "Could not convert to DataView");
+}
+
+
void v8::Date::CheckCast(v8::Value* that) {
i::Isolate* isolate = i::Isolate::Current();
if (IsDeadCheck(isolate, "v8::Date::Cast()")) return;
@@ -3865,7 +3935,7 @@ v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) {
i::Handle<i::String> key_string =
isolate->factory()->InternalizeString(key_obj);
i::Handle<i::Object> result(self->GetHiddenProperty(*key_string), isolate);
- if (result->IsUndefined()) return v8::Local<v8::Value>();
+ if (result->IsTheHole()) return v8::Local<v8::Value>();
return Utils::ToLocal(result);
}
@@ -4279,6 +4349,7 @@ int Function::GetScriptColumnNumber() const {
return kLineOffsetNotFound;
}
+
Handle<Value> Function::GetScriptId() const {
i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
if (!func->shared()->script()->IsScript())
@@ -4287,6 +4358,15 @@ Handle<Value> Function::GetScriptId() const {
return Utils::ToLocal(i::Handle<i::Object>(script->id(), func->GetIsolate()));
}
+
+int Function::ScriptId() const {
+ i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
+ if (!func->shared()->script()->IsScript()) return v8::Script::kNoScriptId;
+ i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
+ return script->id()->value();
+}
+
+
int String::Length() const {
i::Handle<i::String> str = Utils::OpenHandle(this);
if (IsDeadCheck(str->GetIsolate(), "v8::String::Length()")) return 0;
@@ -6161,11 +6241,17 @@ void v8::ArrayBuffer::Neuter() {
LOG_API(obj->GetIsolate(), "v8::ArrayBuffer::Neuter()");
ENTER_V8(isolate);
- for (i::Handle<i::Object> array_obj(obj->weak_first_array(), isolate);
- !array_obj->IsUndefined();) {
- i::Handle<i::JSTypedArray> typed_array(i::JSTypedArray::cast(*array_obj));
- typed_array->Neuter();
- array_obj = i::handle(typed_array->weak_next(), isolate);
+ for (i::Handle<i::Object> view_obj(obj->weak_first_view(), isolate);
+ !view_obj->IsUndefined();) {
+ i::Handle<i::JSArrayBufferView> view(i::JSArrayBufferView::cast(*view_obj));
+ if (view->IsJSTypedArray()) {
+ i::JSTypedArray::cast(*view)->Neuter();
+ } else if (view->IsJSDataView()) {
+ i::JSDataView::cast(*view)->Neuter();
+ } else {
+ UNREACHABLE();
+ }
+ view_obj = i::handle(view->weak_next(), isolate);
}
obj->Neuter();
}
@@ -6203,33 +6289,35 @@ Local<ArrayBuffer> v8::ArrayBuffer::New(void* data, size_t byte_length) {
}
-Local<ArrayBuffer> v8::TypedArray::Buffer() {
- i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
- if (IsDeadCheck(isolate, "v8::TypedArray::Buffer()"))
- return Local<ArrayBuffer>();
- i::Handle<i::JSTypedArray> obj = Utils::OpenHandle(this);
+Local<ArrayBuffer> v8::ArrayBufferView::Buffer() {
+ i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this);
ASSERT(obj->buffer()->IsJSArrayBuffer());
i::Handle<i::JSArrayBuffer> buffer(i::JSArrayBuffer::cast(obj->buffer()));
return Utils::ToLocal(buffer);
}
-size_t v8::TypedArray::ByteOffset() {
- i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
- if (IsDeadCheck(isolate, "v8::TypedArray::ByteOffset()")) return 0;
- i::Handle<i::JSTypedArray> obj = Utils::OpenHandle(this);
+size_t v8::ArrayBufferView::ByteOffset() {
+ i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this);
return static_cast<size_t>(obj->byte_offset()->Number());
}
-size_t v8::TypedArray::ByteLength() {
- i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
- if (IsDeadCheck(isolate, "v8::TypedArray::ByteLength()")) return 0;
- i::Handle<i::JSTypedArray> obj = Utils::OpenHandle(this);
+size_t v8::ArrayBufferView::ByteLength() {
+ i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this);
return static_cast<size_t>(obj->byte_length()->Number());
}
+void* v8::ArrayBufferView::BaseAddress() {
+ i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this);
+ i::Handle<i::JSArrayBuffer> buffer(i::JSArrayBuffer::cast(obj->buffer()));
+ void* buffer_data = buffer->backing_store();
+ size_t byte_offset = static_cast<size_t>(obj->byte_offset()->Number());
+ return static_cast<uint8_t*>(buffer_data) + byte_offset;
+}
+
+
size_t v8::TypedArray::Length() {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
if (IsDeadCheck(isolate, "v8::TypedArray::Length()")) return 0;
@@ -6238,16 +6326,28 @@ size_t v8::TypedArray::Length() {
}
-void* v8::TypedArray::BaseAddress() {
- i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
- if (IsDeadCheck(isolate, "v8::TypedArray::BaseAddress()")) return NULL;
- i::Handle<i::JSTypedArray> obj = Utils::OpenHandle(this);
- i::Handle<i::JSArrayBuffer> buffer(i::JSArrayBuffer::cast(obj->buffer()));
- void* buffer_data = buffer->backing_store();
- size_t byte_offset = static_cast<size_t>(obj->byte_offset()->Number());
- return static_cast<uint8_t*>(buffer_data) + byte_offset;
-}
+static inline void SetupArrayBufferView(
+ i::Isolate* isolate,
+ i::Handle<i::JSArrayBufferView> obj,
+ i::Handle<i::JSArrayBuffer> buffer,
+ size_t byte_offset,
+ size_t byte_length) {
+ ASSERT(byte_offset + byte_length <=
+ static_cast<size_t>(buffer->byte_length()->Number()));
+
+ obj->set_buffer(*buffer);
+
+ obj->set_weak_next(buffer->weak_first_view());
+ buffer->set_weak_first_view(*obj);
+ i::Handle<i::Object> byte_offset_object =
+ isolate->factory()->NewNumberFromSize(byte_offset);
+ obj->set_byte_offset(*byte_offset_object);
+
+ i::Handle<i::Object> byte_length_object =
+ isolate->factory()->NewNumberFromSize(byte_length);
+ obj->set_byte_length(*byte_length_object);
+}
template<typename ElementType,
ExternalArrayType array_type,
@@ -6260,24 +6360,12 @@ i::Handle<i::JSTypedArray> NewTypedArray(
i::Handle<i::JSArrayBuffer> buffer = Utils::OpenHandle(*array_buffer);
ASSERT(byte_offset % sizeof(ElementType) == 0);
- ASSERT(byte_offset + length * sizeof(ElementType) <=
- static_cast<size_t>(buffer->byte_length()->Number()));
-
- obj->set_buffer(*buffer);
-
- obj->set_weak_next(buffer->weak_first_array());
- buffer->set_weak_first_array(*obj);
-
- i::Handle<i::Object> byte_offset_object = isolate->factory()->NewNumber(
- static_cast<double>(byte_offset));
- obj->set_byte_offset(*byte_offset_object);
- i::Handle<i::Object> byte_length_object = isolate->factory()->NewNumber(
- static_cast<double>(length * sizeof(ElementType)));
- obj->set_byte_length(*byte_length_object);
+ SetupArrayBufferView(
+ isolate, obj, buffer, byte_offset, length * sizeof(ElementType));
- i::Handle<i::Object> length_object = isolate->factory()->NewNumber(
- static_cast<double>(length));
+ i::Handle<i::Object> length_object =
+ isolate->factory()->NewNumberFromSize(length);
obj->set_length(*length_object);
i::Handle<i::ExternalArray> elements =
@@ -6326,6 +6414,20 @@ TYPED_ARRAY_NEW(Float64Array, double, kExternalDoubleArray,
#undef TYPED_ARRAY_NEW
+Local<DataView> DataView::New(Handle<ArrayBuffer> array_buffer,
+ size_t byte_offset, size_t byte_length) {
+ i::Isolate* isolate = i::Isolate::Current();
+ EnsureInitializedForIsolate(
+ isolate, "v8::DataView::New(void*, size_t, size_t)");
+ LOG_API(isolate, "v8::DataView::New(void*, size_t, size_t)");
+ ENTER_V8(isolate);
+ i::Handle<i::JSDataView> obj = isolate->factory()->NewJSDataView();
+ i::Handle<i::JSArrayBuffer> buffer = Utils::OpenHandle(*array_buffer);
+ SetupArrayBufferView(
+ isolate, obj, buffer, byte_offset, byte_length);
+ return Utils::ToLocal(obj);
+}
+
Local<Symbol> v8::Symbol::New(Isolate* isolate) {
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
@@ -6538,10 +6640,11 @@ CpuProfiler* Isolate::GetCpuProfiler() {
v8::Local<v8::Context> Isolate::GetCurrentContext() {
i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this);
- i::Handle<i::Object> current = internal_isolate->native_context();
- if (current.is_null()) return Local<Context>();
- i::Handle<i::Context> context = i::Handle<i::Context>::cast(current);
- return Utils::ToLocal(context);
+ i::Context* context = internal_isolate->context();
+ if (context == NULL) return Local<Context>();
+ i::Context* native_context = context->global_object()->native_context();
+ if (native_context == NULL) return Local<Context>();
+ return Utils::ToLocal(i::Handle<i::Context>(native_context));
}
@@ -7304,33 +7407,11 @@ int CpuProfile::GetSamplesCount() const {
}
-int CpuProfiler::GetProfilesCount() {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfiler::GetProfilesCount");
- i::CpuProfiler* profiler = isolate->cpu_profiler();
- ASSERT(profiler != NULL);
- return profiler->GetProfilesCount();
-}
-
-
int CpuProfiler::GetProfileCount() {
return reinterpret_cast<i::CpuProfiler*>(this)->GetProfilesCount();
}
-const CpuProfile* CpuProfiler::GetProfile(int index,
- Handle<Value> security_token) {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfiler::GetProfile");
- i::CpuProfiler* profiler = isolate->cpu_profiler();
- ASSERT(profiler != NULL);
- return reinterpret_cast<const CpuProfile*>(
- profiler->GetProfile(
- security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
- index));
-}
-
-
const CpuProfile* CpuProfiler::GetCpuProfile(int index,
Handle<Value> security_token) {
return reinterpret_cast<const CpuProfile*>(
@@ -7346,19 +7427,6 @@ const CpuProfile* CpuProfiler::GetCpuProfile(int index) {
}
-const CpuProfile* CpuProfiler::FindProfile(unsigned uid,
- Handle<Value> security_token) {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfiler::FindProfile");
- i::CpuProfiler* profiler = isolate->cpu_profiler();
- ASSERT(profiler != NULL);
- return reinterpret_cast<const CpuProfile*>(
- profiler->FindProfile(
- security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
- uid));
-}
-
-
const CpuProfile* CpuProfiler::FindCpuProfile(unsigned uid,
Handle<Value> security_token) {
return reinterpret_cast<const CpuProfile*>(
@@ -7368,34 +7436,12 @@ const CpuProfile* CpuProfiler::FindCpuProfile(unsigned uid,
}
-void CpuProfiler::StartProfiling(Handle<String> title, bool record_samples) {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfiler::StartProfiling");
- i::CpuProfiler* profiler = isolate->cpu_profiler();
- ASSERT(profiler != NULL);
- profiler->StartProfiling(*Utils::OpenHandle(*title), record_samples);
-}
-
-
void CpuProfiler::StartCpuProfiling(Handle<String> title, bool record_samples) {
reinterpret_cast<i::CpuProfiler*>(this)->StartProfiling(
*Utils::OpenHandle(*title), record_samples);
}
-const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title,
- Handle<Value> security_token) {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfiler::StopProfiling");
- i::CpuProfiler* profiler = isolate->cpu_profiler();
- ASSERT(profiler != NULL);
- return reinterpret_cast<const CpuProfile*>(
- profiler->StopProfiling(
- security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
- *Utils::OpenHandle(*title)));
-}
-
-
const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title,
Handle<Value> security_token) {
return reinterpret_cast<const CpuProfile*>(
@@ -7413,15 +7459,6 @@ const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title) {
}
-void CpuProfiler::DeleteAllProfiles() {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfiler::DeleteAllProfiles");
- i::CpuProfiler* profiler = isolate->cpu_profiler();
- ASSERT(profiler != NULL);
- profiler->DeleteAllProfiles();
-}
-
-
void CpuProfiler::DeleteAllCpuProfiles() {
reinterpret_cast<i::CpuProfiler*>(this)->DeleteAllProfiles();
}
@@ -7555,13 +7592,6 @@ void HeapSnapshot::Delete() {
}
-HeapSnapshot::Type HeapSnapshot::GetType() const {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::HeapSnapshot::GetType");
- return kFull;
-}
-
-
unsigned HeapSnapshot::GetUid() const {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid");
@@ -7632,72 +7662,29 @@ void HeapSnapshot::Serialize(OutputStream* stream,
}
-int HeapProfiler::GetSnapshotsCount() {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshotsCount");
- return isolate->heap_profiler()->GetSnapshotsCount();
-}
-
-
int HeapProfiler::GetSnapshotCount() {
return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotsCount();
}
-const HeapSnapshot* HeapProfiler::GetSnapshot(int index) {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshot");
- return reinterpret_cast<const HeapSnapshot*>(
- isolate->heap_profiler()->GetSnapshot(index));
-}
-
-
const HeapSnapshot* HeapProfiler::GetHeapSnapshot(int index) {
return reinterpret_cast<const HeapSnapshot*>(
reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshot(index));
}
-const HeapSnapshot* HeapProfiler::FindSnapshot(unsigned uid) {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::HeapProfiler::FindSnapshot");
- return reinterpret_cast<const HeapSnapshot*>(
- isolate->heap_profiler()->FindSnapshot(uid));
-}
-
-
const HeapSnapshot* HeapProfiler::FindHeapSnapshot(unsigned uid) {
return reinterpret_cast<const HeapSnapshot*>(
reinterpret_cast<i::HeapProfiler*>(this)->FindSnapshot(uid));
}
-SnapshotObjectId HeapProfiler::GetSnapshotObjectId(Handle<Value> value) {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshotObjectId");
- i::Handle<i::Object> obj = Utils::OpenHandle(*value);
- return isolate->heap_profiler()->GetSnapshotObjectId(obj);
-}
-
-
SnapshotObjectId HeapProfiler::GetObjectId(Handle<Value> value) {
i::Handle<i::Object> obj = Utils::OpenHandle(*value);
return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj);
}
-const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle<String> title,
- HeapSnapshot::Type type,
- ActivityControl* control,
- ObjectNameResolver* resolver) {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::HeapProfiler::TakeSnapshot");
- return reinterpret_cast<const HeapSnapshot*>(
- isolate->heap_profiler()->TakeSnapshot(
- *Utils::OpenHandle(*title), control, resolver));
-}
-
-
const HeapSnapshot* HeapProfiler::TakeHeapSnapshot(
Handle<String> title,
ActivityControl* control,
@@ -7708,61 +7695,26 @@ const HeapSnapshot* HeapProfiler::TakeHeapSnapshot(
}
-void HeapProfiler::StartHeapObjectsTracking() {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::HeapProfiler::StartHeapObjectsTracking");
- isolate->heap_profiler()->StartHeapObjectsTracking();
-}
-
-
void HeapProfiler::StartTrackingHeapObjects() {
reinterpret_cast<i::HeapProfiler*>(this)->StartHeapObjectsTracking();
}
-void HeapProfiler::StopHeapObjectsTracking() {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::HeapProfiler::StopHeapObjectsTracking");
- isolate->heap_profiler()->StopHeapObjectsTracking();
-}
-
-
void HeapProfiler::StopTrackingHeapObjects() {
reinterpret_cast<i::HeapProfiler*>(this)->StopHeapObjectsTracking();
}
-SnapshotObjectId HeapProfiler::PushHeapObjectsStats(OutputStream* stream) {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::HeapProfiler::PushHeapObjectsStats");
- return isolate->heap_profiler()->PushHeapObjectsStats(stream);
-}
-
-
SnapshotObjectId HeapProfiler::GetHeapStats(OutputStream* stream) {
return reinterpret_cast<i::HeapProfiler*>(this)->PushHeapObjectsStats(stream);
}
-void HeapProfiler::DeleteAllSnapshots() {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::HeapProfiler::DeleteAllSnapshots");
- isolate->heap_profiler()->DeleteAllSnapshots();
-}
-
-
void HeapProfiler::DeleteAllHeapSnapshots() {
reinterpret_cast<i::HeapProfiler*>(this)->DeleteAllSnapshots();
}
-void HeapProfiler::DefineWrapperClass(uint16_t class_id,
- WrapperInfoCallback callback) {
- i::Isolate::Current()->heap_profiler()->DefineWrapperClass(class_id,
- callback);
-}
-
-
void HeapProfiler::SetWrapperClassInfoProvider(uint16_t class_id,
WrapperInfoCallback callback) {
reinterpret_cast<i::HeapProfiler*>(this)->DefineWrapperClass(class_id,
@@ -7770,17 +7722,6 @@ void HeapProfiler::SetWrapperClassInfoProvider(uint16_t class_id,
}
-int HeapProfiler::GetPersistentHandleCount() {
- i::Isolate* isolate = i::Isolate::Current();
- return isolate->global_handles()->NumberOfGlobalHandles();
-}
-
-
-size_t HeapProfiler::GetMemorySizeUsedByProfiler() {
- return i::Isolate::Current()->heap_profiler()->GetMemorySizeUsedByProfiler();
-}
-
-
size_t HeapProfiler::GetProfilerMemorySize() {
return reinterpret_cast<i::HeapProfiler*>(this)->
GetMemorySizeUsedByProfiler();
« no previous file with comments | « src/api.h ('k') | src/arguments.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698