Add support for tracking down leak of the hole value.

Review URL: http://codereview.chromium.org/149522

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2432 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
kasperl@chromium.org 2009-07-13 09:17:04 +00:00
parent e0c01db960
commit 55a8088bd8
2 changed files with 13 additions and 2 deletions

View File

@ -244,9 +244,10 @@ v8::internal::Handle<T> v8::internal::Handle<T>::EscapeFrom(
// Implementations of ToLocal // Implementations of ToLocal
#define MAKE_TO_LOCAL(Name, From, To) \ #define MAKE_TO_LOCAL(Name, From, To) \
Local<v8::To> Utils::Name(v8::internal::Handle<v8::internal::From> obj) { \ Local<v8::To> Utils::Name(v8::internal::Handle<v8::internal::From> obj) { \
return Local<To>(reinterpret_cast<To*>(obj.location())); \ ASSERT(!obj->IsTheHole()); \
return Local<To>(reinterpret_cast<To*>(obj.location())); \
} }
MAKE_TO_LOCAL(ToLocal, Context, Context) MAKE_TO_LOCAL(ToLocal, Context, Context)

View File

@ -7591,6 +7591,16 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
__ dec(Operand::StaticVariable(scope_depth)); __ dec(Operand::StaticVariable(scope_depth));
} }
// Make sure we're not trying to return 'the hole' from the runtime
// call as this may lead to crashes in the IC code later.
if (FLAG_debug_code) {
Label okay;
__ cmp(eax, Factory::the_hole_value());
__ j(not_equal, &okay);
__ int3();
__ bind(&okay);
}
// Check for failure result. // Check for failure result.
Label failure_returned; Label failure_returned;
ASSERT(((kFailureTag + 1) & kFailureTagMask) == 0); ASSERT(((kFailureTag + 1) & kFailureTagMask) == 0);