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

Side by Side Diff: src/api.cc

Issue 1862653002: Move MemoryAllocator and CodeRange into Heap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 8 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
« no previous file with comments | « no previous file | src/extensions/statistics-extension.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 // 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 7171 matching lines...) Expand 10 before | Expand all | Expand 10 after
7182 7182
7183 void Isolate::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) { 7183 void Isolate::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) {
7184 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7184 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7185 isolate->heap()->SetEmbedderHeapTracer(tracer); 7185 isolate->heap()->SetEmbedderHeapTracer(tracer);
7186 } 7186 }
7187 7187
7188 void Isolate::AddMemoryAllocationCallback(MemoryAllocationCallback callback, 7188 void Isolate::AddMemoryAllocationCallback(MemoryAllocationCallback callback,
7189 ObjectSpace space, 7189 ObjectSpace space,
7190 AllocationAction action) { 7190 AllocationAction action) {
7191 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7191 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7192 isolate->memory_allocator()->AddMemoryAllocationCallback( 7192 isolate->heap()->memory_allocator()->AddMemoryAllocationCallback(
7193 callback, space, action); 7193 callback, space, action);
7194 } 7194 }
7195 7195
7196 7196
7197 void Isolate::RemoveMemoryAllocationCallback( 7197 void Isolate::RemoveMemoryAllocationCallback(
7198 MemoryAllocationCallback callback) { 7198 MemoryAllocationCallback callback) {
7199 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7199 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7200 isolate->memory_allocator()->RemoveMemoryAllocationCallback( 7200 isolate->heap()->memory_allocator()->RemoveMemoryAllocationCallback(callback);
7201 callback);
7202 } 7201 }
7203 7202
7204 7203
7205 void Isolate::TerminateExecution() { 7204 void Isolate::TerminateExecution() {
7206 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7205 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7207 isolate->stack_guard()->RequestTerminateExecution(); 7206 isolate->stack_guard()->RequestTerminateExecution();
7208 } 7207 }
7209 7208
7210 7209
7211 bool Isolate::IsExecutionTerminating() { 7210 bool Isolate::IsExecutionTerminating() {
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
7686 7685
7687 void Isolate::SetStackLimit(uintptr_t stack_limit) { 7686 void Isolate::SetStackLimit(uintptr_t stack_limit) {
7688 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7687 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7689 CHECK(stack_limit); 7688 CHECK(stack_limit);
7690 isolate->stack_guard()->SetStackLimit(stack_limit); 7689 isolate->stack_guard()->SetStackLimit(stack_limit);
7691 } 7690 }
7692 7691
7693 7692
7694 void Isolate::GetCodeRange(void** start, size_t* length_in_bytes) { 7693 void Isolate::GetCodeRange(void** start, size_t* length_in_bytes) {
7695 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7694 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7696 if (isolate->code_range()->valid()) { 7695 if (isolate->heap()->memory_allocator()->code_range()->valid()) {
7697 *start = isolate->code_range()->start(); 7696 *start = isolate->heap()->memory_allocator()->code_range()->start();
7698 *length_in_bytes = isolate->code_range()->size(); 7697 *length_in_bytes =
7698 isolate->heap()->memory_allocator()->code_range()->size();
7699 } else { 7699 } else {
7700 *start = NULL; 7700 *start = NULL;
7701 *length_in_bytes = 0; 7701 *length_in_bytes = 0;
7702 } 7702 }
7703 } 7703 }
7704 7704
7705 7705
7706 void Isolate::SetFatalErrorHandler(FatalErrorCallback that) { 7706 void Isolate::SetFatalErrorHandler(FatalErrorCallback that) {
7707 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 7707 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
7708 isolate->set_exception_behavior(that); 7708 isolate->set_exception_behavior(that);
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
8782 Address callback_address = 8782 Address callback_address =
8783 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8783 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8784 VMState<EXTERNAL> state(isolate); 8784 VMState<EXTERNAL> state(isolate);
8785 ExternalCallbackScope call_scope(isolate, callback_address); 8785 ExternalCallbackScope call_scope(isolate, callback_address);
8786 callback(info); 8786 callback(info);
8787 } 8787 }
8788 8788
8789 8789
8790 } // namespace internal 8790 } // namespace internal
8791 } // namespace v8 8791 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/extensions/statistics-extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698