OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |