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

Side by Side Diff: src/api.cc

Issue 14007008: New GC APIs, try 2. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Moving funcs & code review. Created 7 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
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 5960 matching lines...) Expand 10 before | Expand all | Expand 10 after
5971 5971
5972 v8::Local<v8::Context> Isolate::GetCurrentContext() { 5972 v8::Local<v8::Context> Isolate::GetCurrentContext() {
5973 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this); 5973 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this);
5974 i::Handle<i::Object> current = internal_isolate->native_context(); 5974 i::Handle<i::Object> current = internal_isolate->native_context();
5975 if (current.is_null()) return Local<Context>(); 5975 if (current.is_null()) return Local<Context>();
5976 i::Handle<i::Context> context = i::Handle<i::Context>::cast(current); 5976 i::Handle<i::Context> context = i::Handle<i::Context>::cast(current);
5977 return Utils::ToLocal(context); 5977 return Utils::ToLocal(context);
5978 } 5978 }
5979 5979
5980 5980
5981 void Isolate::SetObjectGroupId(const Persistent<Value>& object,
5982 UniqueId id) {
5983 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this);
5984 internal_isolate->global_handles()->SetObjectGroupId(
5985 reinterpret_cast<i::Object**>(*object), id);
5986 }
5987
5988
5989 void Isolate::AddImplicitReference(UniqueId id,
5990 const Persistent<Value>& object) {
5991 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this);
5992 internal_isolate->global_handles()
5993 ->AddImplicitReference(id, reinterpret_cast<i::Object**>(*object));
5994 }
5995
5996
5981 void V8::SetGlobalGCPrologueCallback(GCCallback callback) { 5997 void V8::SetGlobalGCPrologueCallback(GCCallback callback) {
5982 i::Isolate* isolate = i::Isolate::Current(); 5998 i::Isolate* isolate = i::Isolate::Current();
5983 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return; 5999 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return;
5984 isolate->heap()->SetGlobalGCPrologueCallback(callback); 6000 isolate->heap()->SetGlobalGCPrologueCallback(callback);
5985 } 6001 }
5986 6002
5987 6003
5988 void V8::SetGlobalGCEpilogueCallback(GCCallback callback) { 6004 void V8::SetGlobalGCEpilogueCallback(GCCallback callback) {
5989 i::Isolate* isolate = i::Isolate::Current(); 6005 i::Isolate* isolate = i::Isolate::Current();
5990 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCEpilogueCallback()")) return; 6006 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCEpilogueCallback()")) return;
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
7164 return i::Isolate::Current()->heap_profiler()->GetMemorySizeUsedByProfiler(); 7180 return i::Isolate::Current()->heap_profiler()->GetMemorySizeUsedByProfiler();
7165 } 7181 }
7166 7182
7167 7183
7168 size_t HeapProfiler::GetProfilerMemorySize() { 7184 size_t HeapProfiler::GetProfilerMemorySize() {
7169 return reinterpret_cast<i::HeapProfiler*>(this)-> 7185 return reinterpret_cast<i::HeapProfiler*>(this)->
7170 GetMemorySizeUsedByProfiler(); 7186 GetMemorySizeUsedByProfiler();
7171 } 7187 }
7172 7188
7173 7189
7190 void HeapProfiler::SetRetainedObjectInfo(UniqueId id,
7191 RetainedObjectInfo* info) {
7192 reinterpret_cast<i::HeapProfiler*>(this)->SetRetainedObjectInfo(id, info);
7193 }
7194
7195
7174 v8::Testing::StressType internal::Testing::stress_type_ = 7196 v8::Testing::StressType internal::Testing::stress_type_ =
7175 v8::Testing::kStressTypeOpt; 7197 v8::Testing::kStressTypeOpt;
7176 7198
7177 7199
7178 void Testing::SetStressRunType(Testing::StressType type) { 7200 void Testing::SetStressRunType(Testing::StressType type) {
7179 internal::Testing::set_stress_type(type); 7201 internal::Testing::set_stress_type(type);
7180 } 7202 }
7181 7203
7182 int Testing::GetStressRuns() { 7204 int Testing::GetStressRuns() {
7183 if (internal::FLAG_stress_runs != 0) return internal::FLAG_stress_runs; 7205 if (internal::FLAG_stress_runs != 0) return internal::FLAG_stress_runs;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
7378 7400
7379 v->VisitPointers(blocks_.first(), first_block_limit_); 7401 v->VisitPointers(blocks_.first(), first_block_limit_);
7380 7402
7381 for (int i = 1; i < blocks_.length(); i++) { 7403 for (int i = 1; i < blocks_.length(); i++) {
7382 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 7404 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
7383 } 7405 }
7384 } 7406 }
7385 7407
7386 7408
7387 } } // namespace v8::internal 7409 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698