Index: src/x87/code-stubs-x87.cc |
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc |
index 2cd2e7ba46ff19bbdb4847317a09d91f4495895d..e0c8f3d7b5a1f9961391fb3ee5bfef6ff93a7e89 100644 |
--- a/src/x87/code-stubs-x87.cc |
+++ b/src/x87/code-stubs-x87.cc |
@@ -2186,6 +2186,16 @@ |
__ call(ebx); |
// Result is in eax or edx:eax - do not destroy these registers! |
+ // Runtime functions should not return 'the hole'. Allowing it to escape may |
+ // lead to crashes in the IC code later. |
+ if (FLAG_debug_code) { |
+ Label okay; |
+ __ cmp(eax, isolate()->factory()->the_hole_value()); |
+ __ j(not_equal, &okay, Label::kNear); |
+ __ int3(); |
+ __ bind(&okay); |
+ } |
+ |
// Check result for exception sentinel. |
Label exception_returned; |
__ cmp(eax, isolate()->factory()->exception()); |