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

Side by Side Diff: src/api.cc

Issue 24999002: lazy instantiation of the default isolate (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | « no previous file | src/isolate.h » ('j') | src/isolate.h » ('J')
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 5012 matching lines...) Expand 10 before | Expand all | Expand 10 after
5023 ArrayBuffer::Allocator* allocator) { 5023 ArrayBuffer::Allocator* allocator) {
5024 if (!ApiCheck(i::V8::ArrayBufferAllocator() == NULL, 5024 if (!ApiCheck(i::V8::ArrayBufferAllocator() == NULL,
5025 "v8::V8::SetArrayBufferAllocator", 5025 "v8::V8::SetArrayBufferAllocator",
5026 "ArrayBufferAllocator might only be set once")) 5026 "ArrayBufferAllocator might only be set once"))
5027 return; 5027 return;
5028 i::V8::SetArrayBufferAllocator(allocator); 5028 i::V8::SetArrayBufferAllocator(allocator);
5029 } 5029 }
5030 5030
5031 5031
5032 bool v8::V8::Dispose() { 5032 bool v8::V8::Dispose() {
5033 i::Isolate* isolate = i::Isolate::Current(); 5033 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
5034 if (!ApiCheck(isolate != NULL && isolate->IsDefaultIsolate(), 5034 if (!ApiCheck(isolate == NULL || isolate->IsDefaultIsolate(),
5035 "v8::V8::Dispose()", 5035 "v8::V8::Dispose()",
5036 "Use v8::Isolate::Dispose() for a non-default isolate.")) { 5036 "Use v8::Isolate::Dispose() for a non-default isolate.")) {
5037 return false; 5037 return false;
5038 } 5038 }
5039 i::V8::TearDown(); 5039 return i::V8::TearDown();
5040 return true;
5041 } 5040 }
5042 5041
5043 5042
5044 HeapStatistics::HeapStatistics(): total_heap_size_(0), 5043 HeapStatistics::HeapStatistics(): total_heap_size_(0),
5045 total_heap_size_executable_(0), 5044 total_heap_size_executable_(0),
5046 total_physical_size_(0), 5045 total_physical_size_(0),
5047 used_heap_size_(0), 5046 used_heap_size_(0),
5048 heap_size_limit_(0) { } 5047 heap_size_limit_(0) { }
5049 5048
5050 5049
(...skipping 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after
7575 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7574 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7576 Address callback_address = 7575 Address callback_address =
7577 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7576 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7578 VMState<EXTERNAL> state(isolate); 7577 VMState<EXTERNAL> state(isolate);
7579 ExternalCallbackScope call_scope(isolate, callback_address); 7578 ExternalCallbackScope call_scope(isolate, callback_address);
7580 callback(info); 7579 callback(info);
7581 } 7580 }
7582 7581
7583 7582
7584 } } // namespace v8::internal 7583 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/isolate.h » ('j') | src/isolate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698