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 4989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5000 ArrayBuffer::Allocator* allocator) { | 5000 ArrayBuffer::Allocator* allocator) { |
5001 if (!ApiCheck(i::V8::ArrayBufferAllocator() == NULL, | 5001 if (!ApiCheck(i::V8::ArrayBufferAllocator() == NULL, |
5002 "v8::V8::SetArrayBufferAllocator", | 5002 "v8::V8::SetArrayBufferAllocator", |
5003 "ArrayBufferAllocator might only be set once")) | 5003 "ArrayBufferAllocator might only be set once")) |
5004 return; | 5004 return; |
5005 i::V8::SetArrayBufferAllocator(allocator); | 5005 i::V8::SetArrayBufferAllocator(allocator); |
5006 } | 5006 } |
5007 | 5007 |
5008 | 5008 |
5009 bool v8::V8::Dispose() { | 5009 bool v8::V8::Dispose() { |
5010 i::Isolate* isolate = i::Isolate::Current(); | 5010 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); |
5011 if (!ApiCheck(isolate != NULL && isolate->IsDefaultIsolate(), | 5011 if (!ApiCheck(isolate == NULL || isolate->IsDefaultIsolate(), |
5012 "v8::V8::Dispose()", | 5012 "v8::V8::Dispose()", |
5013 "Use v8::Isolate::Dispose() for a non-default isolate.")) { | 5013 "Use v8::Isolate::Dispose() for a non-default isolate.")) { |
5014 return false; | 5014 return false; |
5015 } | 5015 } |
5016 i::V8::TearDown(); | 5016 return i::V8::TearDown(); |
5017 return true; | |
5018 } | 5017 } |
5019 | 5018 |
5020 | 5019 |
5021 HeapStatistics::HeapStatistics(): total_heap_size_(0), | 5020 HeapStatistics::HeapStatistics(): total_heap_size_(0), |
5022 total_heap_size_executable_(0), | 5021 total_heap_size_executable_(0), |
5023 total_physical_size_(0), | 5022 total_physical_size_(0), |
5024 used_heap_size_(0), | 5023 used_heap_size_(0), |
5025 heap_size_limit_(0) { } | 5024 heap_size_limit_(0) { } |
5026 | 5025 |
5027 | 5026 |
(...skipping 2500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7528 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7527 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7529 Address callback_address = | 7528 Address callback_address = |
7530 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7529 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7531 VMState<EXTERNAL> state(isolate); | 7530 VMState<EXTERNAL> state(isolate); |
7532 ExternalCallbackScope call_scope(isolate, callback_address); | 7531 ExternalCallbackScope call_scope(isolate, callback_address); |
7533 callback(info); | 7532 callback(info); |
7534 } | 7533 } |
7535 | 7534 |
7536 | 7535 |
7537 } } // namespace v8::internal | 7536 } } // namespace v8::internal |
OLD | NEW |