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

Unified Diff: src/ic/x64/ic-x64.cc

Issue 1351493002: Extra code to diagnose a crash bug. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code comments. Created 5 years, 3 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/ic/ppc/ic-ppc.cc ('k') | src/ic/x87/ic-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/x64/ic-x64.cc
diff --git a/src/ic/x64/ic-x64.cc b/src/ic/x64/ic-x64.cc
index ff74a965e43aaf67314a06419580ba35adc02afb..0d3d07298b9b2d607d65965ba5347ba1af32cef9 100644
--- a/src/ic/x64/ic-x64.cc
+++ b/src/ic/x64/ic-x64.cc
@@ -667,7 +667,7 @@ static void LoadIC_PushArgs(MacroAssembler* masm) {
}
-void LoadIC::GenerateMiss(MacroAssembler* masm) {
+void LoadIC::GenerateMiss(MacroAssembler* masm, int stress) {
// The return address is on the stack.
Counters* counters = masm->isolate()->counters();
@@ -675,6 +675,36 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
LoadIC_PushArgs(masm);
+ Register receiver = LoadDescriptor::ReceiverRegister();
+
+ // Sanity check: The receiver must be a JS-exposed kind of object,
+ // not something internal (like a Map, or FixedArray). Check this here
+ // to chase after a rare but recurring crash bug.
+ // TODO(jkummerow): Remove this when it has generated a few crash reports.
+
+ Label ok, sound_alarm;
+ __ JumpIfSmi(receiver, &ok, Label::kNear);
+ __ movp(rbx, FieldOperand(receiver, HeapObject::kMapOffset));
+ __ CompareRoot(rbx, Heap::kMetaMapRootIndex);
+ __ j(equal, &sound_alarm);
+ __ CompareRoot(rbx, Heap::kFixedArrayMapRootIndex);
+ __ j(not_equal, &ok, Label::kNear);
+
+ // This cmpp instruction is only here to identify which of several kinds
+ // of code blocks embedded the MISS code. (handler, dispatcher).
+ __ cmpp(receiver, Immediate(stress));
+
+ __ bind(&sound_alarm);
+ __ Push(Smi::FromInt(0xaabbccdd));
+ __ Push(receiver);
+ __ movp(rbx, FieldOperand(receiver, HeapObject::kMapOffset));
+ __ Push(rbx);
+ __ movp(rbx, FieldOperand(receiver, JSObject::kPropertiesOffset));
+ __ Push(rbx);
+ __ int3();
+
+ __ bind(&ok);
+
// Perform tail call to the entry.
int arg_count = 4;
__ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1);
« no previous file with comments | « src/ic/ppc/ic-ppc.cc ('k') | src/ic/x87/ic-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698