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

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

Issue 1479543002: [proxies] Implement [[Delete]]. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo Created 5 years 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
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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 Handle<Smi> two(Smi::FromInt(2), isolate); 904 Handle<Smi> two(Smi::FromInt(2), isolate);
905 905
906 // check for empty 906 // check for empty
907 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, first)); 907 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, first));
908 908
909 // add first 909 // add first
910 JSReceiver::SetProperty(obj, first, one, SLOPPY).Check(); 910 JSReceiver::SetProperty(obj, first, one, SLOPPY).Check();
911 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, first)); 911 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, first));
912 912
913 // delete first 913 // delete first
914 JSReceiver::DeleteProperty(obj, first, SLOPPY).Check(); 914 CHECK(Just(true) == JSReceiver::DeleteProperty(obj, first, SLOPPY));
915 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, first)); 915 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, first));
916 916
917 // add first and then second 917 // add first and then second
918 JSReceiver::SetProperty(obj, first, one, SLOPPY).Check(); 918 JSReceiver::SetProperty(obj, first, one, SLOPPY).Check();
919 JSReceiver::SetProperty(obj, second, two, SLOPPY).Check(); 919 JSReceiver::SetProperty(obj, second, two, SLOPPY).Check();
920 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, first)); 920 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, first));
921 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, second)); 921 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, second));
922 922
923 // delete first and then second 923 // delete first and then second
924 JSReceiver::DeleteProperty(obj, first, SLOPPY).Check(); 924 CHECK(Just(true) == JSReceiver::DeleteProperty(obj, first, SLOPPY));
925 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, second)); 925 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, second));
926 JSReceiver::DeleteProperty(obj, second, SLOPPY).Check(); 926 CHECK(Just(true) == JSReceiver::DeleteProperty(obj, second, SLOPPY));
927 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, first)); 927 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, first));
928 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, second)); 928 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, second));
929 929
930 // add first and then second 930 // add first and then second
931 JSReceiver::SetProperty(obj, first, one, SLOPPY).Check(); 931 JSReceiver::SetProperty(obj, first, one, SLOPPY).Check();
932 JSReceiver::SetProperty(obj, second, two, SLOPPY).Check(); 932 JSReceiver::SetProperty(obj, second, two, SLOPPY).Check();
933 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, first)); 933 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, first));
934 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, second)); 934 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, second));
935 935
936 // delete second and then first 936 // delete second and then first
937 JSReceiver::DeleteProperty(obj, second, SLOPPY).Check(); 937 CHECK(Just(true) == JSReceiver::DeleteProperty(obj, second, SLOPPY));
938 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, first)); 938 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, first));
939 JSReceiver::DeleteProperty(obj, first, SLOPPY).Check(); 939 CHECK(Just(true) == JSReceiver::DeleteProperty(obj, first, SLOPPY));
940 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, first)); 940 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, first));
941 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, second)); 941 CHECK(Just(false) == JSReceiver::HasOwnProperty(obj, second));
942 942
943 // check string and internalized string match 943 // check string and internalized string match
944 const char* string1 = "fisk"; 944 const char* string1 = "fisk";
945 Handle<String> s1 = factory->NewStringFromAsciiChecked(string1); 945 Handle<String> s1 = factory->NewStringFromAsciiChecked(string1);
946 JSReceiver::SetProperty(obj, s1, one, SLOPPY).Check(); 946 JSReceiver::SetProperty(obj, s1, one, SLOPPY).Check();
947 Handle<String> s1_string = factory->InternalizeUtf8String(string1); 947 Handle<String> s1_string = factory->InternalizeUtf8String(string1);
948 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, s1_string)); 948 CHECK(Just(true) == JSReceiver::HasOwnProperty(obj, s1_string));
949 949
(...skipping 5496 matching lines...) Expand 10 before | Expand all | Expand 10 after
6446 isolate->IncrementJsCallsFromApiCounter(); 6446 isolate->IncrementJsCallsFromApiCounter();
6447 isolate->IncrementJsCallsFromApiCounter(); 6447 isolate->IncrementJsCallsFromApiCounter();
6448 isolate->IncrementJsCallsFromApiCounter(); 6448 isolate->IncrementJsCallsFromApiCounter();
6449 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); 6449 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4);
6450 CheckDoubleEquals(2, calls_per_ms); 6450 CheckDoubleEquals(2, calls_per_ms);
6451 } 6451 }
6452 6452
6453 6453
6454 } // namespace internal 6454 } // namespace internal
6455 } // namespace v8 6455 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698