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

Side by Side Diff: src/builtins.cc

Issue 213833008: Fix left trimming check for large objects (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | « no previous file | test/mjsunit/regress/regress-358090.js » ('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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 if (len == 0) return heap->undefined_value(); 547 if (len == 0) return heap->undefined_value();
548 548
549 // Get first element 549 // Get first element
550 ElementsAccessor* accessor = array->GetElementsAccessor(); 550 ElementsAccessor* accessor = array->GetElementsAccessor();
551 Handle<Object> first = accessor->Get(receiver, array, 0, elms_obj); 551 Handle<Object> first = accessor->Get(receiver, array, 0, elms_obj);
552 RETURN_IF_EMPTY_HANDLE(isolate, first); 552 RETURN_IF_EMPTY_HANDLE(isolate, first);
553 if (first->IsTheHole()) { 553 if (first->IsTheHole()) {
554 first = isolate->factory()->undefined_value(); 554 first = isolate->factory()->undefined_value();
555 } 555 }
556 556
557 if (!heap->CanMoveObjectStart(*elms_obj)) { 557 if (heap->CanMoveObjectStart(*elms_obj)) {
558 array->set_elements(LeftTrimFixedArray(heap, *elms_obj, 1)); 558 array->set_elements(LeftTrimFixedArray(heap, *elms_obj, 1));
559 } else { 559 } else {
560 // Shift the elements. 560 // Shift the elements.
561 if (elms_obj->IsFixedArray()) { 561 if (elms_obj->IsFixedArray()) {
562 Handle<FixedArray> elms = Handle<FixedArray>::cast(elms_obj); 562 Handle<FixedArray> elms = Handle<FixedArray>::cast(elms_obj);
563 DisallowHeapAllocation no_gc; 563 DisallowHeapAllocation no_gc;
564 heap->MoveElements(*elms, 0, 1, len - 1); 564 heap->MoveElements(*elms, 0, 1, len - 1);
565 elms->set(len - 1, heap->the_hole_value()); 565 elms->set(len - 1, heap->the_hole_value());
566 } else { 566 } else {
567 Handle<FixedDoubleArray> elms = Handle<FixedDoubleArray>::cast(elms_obj); 567 Handle<FixedDoubleArray> elms = Handle<FixedDoubleArray>::cast(elms_obj);
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1715 } 1715 }
1716 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1716 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1717 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1717 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1718 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 1718 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
1719 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1719 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1720 #undef DEFINE_BUILTIN_ACCESSOR_C 1720 #undef DEFINE_BUILTIN_ACCESSOR_C
1721 #undef DEFINE_BUILTIN_ACCESSOR_A 1721 #undef DEFINE_BUILTIN_ACCESSOR_A
1722 1722
1723 1723
1724 } } // namespace v8::internal 1724 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-358090.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698