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

Side by Side Diff: src/api.cc

Issue 238353015: Simplify v8/Isolate teardown. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Tiny serializer fix after recent changes. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « samples/shell.cc ('k') | src/d8.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 // 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 4977 matching lines...) Expand 10 before | Expand all | Expand 10 after
4988 ArrayBuffer::Allocator* allocator) { 4988 ArrayBuffer::Allocator* allocator) {
4989 if (!Utils::ApiCheck(i::V8::ArrayBufferAllocator() == NULL, 4989 if (!Utils::ApiCheck(i::V8::ArrayBufferAllocator() == NULL,
4990 "v8::V8::SetArrayBufferAllocator", 4990 "v8::V8::SetArrayBufferAllocator",
4991 "ArrayBufferAllocator might only be set once")) 4991 "ArrayBufferAllocator might only be set once"))
4992 return; 4992 return;
4993 i::V8::SetArrayBufferAllocator(allocator); 4993 i::V8::SetArrayBufferAllocator(allocator);
4994 } 4994 }
4995 4995
4996 4996
4997 bool v8::V8::Dispose() { 4997 bool v8::V8::Dispose() {
4998 i::Isolate* isolate = i::Isolate::Current();
4999 if (!Utils::ApiCheck(isolate != NULL && isolate->IsDefaultIsolate(),
5000 "v8::V8::Dispose()",
5001 "Use v8::Isolate::Dispose() for non-default isolate.")) {
5002 return false;
5003 }
5004 i::V8::TearDown(); 4998 i::V8::TearDown();
5005 return true; 4999 return true;
5006 } 5000 }
5007 5001
5008 5002
5009 HeapStatistics::HeapStatistics(): total_heap_size_(0), 5003 HeapStatistics::HeapStatistics(): total_heap_size_(0),
5010 total_heap_size_executable_(0), 5004 total_heap_size_executable_(0),
5011 total_physical_size_(0), 5005 total_physical_size_(0),
5012 used_heap_size_(0), 5006 used_heap_size_(0),
5013 heap_size_limit_(0) { } 5007 heap_size_limit_(0) { }
(...skipping 2599 matching lines...) Expand 10 before | Expand all | Expand 10 after
7613 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7607 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7614 Address callback_address = 7608 Address callback_address =
7615 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7609 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7616 VMState<EXTERNAL> state(isolate); 7610 VMState<EXTERNAL> state(isolate);
7617 ExternalCallbackScope call_scope(isolate, callback_address); 7611 ExternalCallbackScope call_scope(isolate, callback_address);
7618 callback(info); 7612 callback(info);
7619 } 7613 }
7620 7614
7621 7615
7622 } } // namespace v8::internal 7616 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « samples/shell.cc ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698