Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: src/hydrogen.cc

Issue 15660005: Don't use fast literal if the boilerplate map is still deprecated. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 6674 matching lines...) Expand 10 before | Expand all | Expand 10 after
6685 6685
6686 6686
6687 // Determines whether the given array or object literal boilerplate satisfies 6687 // Determines whether the given array or object literal boilerplate satisfies
6688 // all limits to be considered for fast deep-copying and computes the total 6688 // all limits to be considered for fast deep-copying and computes the total
6689 // size of all objects that are part of the graph. 6689 // size of all objects that are part of the graph.
6690 static bool IsFastLiteral(Handle<JSObject> boilerplate, 6690 static bool IsFastLiteral(Handle<JSObject> boilerplate,
6691 int max_depth, 6691 int max_depth,
6692 int* max_properties, 6692 int* max_properties,
6693 int* data_size, 6693 int* data_size,
6694 int* pointer_size) { 6694 int* pointer_size) {
6695 if (boilerplate->map()->is_deprecated()) {
6696 Handle<Object> result =
6697 JSObject::TryMigrateInstance(boilerplate);
6698 if (result->IsSmi()) return false;
6699 }
6700
6695 ASSERT(max_depth >= 0 && *max_properties >= 0); 6701 ASSERT(max_depth >= 0 && *max_properties >= 0);
6696 if (max_depth == 0) return false; 6702 if (max_depth == 0) return false;
6697 6703
6698 Isolate* isolate = boilerplate->GetIsolate(); 6704 Isolate* isolate = boilerplate->GetIsolate();
6699 Handle<FixedArrayBase> elements(boilerplate->elements()); 6705 Handle<FixedArrayBase> elements(boilerplate->elements());
6700 if (elements->length() > 0 && 6706 if (elements->length() > 0 &&
6701 elements->map() != isolate->heap()->fixed_cow_array_map()) { 6707 elements->map() != isolate->heap()->fixed_cow_array_map()) {
6702 if (boilerplate->HasFastDoubleElements()) { 6708 if (boilerplate->HasFastDoubleElements()) {
6703 *data_size += FixedDoubleArray::SizeFor(elements->length()); 6709 *data_size += FixedDoubleArray::SizeFor(elements->length());
6704 } else if (boilerplate->HasFastObjectElements()) { 6710 } else if (boilerplate->HasFastObjectElements()) {
(...skipping 5770 matching lines...) Expand 10 before | Expand all | Expand 10 after
12475 } 12481 }
12476 } 12482 }
12477 12483
12478 #ifdef DEBUG 12484 #ifdef DEBUG
12479 if (graph_ != NULL) graph_->Verify(false); // No full verify. 12485 if (graph_ != NULL) graph_->Verify(false); // No full verify.
12480 if (allocator_ != NULL) allocator_->Verify(); 12486 if (allocator_ != NULL) allocator_->Verify();
12481 #endif 12487 #endif
12482 } 12488 }
12483 12489
12484 } } // namespace v8::internal 12490 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698