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

Unified Diff: src/virtual-frame-ia32.cc

Issue 28065: Experimental: port the JS function check at function entry from ARM to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 11 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/virtual-frame-arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/virtual-frame-ia32.cc
===================================================================
--- src/virtual-frame-ia32.cc (revision 1343)
+++ src/virtual-frame-ia32.cc (working copy)
@@ -389,6 +389,20 @@
void VirtualFrame::Enter() {
// Registers live on entry: esp, ebp, esi, edi.
Comment cmnt(masm_, "[ Enter JS frame");
+
+#ifdef DEBUG
+ // Verify that edi contains a JS function. The following code
+ // relies on eax being available for use.
+ __ test(edi, Immediate(kSmiTagMask));
+ __ Check(not_zero,
+ "VirtualFrame::Enter - edi is not a function (smi check).");
+ __ mov(eax, FieldOperand(edi, HeapObject::kMapOffset));
+ __ movzx_b(eax, FieldOperand(eax, Map::kInstanceTypeOffset));
+ __ cmp(eax, JS_FUNCTION_TYPE);
+ __ Check(equal,
+ "VirtualFrame::Enter - edi is not a function (map check).");
+#endif
+
EmitPush(ebp);
frame_pointer_ = stack_pointer_;
« no previous file with comments | « src/virtual-frame-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698