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

Side by Side Diff: src/objects.cc

Issue 222413003: Merged r19848 into 3.24 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.24
Patch Set: Created 6 years, 8 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 | « src/array.js ('k') | src/runtime.cc » ('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 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 14438 matching lines...) Expand 10 before | Expand all | Expand 10 after
14449 } 14449 }
14450 14450
14451 14451
14452 // Collects all defined (non-hole) and non-undefined (array) elements at 14452 // Collects all defined (non-hole) and non-undefined (array) elements at
14453 // the start of the elements array. 14453 // the start of the elements array.
14454 // If the object is in dictionary mode, it is converted to fast elements 14454 // If the object is in dictionary mode, it is converted to fast elements
14455 // mode. 14455 // mode.
14456 Handle<Object> JSObject::PrepareElementsForSort(Handle<JSObject> object, 14456 Handle<Object> JSObject::PrepareElementsForSort(Handle<JSObject> object,
14457 uint32_t limit) { 14457 uint32_t limit) {
14458 Isolate* isolate = object->GetIsolate(); 14458 Isolate* isolate = object->GetIsolate();
14459 if (object->HasSloppyArgumentsElements() ||
14460 object->map()->is_observed()) {
14461 return handle(Smi::FromInt(-1), isolate);
14462 }
14459 14463
14460 ASSERT(!object->map()->is_observed());
14461 if (object->HasDictionaryElements()) { 14464 if (object->HasDictionaryElements()) {
14462 // Convert to fast elements containing only the existing properties. 14465 // Convert to fast elements containing only the existing properties.
14463 // Ordering is irrelevant, since we are going to sort anyway. 14466 // Ordering is irrelevant, since we are going to sort anyway.
14464 Handle<SeededNumberDictionary> dict(object->element_dictionary()); 14467 Handle<SeededNumberDictionary> dict(object->element_dictionary());
14465 if (object->IsJSArray() || dict->requires_slow_elements() || 14468 if (object->IsJSArray() || dict->requires_slow_elements() ||
14466 dict->max_number_key() >= limit) { 14469 dict->max_number_key() >= limit) {
14467 return JSObject::PrepareSlowElementsForSort(object, limit); 14470 return JSObject::PrepareSlowElementsForSort(object, limit);
14468 } 14471 }
14469 // Convert to fast elements. 14472 // Convert to fast elements.
14470 14473
(...skipping 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after
16501 #define ERROR_MESSAGES_TEXTS(C, T) T, 16504 #define ERROR_MESSAGES_TEXTS(C, T) T,
16502 static const char* error_messages_[] = { 16505 static const char* error_messages_[] = {
16503 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16506 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16504 }; 16507 };
16505 #undef ERROR_MESSAGES_TEXTS 16508 #undef ERROR_MESSAGES_TEXTS
16506 return error_messages_[reason]; 16509 return error_messages_[reason];
16507 } 16510 }
16508 16511
16509 16512
16510 } } // namespace v8::internal 16513 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/array.js ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698