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

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

Issue 18774002: Handlify JSReceiver/JSObject::DeleteProperty method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Toon Verwaest. Created 7 years, 5 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 | « src/runtime.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 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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 654
655 // check for empty 655 // check for empty
656 CHECK(!obj->HasLocalProperty(*first)); 656 CHECK(!obj->HasLocalProperty(*first));
657 657
658 // add first 658 // add first
659 obj->SetProperty( 659 obj->SetProperty(
660 *first, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked(); 660 *first, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked();
661 CHECK(obj->HasLocalProperty(*first)); 661 CHECK(obj->HasLocalProperty(*first));
662 662
663 // delete first 663 // delete first
664 CHECK(obj->DeleteProperty(*first, JSObject::NORMAL_DELETION)); 664 JSReceiver::DeleteProperty(obj, first, JSReceiver::NORMAL_DELETION);
665 CHECK(!obj->HasLocalProperty(*first)); 665 CHECK(!obj->HasLocalProperty(*first));
666 666
667 // add first and then second 667 // add first and then second
668 obj->SetProperty( 668 obj->SetProperty(
669 *first, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked(); 669 *first, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked();
670 obj->SetProperty( 670 obj->SetProperty(
671 *second, Smi::FromInt(2), NONE, kNonStrictMode)->ToObjectChecked(); 671 *second, Smi::FromInt(2), NONE, kNonStrictMode)->ToObjectChecked();
672 CHECK(obj->HasLocalProperty(*first)); 672 CHECK(obj->HasLocalProperty(*first));
673 CHECK(obj->HasLocalProperty(*second)); 673 CHECK(obj->HasLocalProperty(*second));
674 674
675 // delete first and then second 675 // delete first and then second
676 CHECK(obj->DeleteProperty(*first, JSObject::NORMAL_DELETION)); 676 JSReceiver::DeleteProperty(obj, first, JSReceiver::NORMAL_DELETION);
677 CHECK(obj->HasLocalProperty(*second)); 677 CHECK(obj->HasLocalProperty(*second));
678 CHECK(obj->DeleteProperty(*second, JSObject::NORMAL_DELETION)); 678 JSReceiver::DeleteProperty(obj, second, JSReceiver::NORMAL_DELETION);
679 CHECK(!obj->HasLocalProperty(*first)); 679 CHECK(!obj->HasLocalProperty(*first));
680 CHECK(!obj->HasLocalProperty(*second)); 680 CHECK(!obj->HasLocalProperty(*second));
681 681
682 // add first and then second 682 // add first and then second
683 obj->SetProperty( 683 obj->SetProperty(
684 *first, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked(); 684 *first, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked();
685 obj->SetProperty( 685 obj->SetProperty(
686 *second, Smi::FromInt(2), NONE, kNonStrictMode)->ToObjectChecked(); 686 *second, Smi::FromInt(2), NONE, kNonStrictMode)->ToObjectChecked();
687 CHECK(obj->HasLocalProperty(*first)); 687 CHECK(obj->HasLocalProperty(*first));
688 CHECK(obj->HasLocalProperty(*second)); 688 CHECK(obj->HasLocalProperty(*second));
689 689
690 // delete second and then first 690 // delete second and then first
691 CHECK(obj->DeleteProperty(*second, JSObject::NORMAL_DELETION)); 691 JSReceiver::DeleteProperty(obj, second, JSReceiver::NORMAL_DELETION);
692 CHECK(obj->HasLocalProperty(*first)); 692 CHECK(obj->HasLocalProperty(*first));
693 CHECK(obj->DeleteProperty(*first, JSObject::NORMAL_DELETION)); 693 JSReceiver::DeleteProperty(obj, first, JSReceiver::NORMAL_DELETION);
694 CHECK(!obj->HasLocalProperty(*first)); 694 CHECK(!obj->HasLocalProperty(*first));
695 CHECK(!obj->HasLocalProperty(*second)); 695 CHECK(!obj->HasLocalProperty(*second));
696 696
697 // check string and internalized string match 697 // check string and internalized string match
698 const char* string1 = "fisk"; 698 const char* string1 = "fisk";
699 Handle<String> s1 = factory->NewStringFromAscii(CStrVector(string1)); 699 Handle<String> s1 = factory->NewStringFromAscii(CStrVector(string1));
700 obj->SetProperty( 700 obj->SetProperty(
701 *s1, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked(); 701 *s1, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked();
702 Handle<String> s1_string = factory->InternalizeUtf8String(string1); 702 Handle<String> s1_string = factory->InternalizeUtf8String(string1);
703 CHECK(obj->HasLocalProperty(*s1_string)); 703 CHECK(obj->HasLocalProperty(*s1_string));
(...skipping 2609 matching lines...) Expand 10 before | Expand all | Expand 10 after
3313 " var a = new Array(n);" 3313 " var a = new Array(n);"
3314 " for (var i = 0; i < n; i += 100) a[i] = i;" 3314 " for (var i = 0; i < n; i += 100) a[i] = i;"
3315 "};" 3315 "};"
3316 "f(10 * 1024 * 1024);"); 3316 "f(10 * 1024 * 1024);");
3317 IncrementalMarking* marking = HEAP->incremental_marking(); 3317 IncrementalMarking* marking = HEAP->incremental_marking();
3318 if (marking->IsStopped()) marking->Start(); 3318 if (marking->IsStopped()) marking->Start();
3319 // This big step should be sufficient to mark the whole array. 3319 // This big step should be sufficient to mark the whole array.
3320 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); 3320 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD);
3321 ASSERT(marking->IsComplete()); 3321 ASSERT(marking->IsComplete());
3322 } 3322 }
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698