| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <ostream> | 5 #include <ostream> |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/compilation-dependencies.h" | 8 #include "src/compilation-dependencies.h" |
| 9 #include "src/compiler/access-info.h" | 9 #include "src/compiler/access-info.h" |
| 10 #include "src/field-index-inl.h" | 10 #include "src/field-index-inl.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 bool CanInlineElementAccess(Handle<Map> map) { | 21 bool CanInlineElementAccess(Handle<Map> map) { |
| 22 // TODO(bmeurer): IsJSObjectMap | 22 // TODO(bmeurer): IsJSObjectMap |
| 23 // TODO(bmeurer): !map->has_dictionary_elements() | 23 // TODO(bmeurer): !map->has_dictionary_elements() |
| 24 // TODO(bmeurer): !map->has_sloppy_arguments_elements() | 24 // TODO(bmeurer): !map->has_sloppy_arguments_elements() |
| 25 return map->IsJSArrayMap() && map->has_fast_elements() && | 25 return map->IsJSArrayMap() && map->has_fast_elements() && |
| 26 !map->has_indexed_interceptor() && !map->is_access_check_needed(); | 26 !map->has_indexed_interceptor() && !map->is_access_check_needed(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 | 29 |
| 30 bool CanInlinePropertyAccess(Handle<Map> map) { | 30 bool CanInlinePropertyAccess(Handle<Map> map) { |
| 31 // TODO(bmeurer): Add support for Number primitives. | 31 if (map->instance_type() == HEAP_NUMBER_TYPE) return true; |
| 32 // if (map->instance_type() == HEAP_NUMBER_TYPE) return false; | |
| 33 if (map->instance_type() < FIRST_NONSTRING_TYPE) return true; | 32 if (map->instance_type() < FIRST_NONSTRING_TYPE) return true; |
| 34 return map->IsJSObjectMap() && !map->is_dictionary_map() && | 33 return map->IsJSObjectMap() && !map->is_dictionary_map() && |
| 35 !map->has_named_interceptor() && | 34 !map->has_named_interceptor() && |
| 36 // TODO(verwaest): Whitelist contexts to which we have access. | 35 // TODO(verwaest): Whitelist contexts to which we have access. |
| 37 !map->is_access_check_needed(); | 36 !map->is_access_check_needed(); |
| 38 } | 37 } |
| 39 | 38 |
| 40 } // namespace | 39 } // namespace |
| 41 | 40 |
| 42 | 41 |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 } | 400 } |
| 402 return false; | 401 return false; |
| 403 } | 402 } |
| 404 | 403 |
| 405 | 404 |
| 406 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } | 405 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } |
| 407 | 406 |
| 408 } // namespace compiler | 407 } // namespace compiler |
| 409 } // namespace internal | 408 } // namespace internal |
| 410 } // namespace v8 | 409 } // namespace v8 |
| OLD | NEW |