OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5010 !map->has_named_interceptor(); | 5010 !map->has_named_interceptor(); |
5011 } | 5011 } |
5012 | 5012 |
5013 | 5013 |
5014 // Determines whether the given array or object literal boilerplate satisfies | 5014 // Determines whether the given array or object literal boilerplate satisfies |
5015 // all limits to be considered for fast deep-copying and computes the total | 5015 // all limits to be considered for fast deep-copying and computes the total |
5016 // size of all objects that are part of the graph. | 5016 // size of all objects that are part of the graph. |
5017 static bool IsFastLiteral(Handle<JSObject> boilerplate, | 5017 static bool IsFastLiteral(Handle<JSObject> boilerplate, |
5018 int max_depth, | 5018 int max_depth, |
5019 int* max_properties) { | 5019 int* max_properties) { |
5020 if (boilerplate->map()->is_deprecated()) { | 5020 if (boilerplate->map()->is_deprecated() && |
5021 Handle<Object> result = JSObject::TryMigrateInstance(boilerplate); | 5021 !JSObject::TryMigrateInstance(boilerplate)) { |
5022 if (result.is_null()) return false; | 5022 return false; |
5023 } | 5023 } |
5024 | 5024 |
5025 ASSERT(max_depth >= 0 && *max_properties >= 0); | 5025 ASSERT(max_depth >= 0 && *max_properties >= 0); |
5026 if (max_depth == 0) return false; | 5026 if (max_depth == 0) return false; |
5027 | 5027 |
5028 Isolate* isolate = boilerplate->GetIsolate(); | 5028 Isolate* isolate = boilerplate->GetIsolate(); |
5029 Handle<FixedArrayBase> elements(boilerplate->elements()); | 5029 Handle<FixedArrayBase> elements(boilerplate->elements()); |
5030 if (elements->length() > 0 && | 5030 if (elements->length() > 0 && |
5031 elements->map() != isolate->heap()->fixed_cow_array_map()) { | 5031 elements->map() != isolate->heap()->fixed_cow_array_map()) { |
5032 if (boilerplate->HasFastObjectElements()) { | 5032 if (boilerplate->HasFastObjectElements()) { |
(...skipping 6648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11681 if (ShouldProduceTraceOutput()) { | 11681 if (ShouldProduceTraceOutput()) { |
11682 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11682 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11683 } | 11683 } |
11684 | 11684 |
11685 #ifdef DEBUG | 11685 #ifdef DEBUG |
11686 graph_->Verify(false); // No full verify. | 11686 graph_->Verify(false); // No full verify. |
11687 #endif | 11687 #endif |
11688 } | 11688 } |
11689 | 11689 |
11690 } } // namespace v8::internal | 11690 } } // namespace v8::internal |
OLD | NEW |