Reviewers: Kevin Millikin, Description: Add support for tracking down leak of the hole value.
Please review this at http://codereview.chromium.org/149522 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/api.h M src/ia32/codegen-ia32.cc Index: src/ia32/codegen-ia32.cc =================================================================== --- src/ia32/codegen-ia32.cc (revision 2430) +++ src/ia32/codegen-ia32.cc (working copy) @@ -7591,6 +7591,16 @@ __ 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(Operand(eax), Immediate(Factory::the_hole_value())); + __ j(not_equal, &okay); + __ int3(); + __ bind(&okay); + } + // Check for failure result. Label failure_returned; ASSERT(((kFailureTag + 1) & kFailureTagMask) == 0); Index: src/api.h =================================================================== --- src/api.h (revision 2430) +++ src/api.h (working copy) @@ -244,9 +244,10 @@ // 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) --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
