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

Side by Side Diff: src/api.cc

Issue 8828: Work around issue 131 by checking for empty handles (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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/top.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 2007-2008 the V8 project authors. All rights reserved. 1 // Copyright 2007-2008 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 224
225 225
226 void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) { 226 void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
227 i::FlagList::SetFlagsFromCommandLine(argc, argv, remove_flags); 227 i::FlagList::SetFlagsFromCommandLine(argc, argv, remove_flags);
228 } 228 }
229 229
230 230
231 v8::Handle<Value> ThrowException(v8::Handle<v8::Value> value) { 231 v8::Handle<Value> ThrowException(v8::Handle<v8::Value> value) {
232 if (IsDeadCheck("v8::ThrowException()")) return v8::Handle<Value>(); 232 if (IsDeadCheck("v8::ThrowException()")) return v8::Handle<Value>();
233 i::Top::ScheduleThrow(*Utils::OpenHandle(*value)); 233 // If we're passed an empty handle, we throw an undefined exception
234 // to deal more gracefully with out of memory situations.
235 if (value.IsEmpty()) {
236 i::Top::ScheduleThrow(i::Heap::undefined_value());
237 } else {
238 i::Top::ScheduleThrow(*Utils::OpenHandle(*value));
239 }
234 return v8::Undefined(); 240 return v8::Undefined();
235 } 241 }
236 242
237 243
238 RegisteredExtension* RegisteredExtension::first_extension_ = NULL; 244 RegisteredExtension* RegisteredExtension::first_extension_ = NULL;
239 245
240 246
241 RegisteredExtension::RegisteredExtension(Extension* extension) 247 RegisteredExtension::RegisteredExtension(Extension* extension)
242 : extension_(extension), state_(UNVISITED) { } 248 : extension_(extension), state_(UNVISITED) { }
243 249
(...skipping 2713 matching lines...) Expand 10 before | Expand all | Expand 10 after
2957 reinterpret_cast<HandleScopeImplementer*>(storage); 2963 reinterpret_cast<HandleScopeImplementer*>(storage);
2958 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); 2964 List<void**>* blocks_of_archived_thread = thread_local->Blocks();
2959 ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = 2965 ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread =
2960 &thread_local->handle_scope_data_; 2966 &thread_local->handle_scope_data_;
2961 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); 2967 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread);
2962 2968
2963 return storage + ArchiveSpacePerThread(); 2969 return storage + ArchiveSpacePerThread();
2964 } 2970 }
2965 2971
2966 } } // namespace v8::internal 2972 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698