OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 CHECK(obj->HasLocalProperty(*second)); | 605 CHECK(obj->HasLocalProperty(*second)); |
606 | 606 |
607 // delete second and then first | 607 // delete second and then first |
608 CHECK(obj->DeleteProperty(*second, JSObject::NORMAL_DELETION)); | 608 CHECK(obj->DeleteProperty(*second, JSObject::NORMAL_DELETION)); |
609 CHECK(obj->HasLocalProperty(*first)); | 609 CHECK(obj->HasLocalProperty(*first)); |
610 CHECK(obj->DeleteProperty(*first, JSObject::NORMAL_DELETION)); | 610 CHECK(obj->DeleteProperty(*first, JSObject::NORMAL_DELETION)); |
611 CHECK(!obj->HasLocalProperty(*first)); | 611 CHECK(!obj->HasLocalProperty(*first)); |
612 CHECK(!obj->HasLocalProperty(*second)); | 612 CHECK(!obj->HasLocalProperty(*second)); |
613 | 613 |
614 // check string and symbol match | 614 // check string and symbol match |
615 static const char* string1 = "fisk"; | 615 const char* string1 = "fisk"; |
616 Handle<String> s1 = FACTORY->NewStringFromAscii(CStrVector(string1)); | 616 Handle<String> s1 = FACTORY->NewStringFromAscii(CStrVector(string1)); |
617 obj->SetProperty( | 617 obj->SetProperty( |
618 *s1, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked(); | 618 *s1, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked(); |
619 Handle<String> s1_symbol = FACTORY->LookupAsciiSymbol(string1); | 619 Handle<String> s1_symbol = FACTORY->LookupAsciiSymbol(string1); |
620 CHECK(obj->HasLocalProperty(*s1_symbol)); | 620 CHECK(obj->HasLocalProperty(*s1_symbol)); |
621 | 621 |
622 // check symbol and string match | 622 // check symbol and string match |
623 static const char* string2 = "fugl"; | 623 const char* string2 = "fugl"; |
624 Handle<String> s2_symbol = FACTORY->LookupAsciiSymbol(string2); | 624 Handle<String> s2_symbol = FACTORY->LookupAsciiSymbol(string2); |
625 obj->SetProperty( | 625 obj->SetProperty( |
626 *s2_symbol, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked(); | 626 *s2_symbol, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked(); |
627 Handle<String> s2 = FACTORY->NewStringFromAscii(CStrVector(string2)); | 627 Handle<String> s2 = FACTORY->NewStringFromAscii(CStrVector(string2)); |
628 CHECK(obj->HasLocalProperty(*s2)); | 628 CHECK(obj->HasLocalProperty(*s2)); |
629 } | 629 } |
630 | 630 |
631 | 631 |
632 TEST(JSObjectMaps) { | 632 TEST(JSObjectMaps) { |
633 InitializeVM(); | 633 InitializeVM(); |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 // clearing correctly records slots in prototype transition array. | 1619 // clearing correctly records slots in prototype transition array. |
1620 i::FLAG_always_compact = true; | 1620 i::FLAG_always_compact = true; |
1621 Handle<Map> map(baseObject->map()); | 1621 Handle<Map> map(baseObject->map()); |
1622 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address())); | 1622 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address())); |
1623 CHECK(space->LastPage()->Contains(prototype->address())); | 1623 CHECK(space->LastPage()->Contains(prototype->address())); |
1624 baseObject->SetPrototype(*prototype, false)->ToObjectChecked(); | 1624 baseObject->SetPrototype(*prototype, false)->ToObjectChecked(); |
1625 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); | 1625 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); |
1626 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 1626 HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
1627 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); | 1627 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); |
1628 } | 1628 } |
OLD | NEW |