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

Side by Side Diff: src/hydrogen.cc

Issue 1348823003: [hydrogen] Add crash-hunting instrumentation to Hydrogen too (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add missing heap object check 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 unified diff | Download patch
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/allocation-site-scopes.h" 9 #include "src/allocation-site-scopes.h"
10 #include "src/ast-numbering.h" 10 #include "src/ast-numbering.h"
(...skipping 9602 matching lines...) Expand 10 before | Expand all | Expand 10 after
9613 if (!top_info()->is_tracking_positions()) SetSourcePosition(expr->position()); 9613 if (!top_info()->is_tracking_positions()) SetSourcePosition(expr->position());
9614 Expression* callee = expr->expression(); 9614 Expression* callee = expr->expression();
9615 int argument_count = expr->arguments()->length() + 1; // Plus receiver. 9615 int argument_count = expr->arguments()->length() + 1; // Plus receiver.
9616 HInstruction* call = NULL; 9616 HInstruction* call = NULL;
9617 9617
9618 Property* prop = callee->AsProperty(); 9618 Property* prop = callee->AsProperty();
9619 if (prop != NULL) { 9619 if (prop != NULL) {
9620 CHECK_ALIVE(VisitForValue(prop->obj())); 9620 CHECK_ALIVE(VisitForValue(prop->obj()));
9621 HValue* receiver = Top(); 9621 HValue* receiver = Top();
9622 9622
9623 // Sanity check: The receiver must be a JS-exposed kind of object,
9624 // not something internal (like a Map, or FixedArray). Check this here
9625 // to chase after a rare but recurring crash bug. It seems to always
9626 // occur for functions beginning with "this.foo.bar()", so be selective
9627 // and only insert the check for the first call (identified by slot).
9628 // TODO(chromium:527994): Remove this when we have a few crash reports.
9629 if (prop->key()->IsPropertyName() &&
9630 prop->PropertyFeedbackSlot().ToInt() == 2) {
9631 IfBuilder if_heapobject(this);
9632 if_heapobject.IfNot<HIsSmiAndBranch>(receiver);
9633 if_heapobject.Then();
9634 {
9635 IfBuilder special_map(this);
9636 Factory* factory = isolate()->factory();
9637 special_map.If<HCompareMap>(receiver, factory->fixed_array_map());
9638 special_map.OrIf<HCompareMap>(receiver, factory->meta_map());
9639 special_map.Then();
9640 Add<HDebugBreak>();
9641 special_map.End();
9642 }
9643 if_heapobject.End();
9644 }
9645
9623 SmallMapList* maps; 9646 SmallMapList* maps;
9624 ComputeReceiverTypes(expr, receiver, &maps, zone()); 9647 ComputeReceiverTypes(expr, receiver, &maps, zone());
9625 9648
9626 if (prop->key()->IsPropertyName() && maps->length() > 0) { 9649 if (prop->key()->IsPropertyName() && maps->length() > 0) {
9627 Handle<String> name = prop->key()->AsLiteral()->AsPropertyName(); 9650 Handle<String> name = prop->key()->AsLiteral()->AsPropertyName();
9628 PropertyAccessInfo info(this, LOAD, maps->first(), name); 9651 PropertyAccessInfo info(this, LOAD, maps->first(), name);
9629 if (!info.CanAccessAsMonomorphic(maps)) { 9652 if (!info.CanAccessAsMonomorphic(maps)) {
9630 HandlePolymorphicCallNamed(expr, receiver, maps, name); 9653 HandlePolymorphicCallNamed(expr, receiver, maps, name);
9631 return; 9654 return;
9632 } 9655 }
(...skipping 3901 matching lines...) Expand 10 before | Expand all | Expand 10 after
13534 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13557 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13535 } 13558 }
13536 13559
13537 #ifdef DEBUG 13560 #ifdef DEBUG
13538 graph_->Verify(false); // No full verify. 13561 graph_->Verify(false); // No full verify.
13539 #endif 13562 #endif
13540 } 13563 }
13541 13564
13542 } // namespace internal 13565 } // namespace internal
13543 } // namespace v8 13566 } // namespace v8
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698