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

Side by Side Diff: src/api.cc

Issue 12790004: Made AdjustAmountOfExternalAllocatedMemory an instance method of Isolate (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Feedback Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/d8.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5765 matching lines...) Expand 10 before | Expand all | Expand 10 after
5776 size_t length) { 5776 size_t length) {
5777 i::Isolate* isolate = i::Isolate::Current(); 5777 i::Isolate* isolate = i::Isolate::Current();
5778 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return; 5778 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return;
5779 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); 5779 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**));
5780 isolate->global_handles()->AddImplicitReferences( 5780 isolate->global_handles()->AddImplicitReferences(
5781 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(), 5781 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(),
5782 reinterpret_cast<i::Object***>(children), length); 5782 reinterpret_cast<i::Object***>(children), length);
5783 } 5783 }
5784 5784
5785 5785
5786 intptr_t Isolate::AdjustAmountOfExternalAllocatedMemory(
5787 intptr_t change_in_bytes) {
5788 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
5789 return heap->AdjustAmountOfExternalAllocatedMemory(change_in_bytes);
5790 }
5791
5792
5786 intptr_t V8::AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes) { 5793 intptr_t V8::AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes) {
5787 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 5794 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
5788 if (isolate == NULL || !isolate->IsInitialized() || 5795 if (isolate == NULL || !isolate->IsInitialized() ||
5789 IsDeadCheck(isolate, "v8::V8::AdjustAmountOfExternalAllocatedMemory()")) { 5796 IsDeadCheck(isolate, "v8::V8::AdjustAmountOfExternalAllocatedMemory()")) {
5790 return 0; 5797 return 0;
5791 } 5798 }
5792 return isolate->heap()->AdjustAmountOfExternalAllocatedMemory( 5799 Isolate* isolate_ext = reinterpret_cast<Isolate*>(isolate);
5793 change_in_bytes); 5800 return isolate_ext->AdjustAmountOfExternalAllocatedMemory(change_in_bytes);
5794 } 5801 }
5795 5802
5796 5803
5797 void V8::SetGlobalGCPrologueCallback(GCCallback callback) { 5804 void V8::SetGlobalGCPrologueCallback(GCCallback callback) {
5798 i::Isolate* isolate = i::Isolate::Current(); 5805 i::Isolate* isolate = i::Isolate::Current();
5799 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return; 5806 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return;
5800 isolate->heap()->SetGlobalGCPrologueCallback(callback); 5807 isolate->heap()->SetGlobalGCPrologueCallback(callback);
5801 } 5808 }
5802 5809
5803 5810
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after
7064 7071
7065 v->VisitPointers(blocks_.first(), first_block_limit_); 7072 v->VisitPointers(blocks_.first(), first_block_limit_);
7066 7073
7067 for (int i = 1; i < blocks_.length(); i++) { 7074 for (int i = 1; i < blocks_.length(); i++) {
7068 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 7075 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
7069 } 7076 }
7070 } 7077 }
7071 7078
7072 7079
7073 } } // namespace v8::internal 7080 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698