| 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 5907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5918 RetainedObjectInfo* info) { | 5918 RetainedObjectInfo* info) { |
| 5919 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); | 5919 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); |
| 5920 ASSERT(isolate == i::Isolate::Current()); | 5920 ASSERT(isolate == i::Isolate::Current()); |
| 5921 if (IsDeadCheck(isolate, "v8::V8::AddObjectGroup()")) return; | 5921 if (IsDeadCheck(isolate, "v8::V8::AddObjectGroup()")) return; |
| 5922 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); | 5922 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); |
| 5923 isolate->global_handles()->AddObjectGroup( | 5923 isolate->global_handles()->AddObjectGroup( |
| 5924 reinterpret_cast<i::Object***>(objects), length, info); | 5924 reinterpret_cast<i::Object***>(objects), length, info); |
| 5925 } | 5925 } |
| 5926 | 5926 |
| 5927 | 5927 |
| 5928 void V8::SetObjectGroupId(Isolate* exported_isolate, | |
| 5929 const Persistent<Value>& object, | |
| 5930 UniqueId id) { | |
| 5931 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); | |
| 5932 isolate->global_handles()->SetObjectGroupId( | |
| 5933 reinterpret_cast<i::Object**>(*object), id); | |
| 5934 } | |
| 5935 | |
| 5936 | |
| 5937 void V8::SetRetainedObjectInfo(Isolate* exported_isolate, | |
| 5938 UniqueId id, | |
| 5939 RetainedObjectInfo* info) { | |
| 5940 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); | |
| 5941 isolate->global_handles()->SetRetainedObjectInfo(id, info); | |
| 5942 } | |
| 5943 | |
| 5944 | |
| 5945 void V8::SetObjectGroupRepresentative( | |
| 5946 Isolate* exported_isolate, | |
| 5947 UniqueId id, | |
| 5948 const Persistent<Object>& object) { | |
| 5949 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); | |
| 5950 isolate->global_handles()->SetObjectGroupRepresentative( | |
| 5951 id, | |
| 5952 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*object)).location()); | |
| 5953 } | |
| 5954 | |
| 5955 | |
| 5956 void V8::AddImplicitReferences(Persistent<Object> parent, | 5928 void V8::AddImplicitReferences(Persistent<Object> parent, |
| 5957 Persistent<Value>* children, | 5929 Persistent<Value>* children, |
| 5958 size_t length) { | 5930 size_t length) { |
| 5959 i::Isolate* isolate = i::Isolate::Current(); | 5931 i::Isolate* isolate = i::Isolate::Current(); |
| 5960 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return; | 5932 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return; |
| 5961 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); | 5933 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); |
| 5962 isolate->global_handles()->AddImplicitReferences( | 5934 isolate->global_handles()->AddImplicitReferences( |
| 5963 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(), | 5935 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(), |
| 5964 reinterpret_cast<i::Object***>(children), length); | 5936 reinterpret_cast<i::Object***>(children), length); |
| 5965 } | 5937 } |
| 5966 | 5938 |
| 5967 | 5939 |
| 5968 void V8::AddImplicitReference(Isolate* exported_isolate, | |
| 5969 UniqueId id, | |
| 5970 const Persistent<Value>& object) { | |
| 5971 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); | |
| 5972 isolate->global_handles() | |
| 5973 ->AddImplicitReference(id, reinterpret_cast<i::Object**>(*object)); | |
| 5974 } | |
| 5975 | |
| 5976 | |
| 5977 intptr_t Isolate::AdjustAmountOfExternalAllocatedMemory( | 5940 intptr_t Isolate::AdjustAmountOfExternalAllocatedMemory( |
| 5978 intptr_t change_in_bytes) { | 5941 intptr_t change_in_bytes) { |
| 5979 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); | 5942 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); |
| 5980 return heap->AdjustAmountOfExternalAllocatedMemory(change_in_bytes); | 5943 return heap->AdjustAmountOfExternalAllocatedMemory(change_in_bytes); |
| 5981 } | 5944 } |
| 5982 | 5945 |
| 5983 | 5946 |
| 5984 intptr_t V8::AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes) { | 5947 intptr_t V8::AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes) { |
| 5985 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); | 5948 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); |
| 5986 if (isolate == NULL || !isolate->IsInitialized() || | 5949 if (isolate == NULL || !isolate->IsInitialized() || |
| (...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7415 | 7378 |
| 7416 v->VisitPointers(blocks_.first(), first_block_limit_); | 7379 v->VisitPointers(blocks_.first(), first_block_limit_); |
| 7417 | 7380 |
| 7418 for (int i = 1; i < blocks_.length(); i++) { | 7381 for (int i = 1; i < blocks_.length(); i++) { |
| 7419 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7382 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
| 7420 } | 7383 } |
| 7421 } | 7384 } |
| 7422 | 7385 |
| 7423 | 7386 |
| 7424 } } // namespace v8::internal | 7387 } } // namespace v8::internal |
| OLD | NEW |