| OLD | NEW |
| 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 String* first = String::cast(Heap::LookupAsciiSymbol("first")); | 657 String* first = String::cast(Heap::LookupAsciiSymbol("first")); |
| 658 String* second = String::cast(Heap::LookupAsciiSymbol("second")); | 658 String* second = String::cast(Heap::LookupAsciiSymbol("second")); |
| 659 | 659 |
| 660 obj->SetProperty(first, Smi::FromInt(1), NONE); | 660 obj->SetProperty(first, Smi::FromInt(1), NONE); |
| 661 obj->SetProperty(second, Smi::FromInt(2), NONE); | 661 obj->SetProperty(second, Smi::FromInt(2), NONE); |
| 662 | 662 |
| 663 obj->SetElement(0, first); | 663 obj->SetElement(0, first); |
| 664 obj->SetElement(1, second); | 664 obj->SetElement(1, second); |
| 665 | 665 |
| 666 // Make the clone. | 666 // Make the clone. |
| 667 JSObject* clone = JSObject::cast(obj->Copy()); | 667 JSObject* clone = JSObject::cast(Heap::CopyJSObject(obj)); |
| 668 CHECK(clone != obj); | 668 CHECK(clone != obj); |
| 669 | 669 |
| 670 CHECK_EQ(obj->GetElement(0), clone->GetElement(0)); | 670 CHECK_EQ(obj->GetElement(0), clone->GetElement(0)); |
| 671 CHECK_EQ(obj->GetElement(1), clone->GetElement(1)); | 671 CHECK_EQ(obj->GetElement(1), clone->GetElement(1)); |
| 672 | 672 |
| 673 CHECK_EQ(obj->GetProperty(first), clone->GetProperty(first)); | 673 CHECK_EQ(obj->GetProperty(first), clone->GetProperty(first)); |
| 674 CHECK_EQ(obj->GetProperty(second), clone->GetProperty(second)); | 674 CHECK_EQ(obj->GetProperty(second), clone->GetProperty(second)); |
| 675 | 675 |
| 676 // Flip the values. | 676 // Flip the values. |
| 677 clone->SetProperty(first, Smi::FromInt(2), NONE); | 677 clone->SetProperty(first, Smi::FromInt(2), NONE); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 objs[next_objs_index++] = | 770 objs[next_objs_index++] = |
| 771 Factory::NewStringFromAscii(CStrVector(str), TENURED); | 771 Factory::NewStringFromAscii(CStrVector(str), TENURED); |
| 772 delete[] str; | 772 delete[] str; |
| 773 | 773 |
| 774 // Add a Map object to look for. | 774 // Add a Map object to look for. |
| 775 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map()); | 775 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map()); |
| 776 | 776 |
| 777 CHECK_EQ(objs_count, next_objs_index); | 777 CHECK_EQ(objs_count, next_objs_index); |
| 778 CHECK_EQ(objs_count, ObjectsFoundInHeap(objs, objs_count)); | 778 CHECK_EQ(objs_count, ObjectsFoundInHeap(objs, objs_count)); |
| 779 } | 779 } |
| OLD | NEW |