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/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 5429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5440 expr->pattern(), | 5440 expr->pattern(), |
5441 expr->flags(), | 5441 expr->flags(), |
5442 expr->literal_index()); | 5442 expr->literal_index()); |
5443 return ast_context()->ReturnInstruction(instr, expr->id()); | 5443 return ast_context()->ReturnInstruction(instr, expr->id()); |
5444 } | 5444 } |
5445 | 5445 |
5446 | 5446 |
5447 static bool CanInlinePropertyAccess(Handle<Map> map) { | 5447 static bool CanInlinePropertyAccess(Handle<Map> map) { |
5448 if (map->instance_type() == HEAP_NUMBER_TYPE) return true; | 5448 if (map->instance_type() == HEAP_NUMBER_TYPE) return true; |
5449 if (map->instance_type() < FIRST_NONSTRING_TYPE) return true; | 5449 if (map->instance_type() < FIRST_NONSTRING_TYPE) return true; |
5450 if (map->instance_type() == JS_PROXY_TYPE) return false; | |
rossberg
2015/04/16 10:54:13
This isn't actually needed, I assume.
| |
5450 return map->IsJSObjectMap() && !map->is_dictionary_map() && | 5451 return map->IsJSObjectMap() && !map->is_dictionary_map() && |
5451 !map->has_named_interceptor() && | 5452 !map->has_named_interceptor() && |
5452 // TODO(verwaest): Whitelist contexts to which we have access. | 5453 // TODO(verwaest): Whitelist contexts to which we have access. |
5453 !map->is_access_check_needed(); | 5454 !map->is_access_check_needed(); |
5454 } | 5455 } |
5455 | 5456 |
5456 | 5457 |
5457 // Determines whether the given array or object literal boilerplate satisfies | 5458 // Determines whether the given array or object literal boilerplate satisfies |
5458 // all limits to be considered for fast deep-copying and computes the total | 5459 // all limits to be considered for fast deep-copying and computes the total |
5459 // size of all objects that are part of the graph. | 5460 // size of all objects that are part of the graph. |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6062 JSObject::TryMigrateInstance(holder_); | 6063 JSObject::TryMigrateInstance(holder_); |
6063 } | 6064 } |
6064 map = Handle<Map>(holder_->map()); | 6065 map = Handle<Map>(holder_->map()); |
6065 if (!CanInlinePropertyAccess(map)) { | 6066 if (!CanInlinePropertyAccess(map)) { |
6066 NotFound(); | 6067 NotFound(); |
6067 return false; | 6068 return false; |
6068 } | 6069 } |
6069 LookupDescriptor(*map, *name_); | 6070 LookupDescriptor(*map, *name_); |
6070 if (IsFound()) return LoadResult(map); | 6071 if (IsFound()) return LoadResult(map); |
6071 } | 6072 } |
6073 | |
6074 if (map->IsJSReceiverMap()) { | |
rossberg
2015/04/16 10:54:13
You may want to set NotFound in this case as well
| |
6075 return false; | |
6076 } | |
6072 NotFound(); | 6077 NotFound(); |
6073 return true; | 6078 return true; |
6074 } | 6079 } |
6075 | 6080 |
6076 | 6081 |
6077 bool HOptimizedGraphBuilder::PropertyAccessInfo::IsIntegerIndexedExotic() { | 6082 bool HOptimizedGraphBuilder::PropertyAccessInfo::IsIntegerIndexedExotic() { |
6078 InstanceType instance_type = map_->instance_type(); | 6083 InstanceType instance_type = map_->instance_type(); |
6079 return instance_type == JS_TYPED_ARRAY_TYPE && | 6084 return instance_type == JS_TYPED_ARRAY_TYPE && |
6080 IsSpecialIndex(isolate()->unicode_cache(), *name_); | 6085 IsSpecialIndex(isolate()->unicode_cache(), *name_); |
6081 } | 6086 } |
(...skipping 6837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
12919 if (ShouldProduceTraceOutput()) { | 12924 if (ShouldProduceTraceOutput()) { |
12920 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12925 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12921 } | 12926 } |
12922 | 12927 |
12923 #ifdef DEBUG | 12928 #ifdef DEBUG |
12924 graph_->Verify(false); // No full verify. | 12929 graph_->Verify(false); // No full verify. |
12925 #endif | 12930 #endif |
12926 } | 12931 } |
12927 | 12932 |
12928 } } // namespace v8::internal | 12933 } } // namespace v8::internal |
OLD | NEW |