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

Side by Side Diff: src/builtins.cc

Issue 10387211: Merged r11533, r11570 into 3.10 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.10
Patch Set: Created 8 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.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 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 405
406 406
407 MUST_USE_RESULT 407 MUST_USE_RESULT
408 static inline MaybeObject* EnsureJSArrayWithWritableFastElements( 408 static inline MaybeObject* EnsureJSArrayWithWritableFastElements(
409 Heap* heap, Object* receiver, Arguments* args, int first_added_arg) { 409 Heap* heap, Object* receiver, Arguments* args, int first_added_arg) {
410 if (!receiver->IsJSArray()) return NULL; 410 if (!receiver->IsJSArray()) return NULL;
411 JSArray* array = JSArray::cast(receiver); 411 JSArray* array = JSArray::cast(receiver);
412 HeapObject* elms = array->elements(); 412 HeapObject* elms = array->elements();
413 Map* map = elms->map(); 413 Map* map = elms->map();
414 if (map == heap->fixed_array_map()) { 414 if (map == heap->fixed_array_map()) {
415 if (args == NULL || !array->HasFastSmiOnlyElements()) { 415 if (args == NULL || array->HasFastElements()) return elms;
416 if (array->HasFastDoubleElements()) {
417 ASSERT(elms == heap->empty_fixed_array());
418 MaybeObject* maybe_transition =
419 array->TransitionElementsKind(FAST_ELEMENTS);
420 if (maybe_transition->IsFailure()) return maybe_transition;
416 return elms; 421 return elms;
417 } 422 }
418 } else if (map == heap->fixed_cow_array_map()) { 423 } else if (map == heap->fixed_cow_array_map()) {
419 MaybeObject* maybe_writable_result = array->EnsureWritableFastElements(); 424 MaybeObject* maybe_writable_result = array->EnsureWritableFastElements();
420 if (args == NULL || !array->HasFastSmiOnlyElements() || 425 if (args == NULL || array->HasFastElements() ||
421 maybe_writable_result->IsFailure()) { 426 maybe_writable_result->IsFailure()) {
422 return maybe_writable_result; 427 return maybe_writable_result;
423 } 428 }
424 } else { 429 } else {
425 return NULL; 430 return NULL;
426 } 431 }
427 432
428 // Need to ensure that the arguments passed in args can be contained in 433 // Need to ensure that the arguments passed in args can be contained in
429 // the array. 434 // the array.
430 int args_length = args->length(); 435 int args_length = args->length();
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 return Handle<Code>(code_address); \ 1678 return Handle<Code>(code_address); \
1674 } 1679 }
1675 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1680 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1676 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1681 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1677 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1682 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1678 #undef DEFINE_BUILTIN_ACCESSOR_C 1683 #undef DEFINE_BUILTIN_ACCESSOR_C
1679 #undef DEFINE_BUILTIN_ACCESSOR_A 1684 #undef DEFINE_BUILTIN_ACCESSOR_A
1680 1685
1681 1686
1682 } } // namespace v8::internal 1687 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698