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 <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 5383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5394 | 5394 |
5395 Handle<FixedArray> properties(boilerplate->properties()); | 5395 Handle<FixedArray> properties(boilerplate->properties()); |
5396 if (properties->length() > 0) { | 5396 if (properties->length() > 0) { |
5397 return false; | 5397 return false; |
5398 } else { | 5398 } else { |
5399 Handle<DescriptorArray> descriptors( | 5399 Handle<DescriptorArray> descriptors( |
5400 boilerplate->map()->instance_descriptors()); | 5400 boilerplate->map()->instance_descriptors()); |
5401 int limit = boilerplate->map()->NumberOfOwnDescriptors(); | 5401 int limit = boilerplate->map()->NumberOfOwnDescriptors(); |
5402 for (int i = 0; i < limit; i++) { | 5402 for (int i = 0; i < limit; i++) { |
5403 PropertyDetails details = descriptors->GetDetails(i); | 5403 PropertyDetails details = descriptors->GetDetails(i); |
5404 if (details.type() != DATA) continue; | 5404 if (details.location() != kField) continue; |
5405 if ((*max_properties)-- == 0) return false; | 5405 if ((*max_properties)-- == 0) return false; |
5406 FieldIndex field_index = FieldIndex::ForDescriptor(boilerplate->map(), i); | 5406 FieldIndex field_index = FieldIndex::ForDescriptor(boilerplate->map(), i); |
5407 if (boilerplate->IsUnboxedDoubleField(field_index)) continue; | 5407 if (boilerplate->IsUnboxedDoubleField(field_index)) continue; |
5408 Handle<Object> value(boilerplate->RawFastPropertyAt(field_index), | 5408 Handle<Object> value(boilerplate->RawFastPropertyAt(field_index), |
5409 isolate); | 5409 isolate); |
5410 if (value->IsJSObject()) { | 5410 if (value->IsJSObject()) { |
5411 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | 5411 Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
5412 if (!IsFastLiteral(value_object, | 5412 if (!IsFastLiteral(value_object, |
5413 max_depth - 1, | 5413 max_depth - 1, |
5414 max_properties)) { | 5414 max_properties)) { |
(...skipping 6198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11613 HInstruction* object, | 11613 HInstruction* object, |
11614 AllocationSiteUsageContext* site_context, | 11614 AllocationSiteUsageContext* site_context, |
11615 PretenureFlag pretenure_flag) { | 11615 PretenureFlag pretenure_flag) { |
11616 Handle<Map> boilerplate_map(boilerplate_object->map()); | 11616 Handle<Map> boilerplate_map(boilerplate_object->map()); |
11617 Handle<DescriptorArray> descriptors(boilerplate_map->instance_descriptors()); | 11617 Handle<DescriptorArray> descriptors(boilerplate_map->instance_descriptors()); |
11618 int limit = boilerplate_map->NumberOfOwnDescriptors(); | 11618 int limit = boilerplate_map->NumberOfOwnDescriptors(); |
11619 | 11619 |
11620 int copied_fields = 0; | 11620 int copied_fields = 0; |
11621 for (int i = 0; i < limit; i++) { | 11621 for (int i = 0; i < limit; i++) { |
11622 PropertyDetails details = descriptors->GetDetails(i); | 11622 PropertyDetails details = descriptors->GetDetails(i); |
11623 if (details.type() != DATA) continue; | 11623 if (details.location() != kField) continue; |
11624 copied_fields++; | 11624 copied_fields++; |
11625 FieldIndex field_index = FieldIndex::ForDescriptor(*boilerplate_map, i); | 11625 FieldIndex field_index = FieldIndex::ForDescriptor(*boilerplate_map, i); |
11626 | 11626 |
11627 | 11627 |
11628 int property_offset = field_index.offset(); | 11628 int property_offset = field_index.offset(); |
11629 Handle<Name> name(descriptors->GetKey(i)); | 11629 Handle<Name> name(descriptors->GetKey(i)); |
11630 | 11630 |
11631 // The access for the store depends on the type of the boilerplate. | 11631 // The access for the store depends on the type of the boilerplate. |
11632 HObjectAccess access = boilerplate_object->IsJSArray() ? | 11632 HObjectAccess access = boilerplate_object->IsJSArray() ? |
11633 HObjectAccess::ForJSArrayOffset(property_offset) : | 11633 HObjectAccess::ForJSArrayOffset(property_offset) : |
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12969 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12969 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12970 } | 12970 } |
12971 | 12971 |
12972 #ifdef DEBUG | 12972 #ifdef DEBUG |
12973 graph_->Verify(false); // No full verify. | 12973 graph_->Verify(false); // No full verify. |
12974 #endif | 12974 #endif |
12975 } | 12975 } |
12976 | 12976 |
12977 } // namespace internal | 12977 } // namespace internal |
12978 } // namespace v8 | 12978 } // namespace v8 |
OLD | NEW |