OLD | NEW |
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 5963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5974 | 5974 |
5975 v8::Local<v8::Context> Isolate::GetCurrentContext() { | 5975 v8::Local<v8::Context> Isolate::GetCurrentContext() { |
5976 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this); | 5976 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this); |
5977 i::Handle<i::Object> current = internal_isolate->native_context(); | 5977 i::Handle<i::Object> current = internal_isolate->native_context(); |
5978 if (current.is_null()) return Local<Context>(); | 5978 if (current.is_null()) return Local<Context>(); |
5979 i::Handle<i::Context> context = i::Handle<i::Context>::cast(current); | 5979 i::Handle<i::Context> context = i::Handle<i::Context>::cast(current); |
5980 return Utils::ToLocal(context); | 5980 return Utils::ToLocal(context); |
5981 } | 5981 } |
5982 | 5982 |
5983 | 5983 |
| 5984 void Isolate::SetObjectGroupId(const Persistent<Value>& object, |
| 5985 UniqueId id) { |
| 5986 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this); |
| 5987 internal_isolate->global_handles()->SetObjectGroupId( |
| 5988 reinterpret_cast<i::Object**>(*object), id); |
| 5989 } |
| 5990 |
| 5991 |
| 5992 void Isolate::SetReferenceFromGroup(UniqueId id, |
| 5993 const Persistent<Value>& object) { |
| 5994 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this); |
| 5995 internal_isolate->global_handles() |
| 5996 ->SetReferenceFromGroup(id, reinterpret_cast<i::Object**>(*object)); |
| 5997 } |
| 5998 |
| 5999 |
| 6000 void Isolate::SetReference(const Persistent<Object>& parent, |
| 6001 const Persistent<Value>& child) { |
| 6002 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this); |
| 6003 internal_isolate->global_handles()->SetReference( |
| 6004 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(), |
| 6005 reinterpret_cast<i::Object**>(*child)); |
| 6006 } |
| 6007 |
| 6008 |
5984 void V8::SetGlobalGCPrologueCallback(GCCallback callback) { | 6009 void V8::SetGlobalGCPrologueCallback(GCCallback callback) { |
5985 i::Isolate* isolate = i::Isolate::Current(); | 6010 i::Isolate* isolate = i::Isolate::Current(); |
5986 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return; | 6011 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return; |
5987 isolate->heap()->SetGlobalGCPrologueCallback(callback); | 6012 isolate->heap()->SetGlobalGCPrologueCallback(callback); |
5988 } | 6013 } |
5989 | 6014 |
5990 | 6015 |
5991 void V8::SetGlobalGCEpilogueCallback(GCCallback callback) { | 6016 void V8::SetGlobalGCEpilogueCallback(GCCallback callback) { |
5992 i::Isolate* isolate = i::Isolate::Current(); | 6017 i::Isolate* isolate = i::Isolate::Current(); |
5993 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCEpilogueCallback()")) return; | 6018 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCEpilogueCallback()")) return; |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7167 return i::Isolate::Current()->heap_profiler()->GetMemorySizeUsedByProfiler(); | 7192 return i::Isolate::Current()->heap_profiler()->GetMemorySizeUsedByProfiler(); |
7168 } | 7193 } |
7169 | 7194 |
7170 | 7195 |
7171 size_t HeapProfiler::GetProfilerMemorySize() { | 7196 size_t HeapProfiler::GetProfilerMemorySize() { |
7172 return reinterpret_cast<i::HeapProfiler*>(this)-> | 7197 return reinterpret_cast<i::HeapProfiler*>(this)-> |
7173 GetMemorySizeUsedByProfiler(); | 7198 GetMemorySizeUsedByProfiler(); |
7174 } | 7199 } |
7175 | 7200 |
7176 | 7201 |
| 7202 void HeapProfiler::SetRetainedObjectInfo(UniqueId id, |
| 7203 RetainedObjectInfo* info) { |
| 7204 reinterpret_cast<i::HeapProfiler*>(this)->SetRetainedObjectInfo(id, info); |
| 7205 } |
| 7206 |
| 7207 |
7177 v8::Testing::StressType internal::Testing::stress_type_ = | 7208 v8::Testing::StressType internal::Testing::stress_type_ = |
7178 v8::Testing::kStressTypeOpt; | 7209 v8::Testing::kStressTypeOpt; |
7179 | 7210 |
7180 | 7211 |
7181 void Testing::SetStressRunType(Testing::StressType type) { | 7212 void Testing::SetStressRunType(Testing::StressType type) { |
7182 internal::Testing::set_stress_type(type); | 7213 internal::Testing::set_stress_type(type); |
7183 } | 7214 } |
7184 | 7215 |
7185 int Testing::GetStressRuns() { | 7216 int Testing::GetStressRuns() { |
7186 if (internal::FLAG_stress_runs != 0) return internal::FLAG_stress_runs; | 7217 if (internal::FLAG_stress_runs != 0) return internal::FLAG_stress_runs; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7381 | 7412 |
7382 v->VisitPointers(blocks_.first(), first_block_limit_); | 7413 v->VisitPointers(blocks_.first(), first_block_limit_); |
7383 | 7414 |
7384 for (int i = 1; i < blocks_.length(); i++) { | 7415 for (int i = 1; i < blocks_.length(); i++) { |
7385 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7416 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
7386 } | 7417 } |
7387 } | 7418 } |
7388 | 7419 |
7389 | 7420 |
7390 } } // namespace v8::internal | 7421 } } // namespace v8::internal |
OLD | NEW |