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

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

Issue 22934006: Handlify JSObject::DeepCopy method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Toon Verwaest. Created 7 years, 3 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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 804
805 obj->SetProperty( 805 obj->SetProperty(
806 *first, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked(); 806 *first, Smi::FromInt(1), NONE, kNonStrictMode)->ToObjectChecked();
807 obj->SetProperty( 807 obj->SetProperty(
808 *second, Smi::FromInt(2), NONE, kNonStrictMode)->ToObjectChecked(); 808 *second, Smi::FromInt(2), NONE, kNonStrictMode)->ToObjectChecked();
809 809
810 obj->SetElement(0, *first, NONE, kNonStrictMode)->ToObjectChecked(); 810 obj->SetElement(0, *first, NONE, kNonStrictMode)->ToObjectChecked();
811 obj->SetElement(1, *second, NONE, kNonStrictMode)->ToObjectChecked(); 811 obj->SetElement(1, *second, NONE, kNonStrictMode)->ToObjectChecked();
812 812
813 // Make the clone. 813 // Make the clone.
814 Handle<JSObject> clone = Copy(obj); 814 Handle<JSObject> clone = JSObject::Copy(obj);
815 CHECK(!clone.is_identical_to(obj)); 815 CHECK(!clone.is_identical_to(obj));
816 816
817 CHECK_EQ(obj->GetElement(0), clone->GetElement(0)); 817 CHECK_EQ(obj->GetElement(0), clone->GetElement(0));
818 CHECK_EQ(obj->GetElement(1), clone->GetElement(1)); 818 CHECK_EQ(obj->GetElement(1), clone->GetElement(1));
819 819
820 CHECK_EQ(obj->GetProperty(*first), clone->GetProperty(*first)); 820 CHECK_EQ(obj->GetProperty(*first), clone->GetProperty(*first));
821 CHECK_EQ(obj->GetProperty(*second), clone->GetProperty(*second)); 821 CHECK_EQ(obj->GetProperty(*second), clone->GetProperty(*second));
822 822
823 // Flip the values. 823 // Flip the values.
824 clone->SetProperty( 824 clone->SetProperty(
(...skipping 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after
3380 " var a = new Array(n);" 3380 " var a = new Array(n);"
3381 " for (var i = 0; i < n; i += 100) a[i] = i;" 3381 " for (var i = 0; i < n; i += 100) a[i] = i;"
3382 "};" 3382 "};"
3383 "f(10 * 1024 * 1024);"); 3383 "f(10 * 1024 * 1024);");
3384 IncrementalMarking* marking = HEAP->incremental_marking(); 3384 IncrementalMarking* marking = HEAP->incremental_marking();
3385 if (marking->IsStopped()) marking->Start(); 3385 if (marking->IsStopped()) marking->Start();
3386 // This big step should be sufficient to mark the whole array. 3386 // This big step should be sufficient to mark the whole array.
3387 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); 3387 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD);
3388 ASSERT(marking->IsComplete()); 3388 ASSERT(marking->IsComplete());
3389 } 3389 }
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