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

Side by Side Diff: src/crankshaft/hydrogen.cc

Issue 1584303002: [crankshaft] Don't inline array indexOf operations if receiver's proto is not a JSObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | test/mjsunit/regress/regress-crbug-577112.js » ('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/crankshaft/hydrogen.h" 5 #include "src/crankshaft/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/ast-numbering.h" 10 #include "src/ast/ast-numbering.h"
(...skipping 9040 matching lines...) Expand 10 before | Expand all | Expand 10 after
9051 result = ast_context()->IsEffect() ? graph()->GetConstant0() : Top(); 9051 result = ast_context()->IsEffect() ? graph()->GetConstant0() : Top();
9052 Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE); 9052 Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE);
9053 if (!ast_context()->IsEffect()) Drop(1); 9053 if (!ast_context()->IsEffect()) Drop(1);
9054 ast_context()->ReturnValue(result); 9054 ast_context()->ReturnValue(result);
9055 return true; 9055 return true;
9056 } 9056 }
9057 case kArrayIndexOf: 9057 case kArrayIndexOf:
9058 case kArrayLastIndexOf: { 9058 case kArrayLastIndexOf: {
9059 if (receiver_map.is_null()) return false; 9059 if (receiver_map.is_null()) return false;
9060 if (receiver_map->instance_type() != JS_ARRAY_TYPE) return false; 9060 if (receiver_map->instance_type() != JS_ARRAY_TYPE) return false;
9061 if (!receiver_map->prototype()->IsJSObject()) return false;
9061 ElementsKind kind = receiver_map->elements_kind(); 9062 ElementsKind kind = receiver_map->elements_kind();
9062 if (!IsFastElementsKind(kind)) return false; 9063 if (!IsFastElementsKind(kind)) return false;
9063 if (receiver_map->is_observed()) return false; 9064 if (receiver_map->is_observed()) return false;
9064 if (argument_count != 2) return false; 9065 if (argument_count != 2) return false;
9065 if (!receiver_map->is_extensible()) return false; 9066 if (!receiver_map->is_extensible()) return false;
9066 9067
9067 // If there may be elements accessors in the prototype chain, the fast 9068 // If there may be elements accessors in the prototype chain, the fast
9068 // inlined version can't be used. 9069 // inlined version can't be used.
9069 if (receiver_map->DictionaryElementsInPrototypeChainOnly()) return false; 9070 if (receiver_map->DictionaryElementsInPrototypeChainOnly()) return false;
9070 9071
(...skipping 4530 matching lines...) Expand 10 before | Expand all | Expand 10 after
13601 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13602 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13602 } 13603 }
13603 13604
13604 #ifdef DEBUG 13605 #ifdef DEBUG
13605 graph_->Verify(false); // No full verify. 13606 graph_->Verify(false); // No full verify.
13606 #endif 13607 #endif
13607 } 13608 }
13608 13609
13609 } // namespace internal 13610 } // namespace internal
13610 } // namespace v8 13611 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-577112.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698