Commit 55a8088b authored by kasperl@chromium.org's avatar kasperl@chromium.org

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
parent e0c01db9
......@@ -244,9 +244,10 @@ v8::internal::Handle<T> v8::internal::Handle<T>::EscapeFrom(
// 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) { \
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)
......
......@@ -7591,6 +7591,16 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
__ 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.
Label failure_returned;
ASSERT(((kFailureTag + 1) & kFailureTagMask) == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment