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

Side by Side Diff: src/global-handles.cc

Issue 14139033: Clean up VMState a little bit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed mistake Created 7 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 | « src/flag-definitions.h ('k') | src/handles.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 v8::Persistent<v8::Object> object = ToApi<v8::Object>(handle()); 261 v8::Persistent<v8::Object> object = ToApi<v8::Object>(handle());
262 { 262 {
263 // Check that we are not passing a finalized external string to 263 // Check that we are not passing a finalized external string to
264 // the callback. 264 // the callback.
265 ASSERT(!object_->IsExternalAsciiString() || 265 ASSERT(!object_->IsExternalAsciiString() ||
266 ExternalAsciiString::cast(object_)->resource() != NULL); 266 ExternalAsciiString::cast(object_)->resource() != NULL);
267 ASSERT(!object_->IsExternalTwoByteString() || 267 ASSERT(!object_->IsExternalTwoByteString() ||
268 ExternalTwoByteString::cast(object_)->resource() != NULL); 268 ExternalTwoByteString::cast(object_)->resource() != NULL);
269 // Leaving V8. 269 // Leaving V8.
270 VMState state(isolate, EXTERNAL); 270 VMState<EXTERNAL> state(isolate);
271 if (near_death_callback_ != NULL) { 271 if (near_death_callback_ != NULL) {
272 if (IsWeakCallback::decode(flags_)) { 272 if (IsWeakCallback::decode(flags_)) {
273 WeakReferenceCallback callback = 273 WeakReferenceCallback callback =
274 reinterpret_cast<WeakReferenceCallback>(near_death_callback_); 274 reinterpret_cast<WeakReferenceCallback>(near_death_callback_);
275 callback(object, par); 275 callback(object, par);
276 } else { 276 } else {
277 near_death_callback_(reinterpret_cast<v8::Isolate*>(isolate), 277 near_death_callback_(reinterpret_cast<v8::Isolate*>(isolate),
278 object, 278 object,
279 par); 279 par);
280 } 280 }
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 implicit_ref_groups_.Clear(); 857 implicit_ref_groups_.Clear();
858 } 858 }
859 859
860 860
861 void GlobalHandles::TearDown() { 861 void GlobalHandles::TearDown() {
862 // TODO(1428): invoke weak callbacks. 862 // TODO(1428): invoke weak callbacks.
863 } 863 }
864 864
865 865
866 } } // namespace v8::internal 866 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698