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

Side by Side Diff: src/api.cc

Issue 310393003: Move most of the implementation of AdjustAmountOfExternalMemory to v8.h (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 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/flag-definitions.h » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 6303 matching lines...) Expand 10 before | Expand all | Expand 10 after
6314 SetAddHistogramSampleFunction(callback); 6314 SetAddHistogramSampleFunction(callback);
6315 } 6315 }
6316 6316
6317 void V8::SetFailedAccessCheckCallbackFunction( 6317 void V8::SetFailedAccessCheckCallbackFunction(
6318 FailedAccessCheckCallback callback) { 6318 FailedAccessCheckCallback callback) {
6319 i::Isolate* isolate = i::Isolate::Current(); 6319 i::Isolate* isolate = i::Isolate::Current();
6320 isolate->SetFailedAccessCheckCallback(callback); 6320 isolate->SetFailedAccessCheckCallback(callback);
6321 } 6321 }
6322 6322
6323 6323
6324 int64_t Isolate::AdjustAmountOfExternalAllocatedMemory( 6324 void Isolate::CollectAllGarbage(const char* gc_reason) {
6325 int64_t change_in_bytes) { 6325 reinterpret_cast<i::Isolate*>(this)->heap()->CollectAllGarbage(
6326 i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap(); 6326 i::Heap::kNoGCFlags, gc_reason);
6327 return heap->AdjustAmountOfExternalAllocatedMemory(change_in_bytes);
6328 } 6327 }
6329 6328
6330 6329
6331 HeapProfiler* Isolate::GetHeapProfiler() { 6330 HeapProfiler* Isolate::GetHeapProfiler() {
6332 i::HeapProfiler* heap_profiler = 6331 i::HeapProfiler* heap_profiler =
6333 reinterpret_cast<i::Isolate*>(this)->heap_profiler(); 6332 reinterpret_cast<i::Isolate*>(this)->heap_profiler();
6334 return reinterpret_cast<HeapProfiler*>(heap_profiler); 6333 return reinterpret_cast<HeapProfiler*>(heap_profiler);
6335 } 6334 }
6336 6335
6337 6336
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
7593 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7592 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7594 Address callback_address = 7593 Address callback_address =
7595 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7594 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7596 VMState<EXTERNAL> state(isolate); 7595 VMState<EXTERNAL> state(isolate);
7597 ExternalCallbackScope call_scope(isolate, callback_address); 7596 ExternalCallbackScope call_scope(isolate, callback_address);
7598 callback(info); 7597 callback(info);
7599 } 7598 }
7600 7599
7601 7600
7602 } } // namespace v8::internal 7601 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698