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 5923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5934 | 5934 |
5935 | 5935 |
5936 void V8::SetRetainedObjectInfo(Isolate* exported_isolate, | 5936 void V8::SetRetainedObjectInfo(Isolate* exported_isolate, |
5937 UniqueId id, | 5937 UniqueId id, |
5938 RetainedObjectInfo* info) { | 5938 RetainedObjectInfo* info) { |
5939 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); | 5939 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); |
5940 isolate->global_handles()->SetRetainedObjectInfo(id, info); | 5940 isolate->global_handles()->SetRetainedObjectInfo(id, info); |
5941 } | 5941 } |
5942 | 5942 |
5943 | 5943 |
| 5944 void V8::SetObjectGroupRepresentative( |
| 5945 Isolate* exported_isolate, |
| 5946 UniqueId id, |
| 5947 const Persistent<Object>& object) { |
| 5948 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); |
| 5949 isolate->global_handles()->SetObjectGroupRepresentative( |
| 5950 id, |
| 5951 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*object)).location()); |
| 5952 } |
| 5953 |
| 5954 |
5944 void V8::AddImplicitReferences(Persistent<Object> parent, | 5955 void V8::AddImplicitReferences(Persistent<Object> parent, |
5945 Persistent<Value>* children, | 5956 Persistent<Value>* children, |
5946 size_t length) { | 5957 size_t length) { |
5947 i::Isolate* isolate = i::Isolate::Current(); | 5958 i::Isolate* isolate = i::Isolate::Current(); |
5948 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return; | 5959 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return; |
5949 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); | 5960 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); |
5950 isolate->global_handles()->AddImplicitReferences( | 5961 isolate->global_handles()->AddImplicitReferences( |
5951 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(), | 5962 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(), |
5952 reinterpret_cast<i::Object***>(children), length); | 5963 reinterpret_cast<i::Object***>(children), length); |
5953 } | 5964 } |
5954 | 5965 |
5955 | 5966 |
| 5967 void V8::AddImplicitReference(Isolate* exported_isolate, |
| 5968 UniqueId id, |
| 5969 const Persistent<Value>& object) { |
| 5970 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); |
| 5971 isolate->global_handles() |
| 5972 ->AddImplicitReference(id, reinterpret_cast<i::Object**>(*object)); |
| 5973 } |
| 5974 |
| 5975 |
5956 intptr_t Isolate::AdjustAmountOfExternalAllocatedMemory( | 5976 intptr_t Isolate::AdjustAmountOfExternalAllocatedMemory( |
5957 intptr_t change_in_bytes) { | 5977 intptr_t change_in_bytes) { |
5958 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); | 5978 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); |
5959 return heap->AdjustAmountOfExternalAllocatedMemory(change_in_bytes); | 5979 return heap->AdjustAmountOfExternalAllocatedMemory(change_in_bytes); |
5960 } | 5980 } |
5961 | 5981 |
5962 | 5982 |
5963 intptr_t V8::AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes) { | 5983 intptr_t V8::AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes) { |
5964 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 5984 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); |
5965 if (isolate == NULL || !isolate->IsInitialized() || | 5985 if (isolate == NULL || !isolate->IsInitialized() || |
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7394 | 7414 |
7395 v->VisitPointers(blocks_.first(), first_block_limit_); | 7415 v->VisitPointers(blocks_.first(), first_block_limit_); |
7396 | 7416 |
7397 for (int i = 1; i < blocks_.length(); i++) { | 7417 for (int i = 1; i < blocks_.length(); i++) { |
7398 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7418 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
7399 } | 7419 } |
7400 } | 7420 } |
7401 | 7421 |
7402 | 7422 |
7403 } } // namespace v8::internal | 7423 } } // namespace v8::internal |
OLD | NEW |