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

Side by Side Diff: test/cctest/test-heap.cc

Issue 159263: - A prototype which allows to expose CanvasPixelArray functionality... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 4 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 | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "execution.h" 7 #include "execution.h"
8 #include "factory.h" 8 #include "factory.h"
9 #include "macro-assembler.h" 9 #include "macro-assembler.h"
10 #include "global-handles.h" 10 #include "global-handles.h"
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 CHECK_EQ(Smi::FromInt(1), array->length()); 646 CHECK_EQ(Smi::FromInt(1), array->length());
647 CHECK_EQ(array->GetElement(0), name); 647 CHECK_EQ(array->GetElement(0), name);
648 648
649 // Set array length with larger than smi value. 649 // Set array length with larger than smi value.
650 Object* length = Heap::NumberFromInt32(Smi::kMaxValue + 1); 650 Object* length = Heap::NumberFromInt32(Smi::kMaxValue + 1);
651 array->SetElementsLength(length); 651 array->SetElementsLength(length);
652 652
653 uint32_t int_length = 0; 653 uint32_t int_length = 0;
654 CHECK(Array::IndexFromObject(length, &int_length)); 654 CHECK(Array::IndexFromObject(length, &int_length));
655 CHECK_EQ(length, array->length()); 655 CHECK_EQ(length, array->length());
656 CHECK(!array->HasFastElements()); // Must be in slow mode. 656 CHECK(array->HasDictionaryElements()); // Must be in slow mode.
657 657
658 // array[length] = name. 658 // array[length] = name.
659 array->SetElement(int_length, name); 659 array->SetElement(int_length, name);
660 uint32_t new_int_length = 0; 660 uint32_t new_int_length = 0;
661 CHECK(Array::IndexFromObject(array->length(), &new_int_length)); 661 CHECK(Array::IndexFromObject(array->length(), &new_int_length));
662 CHECK_EQ(static_cast<double>(int_length), new_int_length - 1); 662 CHECK_EQ(static_cast<double>(int_length), new_int_length - 1);
663 CHECK_EQ(array->GetElement(int_length), name); 663 CHECK_EQ(array->GetElement(int_length), name);
664 CHECK_EQ(array->GetElement(0), name); 664 CHECK_EQ(array->GetElement(0), name);
665 } 665 }
666 666
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 objs[next_objs_index++] = 789 objs[next_objs_index++] =
790 Factory::NewStringFromAscii(CStrVector(str), TENURED); 790 Factory::NewStringFromAscii(CStrVector(str), TENURED);
791 delete[] str; 791 delete[] str;
792 792
793 // Add a Map object to look for. 793 // Add a Map object to look for.
794 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map()); 794 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map());
795 795
796 CHECK_EQ(objs_count, next_objs_index); 796 CHECK_EQ(objs_count, next_objs_index);
797 CHECK_EQ(objs_count, ObjectsFoundInHeap(objs, objs_count)); 797 CHECK_EQ(objs_count, ObjectsFoundInHeap(objs, objs_count));
798 } 798 }
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698