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

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: 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
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 2595 matching lines...) Expand 10 before | Expand all | Expand 10 after
7609 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7603 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7610 Address callback_address = 7604 Address callback_address =
7611 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7605 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7612 VMState<EXTERNAL> state(isolate); 7606 VMState<EXTERNAL> state(isolate);
7613 ExternalCallbackScope call_scope(isolate, callback_address); 7607 ExternalCallbackScope call_scope(isolate, callback_address);
7614 callback(info); 7608 callback(info);
7615 } 7609 }
7616 7610
7617 7611
7618 } } // namespace v8::internal 7612 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « samples/shell.cc ('k') | src/arm/assembler-arm.cc » ('j') | src/arm/assembler-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698