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

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

Issue 1239593003: Fix memento initialization when constructing from new call (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comment Created 5 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
« no previous file with comments | « src/x64/builtins-x64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 // Force GC to test the poisoned memento handling 95 // Force GC to test the poisoned memento handling
96 CcTest::i_isolate()->heap()->CollectGarbage(i::NEW_SPACE); 96 CcTest::i_isolate()->heap()->CollectGarbage(i::NEW_SPACE);
97 } 97 }
98 98
99 99
100 TEST(PretenuringCallNew) { 100 TEST(PretenuringCallNew) {
101 CcTest::InitializeVM(); 101 CcTest::InitializeVM();
102 if (!i::FLAG_allocation_site_pretenuring) return; 102 if (!i::FLAG_allocation_site_pretenuring) return;
103 if (!i::FLAG_pretenuring_call_new) return; 103 if (!i::FLAG_pretenuring_call_new) return;
104 if (i::FLAG_always_opt) return;
104 105
105 v8::HandleScope scope(CcTest::isolate()); 106 v8::HandleScope scope(CcTest::isolate());
106 Isolate* isolate = CcTest::i_isolate(); 107 Isolate* isolate = CcTest::i_isolate();
107 Heap* heap = isolate->heap(); 108 Heap* heap = isolate->heap();
108 109
109 int call_count = 10; 110 int call_count = 10;
110 i::ScopedVector<char> test_buf(1024); 111 i::ScopedVector<char> test_buf(1024);
111 const char* program = 112 const char* program =
112 "function f() {" 113 "function f() {"
113 " this.a = 3;" 114 " this.a = 3;"
(...skipping 15 matching lines...) Expand all
129 AllocationMemento* memento = 130 AllocationMemento* memento =
130 reinterpret_cast<AllocationMemento*>(memento_address + kHeapObjectTag); 131 reinterpret_cast<AllocationMemento*>(memento_address + kHeapObjectTag);
131 CHECK_EQ(memento->map(), heap->allocation_memento_map()); 132 CHECK_EQ(memento->map(), heap->allocation_memento_map());
132 133
133 // Furthermore, how many mementos did we create? The count should match 134 // Furthermore, how many mementos did we create? The count should match
134 // call_count. Note, that mementos are allocated during the inobject slack 135 // call_count. Note, that mementos are allocated during the inobject slack
135 // tracking phase. 136 // tracking phase.
136 AllocationSite* site = memento->GetAllocationSite(); 137 AllocationSite* site = memento->GetAllocationSite();
137 CHECK_EQ(call_count, site->pretenure_create_count()->value()); 138 CHECK_EQ(call_count, site->pretenure_create_count()->value());
138 } 139 }
OLDNEW
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698