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

Unified Diff: src/api.cc

Issue 6685073: Remember and reuse derived map for external arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 331f7e709063b6b857718832c7c0d3f7f69a42f6..94162cf203484c49557cd69261810bad9c5c0bfb 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2981,14 +2981,16 @@ void PrepareExternalArrayElements(i::Handle<i::JSObject> object,
// map if the element type is now changing, because assumptions about
// generated code based on the receiver's map will be invalid.
i::Handle<i::HeapObject> elements(object->elements());
- bool force_unique_map =
+ bool cant_reuse_map =
elements->map()->IsUndefined() ||
!elements->map()->has_external_array_elements() ||
elements->map() != HEAP->MapForExternalArrayType(array_type);
- if (force_unique_map) {
+ if (cant_reuse_map) {
i::Handle<i::Map> external_array_map =
- FACTORY->NewExternalArrayElementsMap(
- i::Handle<i::Map>(object->map()));
+ FACTORY->GetExternalArrayElementsMap(
+ i::Handle<i::Map>(object->map()),
+ array_type,
+ object->HasFastProperties());
object->set_map(*external_array_map);
}
object->set_elements(*array);
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698