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

Side by Side Diff: src/api.cc

Issue 348001: Add a check to make sure we never mis-report being in context while creating ... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 11 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 | no next file » | 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 2736 matching lines...) Expand 10 before | Expand all | Expand 10 after
2747 } 2747 }
2748 2748
2749 2749
2750 bool Context::HasOutOfMemoryException() { 2750 bool Context::HasOutOfMemoryException() {
2751 i::Handle<i::Context> env = Utils::OpenHandle(this); 2751 i::Handle<i::Context> env = Utils::OpenHandle(this);
2752 return env->has_out_of_memory(); 2752 return env->has_out_of_memory();
2753 } 2753 }
2754 2754
2755 2755
2756 bool Context::InContext() { 2756 bool Context::InContext() {
2757 return i::Top::context() != NULL; 2757 return !i::Bootstrapper::IsActive() && i::Top::context() != NULL;
2758 } 2758 }
2759 2759
2760 2760
2761 v8::Local<v8::Context> Context::GetEntered() { 2761 v8::Local<v8::Context> Context::GetEntered() {
2762 if (IsDeadCheck("v8::Context::GetEntered()")) return Local<Context>(); 2762 if (IsDeadCheck("v8::Context::GetEntered()")) return Local<Context>();
2763 i::Handle<i::Object> last = thread_local.LastEnteredContext(); 2763 i::Handle<i::Object> last = thread_local.LastEnteredContext();
2764 if (last.is_null()) return Local<Context>(); 2764 if (last.is_null()) return Local<Context>();
2765 i::Handle<i::Context> context = i::Handle<i::Context>::cast(last); 2765 i::Handle<i::Context> context = i::Handle<i::Context>::cast(last);
2766 return Utils::ToLocal(context); 2766 return Utils::ToLocal(context);
2767 } 2767 }
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
3792 3792
3793 3793
3794 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3794 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3795 HandleScopeImplementer* thread_local = 3795 HandleScopeImplementer* thread_local =
3796 reinterpret_cast<HandleScopeImplementer*>(storage); 3796 reinterpret_cast<HandleScopeImplementer*>(storage);
3797 thread_local->IterateThis(v); 3797 thread_local->IterateThis(v);
3798 return storage + ArchiveSpacePerThread(); 3798 return storage + ArchiveSpacePerThread();
3799 } 3799 }
3800 3800
3801 } } // namespace v8::internal 3801 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698