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

Unified Diff: src/builtins.cc

Issue 15993012: Allocation type info advice consumed in bailout path leads to assert failure. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « no previous file | test/mjsunit/allocation-site-info.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 37ba1e5301a9e17a9e5f4f026e0ad902bb03fd9d..8a4ae71ff0a229daa97dfed558eb1da94716328f 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -209,15 +209,25 @@ RUNTIME_FUNCTION(MaybeObject*, ArrayConstructor_StubFailure) {
Handle<Object> type_info = args.at<Object>(parameters_start + 1);
bool holey = false;
- if (caller_args->length() == 1 && (*caller_args)[0]->IsSmi()) {
- int value = Smi::cast((*caller_args)[0])->value();
- holey = (value > 0 && value < JSObject::kInitialMaxFastElementArray);
+ bool ignore_advice = false;
danno 2013/06/04 16:29:47 ignore_type_feedback is probably more accurate.
mvstanton 2013/06/05 08:47:07 Done.
+ if (caller_args->length() == 1) {
+ Object* argument_one = (*caller_args)[0];
+ if (argument_one->IsSmi()) {
+ int value = Smi::cast(argument_one)->value();
+ holey = (value > 0 && value < JSObject::kInitialMaxFastElementArray);
danno 2013/06/04 16:29:47 Don't you mean >= 0? Or is the distinction importa
mvstanton 2013/06/05 08:47:07 I think it's important because if someone calls ne
+ }
+
+ // If we have a single argument, and we failed to set holey above,
+ // then we'll be forced down the dictionary path. In this case it's
+ // useless to consume allocation site info advice, even if we have it.
+ ignore_advice = !holey;
}
JSArray* array;
MaybeObject* maybe_array;
if (*type_info != isolate->heap()->undefined_value() &&
- JSGlobalPropertyCell::cast(*type_info)->value()->IsSmi()) {
+ JSGlobalPropertyCell::cast(*type_info)->value()->IsSmi() &&
+ !ignore_advice) {
JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(*type_info);
Smi* smi = Smi::cast(cell->value());
ElementsKind to_kind = static_cast<ElementsKind>(smi->value());
« no previous file with comments | « no previous file | test/mjsunit/allocation-site-info.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698