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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 String* second = String::cast(Heap::LookupAsciiSymbol("second")); | 546 String* second = String::cast(Heap::LookupAsciiSymbol("second")); |
547 | 547 |
548 // check for empty | 548 // check for empty |
549 CHECK(!obj->HasLocalProperty(first)); | 549 CHECK(!obj->HasLocalProperty(first)); |
550 | 550 |
551 // add first | 551 // add first |
552 obj->SetProperty(first, Smi::FromInt(1), NONE); | 552 obj->SetProperty(first, Smi::FromInt(1), NONE); |
553 CHECK(obj->HasLocalProperty(first)); | 553 CHECK(obj->HasLocalProperty(first)); |
554 | 554 |
555 // delete first | 555 // delete first |
556 CHECK(obj->DeleteProperty(first)); | 556 CHECK(obj->DeleteProperty(first, JSObject::NORMAL_DELETION)); |
557 CHECK(!obj->HasLocalProperty(first)); | 557 CHECK(!obj->HasLocalProperty(first)); |
558 | 558 |
559 // add first and then second | 559 // add first and then second |
560 obj->SetProperty(first, Smi::FromInt(1), NONE); | 560 obj->SetProperty(first, Smi::FromInt(1), NONE); |
561 obj->SetProperty(second, Smi::FromInt(2), NONE); | 561 obj->SetProperty(second, Smi::FromInt(2), NONE); |
562 CHECK(obj->HasLocalProperty(first)); | 562 CHECK(obj->HasLocalProperty(first)); |
563 CHECK(obj->HasLocalProperty(second)); | 563 CHECK(obj->HasLocalProperty(second)); |
564 | 564 |
565 // delete first and then second | 565 // delete first and then second |
566 CHECK(obj->DeleteProperty(first)); | 566 CHECK(obj->DeleteProperty(first, JSObject::NORMAL_DELETION)); |
567 CHECK(obj->HasLocalProperty(second)); | 567 CHECK(obj->HasLocalProperty(second)); |
568 CHECK(obj->DeleteProperty(second)); | 568 CHECK(obj->DeleteProperty(second, JSObject::NORMAL_DELETION)); |
569 CHECK(!obj->HasLocalProperty(first)); | 569 CHECK(!obj->HasLocalProperty(first)); |
570 CHECK(!obj->HasLocalProperty(second)); | 570 CHECK(!obj->HasLocalProperty(second)); |
571 | 571 |
572 // add first and then second | 572 // add first and then second |
573 obj->SetProperty(first, Smi::FromInt(1), NONE); | 573 obj->SetProperty(first, Smi::FromInt(1), NONE); |
574 obj->SetProperty(second, Smi::FromInt(2), NONE); | 574 obj->SetProperty(second, Smi::FromInt(2), NONE); |
575 CHECK(obj->HasLocalProperty(first)); | 575 CHECK(obj->HasLocalProperty(first)); |
576 CHECK(obj->HasLocalProperty(second)); | 576 CHECK(obj->HasLocalProperty(second)); |
577 | 577 |
578 // delete second and then first | 578 // delete second and then first |
579 CHECK(obj->DeleteProperty(second)); | 579 CHECK(obj->DeleteProperty(second, JSObject::NORMAL_DELETION)); |
580 CHECK(obj->HasLocalProperty(first)); | 580 CHECK(obj->HasLocalProperty(first)); |
581 CHECK(obj->DeleteProperty(first)); | 581 CHECK(obj->DeleteProperty(first, JSObject::NORMAL_DELETION)); |
582 CHECK(!obj->HasLocalProperty(first)); | 582 CHECK(!obj->HasLocalProperty(first)); |
583 CHECK(!obj->HasLocalProperty(second)); | 583 CHECK(!obj->HasLocalProperty(second)); |
584 | 584 |
585 // check string and symbol match | 585 // check string and symbol match |
586 static const char* string1 = "fisk"; | 586 static const char* string1 = "fisk"; |
587 String* s1 = | 587 String* s1 = |
588 String::cast(Heap::AllocateStringFromAscii(CStrVector(string1))); | 588 String::cast(Heap::AllocateStringFromAscii(CStrVector(string1))); |
589 obj->SetProperty(s1, Smi::FromInt(1), NONE); | 589 obj->SetProperty(s1, Smi::FromInt(1), NONE); |
590 CHECK(obj->HasLocalProperty(String::cast(Heap::LookupAsciiSymbol(string1)))); | 590 CHECK(obj->HasLocalProperty(String::cast(Heap::LookupAsciiSymbol(string1)))); |
591 | 591 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |