| OLD | NEW |
| 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 "api.h" | 5 #include "api.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
| 8 #include <cmath> // For isnan. | 8 #include <cmath> // For isnan. |
| 9 #include "../include/v8-debug.h" | 9 #include "../include/v8-debug.h" |
| 10 #include "../include/v8-profiler.h" | 10 #include "../include/v8-profiler.h" |
| (...skipping 4940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4951 ArrayBuffer::Allocator* allocator) { | 4951 ArrayBuffer::Allocator* allocator) { |
| 4952 if (!Utils::ApiCheck(i::V8::ArrayBufferAllocator() == NULL, | 4952 if (!Utils::ApiCheck(i::V8::ArrayBufferAllocator() == NULL, |
| 4953 "v8::V8::SetArrayBufferAllocator", | 4953 "v8::V8::SetArrayBufferAllocator", |
| 4954 "ArrayBufferAllocator might only be set once")) | 4954 "ArrayBufferAllocator might only be set once")) |
| 4955 return; | 4955 return; |
| 4956 i::V8::SetArrayBufferAllocator(allocator); | 4956 i::V8::SetArrayBufferAllocator(allocator); |
| 4957 } | 4957 } |
| 4958 | 4958 |
| 4959 | 4959 |
| 4960 bool v8::V8::Dispose() { | 4960 bool v8::V8::Dispose() { |
| 4961 i::Isolate* isolate = i::Isolate::Current(); | |
| 4962 if (!Utils::ApiCheck(isolate != NULL && isolate->IsDefaultIsolate(), | |
| 4963 "v8::V8::Dispose()", | |
| 4964 "Use v8::Isolate::Dispose() for non-default isolate.")) { | |
| 4965 return false; | |
| 4966 } | |
| 4967 i::V8::TearDown(); | 4961 i::V8::TearDown(); |
| 4968 return true; | 4962 return true; |
| 4969 } | 4963 } |
| 4970 | 4964 |
| 4971 | 4965 |
| 4972 HeapStatistics::HeapStatistics(): total_heap_size_(0), | 4966 HeapStatistics::HeapStatistics(): total_heap_size_(0), |
| 4973 total_heap_size_executable_(0), | 4967 total_heap_size_executable_(0), |
| 4974 total_physical_size_(0), | 4968 total_physical_size_(0), |
| 4975 used_heap_size_(0), | 4969 used_heap_size_(0), |
| 4976 heap_size_limit_(0) { } | 4970 heap_size_limit_(0) { } |
| (...skipping 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7594 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7588 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7595 Address callback_address = | 7589 Address callback_address = |
| 7596 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7590 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7597 VMState<EXTERNAL> state(isolate); | 7591 VMState<EXTERNAL> state(isolate); |
| 7598 ExternalCallbackScope call_scope(isolate, callback_address); | 7592 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7599 callback(info); | 7593 callback(info); |
| 7600 } | 7594 } |
| 7601 | 7595 |
| 7602 | 7596 |
| 7603 } } // namespace v8::internal | 7597 } } // namespace v8::internal |
| OLD | NEW |