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 4069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4080 | 4080 |
4081 | 4081 |
4082 // Determines whether the given array or object literal boilerplate satisfies | 4082 // Determines whether the given array or object literal boilerplate satisfies |
4083 // all limits to be considered for fast deep-copying and computes the total | 4083 // all limits to be considered for fast deep-copying and computes the total |
4084 // size of all objects that are part of the graph. | 4084 // size of all objects that are part of the graph. |
4085 static bool IsFastLiteral(Handle<JSObject> boilerplate, | 4085 static bool IsFastLiteral(Handle<JSObject> boilerplate, |
4086 int max_depth, | 4086 int max_depth, |
4087 int* max_properties) { | 4087 int* max_properties) { |
4088 if (boilerplate->map()->is_deprecated()) { | 4088 if (boilerplate->map()->is_deprecated()) { |
4089 Handle<Object> result = JSObject::TryMigrateInstance(boilerplate); | 4089 Handle<Object> result = JSObject::TryMigrateInstance(boilerplate); |
4090 if (result->IsSmi()) return false; | 4090 if (result.is_null()) return false; |
4091 } | 4091 } |
4092 | 4092 |
4093 ASSERT(max_depth >= 0 && *max_properties >= 0); | 4093 ASSERT(max_depth >= 0 && *max_properties >= 0); |
4094 if (max_depth == 0) return false; | 4094 if (max_depth == 0) return false; |
4095 | 4095 |
4096 Isolate* isolate = boilerplate->GetIsolate(); | 4096 Isolate* isolate = boilerplate->GetIsolate(); |
4097 Handle<FixedArrayBase> elements(boilerplate->elements()); | 4097 Handle<FixedArrayBase> elements(boilerplate->elements()); |
4098 if (elements->length() > 0 && | 4098 if (elements->length() > 0 && |
4099 elements->map() != isolate->heap()->fixed_cow_array_map()) { | 4099 elements->map() != isolate->heap()->fixed_cow_array_map()) { |
4100 if (boilerplate->HasFastObjectElements()) { | 4100 if (boilerplate->HasFastObjectElements()) { |
(...skipping 5531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9632 if (ShouldProduceTraceOutput()) { | 9632 if (ShouldProduceTraceOutput()) { |
9633 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9633 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
9634 } | 9634 } |
9635 | 9635 |
9636 #ifdef DEBUG | 9636 #ifdef DEBUG |
9637 graph_->Verify(false); // No full verify. | 9637 graph_->Verify(false); // No full verify. |
9638 #endif | 9638 #endif |
9639 } | 9639 } |
9640 | 9640 |
9641 } } // namespace v8::internal | 9641 } } // namespace v8::internal |
OLD | NEW |