| OLD | NEW |
| 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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 | 1137 |
| 1138 v8::HandleScope scope(CcTest::isolate()); | 1138 v8::HandleScope scope(CcTest::isolate()); |
| 1139 | 1139 |
| 1140 // The plan: create JSObject which references objects in new space. | 1140 // The plan: create JSObject which references objects in new space. |
| 1141 // Then clone this object (forcing it to go into old space) and check | 1141 // Then clone this object (forcing it to go into old space) and check |
| 1142 // that region dirty marks are updated correctly. | 1142 // that region dirty marks are updated correctly. |
| 1143 | 1143 |
| 1144 // Step 1: prepare a map for the object. We add 1 inobject property to it. | 1144 // Step 1: prepare a map for the object. We add 1 inobject property to it. |
| 1145 // Create a map with single inobject property. | 1145 // Create a map with single inobject property. |
| 1146 Handle<Map> my_map = Map::Create(CcTest::i_isolate(), 1); | 1146 Handle<Map> my_map = Map::Create(CcTest::i_isolate(), 1); |
| 1147 int n_properties = my_map->inobject_properties(); | 1147 int n_properties = my_map->GetInObjectProperties(); |
| 1148 CHECK_GT(n_properties, 0); | 1148 CHECK_GT(n_properties, 0); |
| 1149 | 1149 |
| 1150 int object_size = my_map->instance_size(); | 1150 int object_size = my_map->instance_size(); |
| 1151 | 1151 |
| 1152 // Step 2: allocate a lot of objects so to almost fill new space: we need | 1152 // Step 2: allocate a lot of objects so to almost fill new space: we need |
| 1153 // just enough room to allocate JSObject and thus fill the newspace. | 1153 // just enough room to allocate JSObject and thus fill the newspace. |
| 1154 | 1154 |
| 1155 int allocation_amount = Min(FixedArray::kMaxSize, | 1155 int allocation_amount = Min(FixedArray::kMaxSize, |
| 1156 Page::kMaxRegularHeapObjectSize + kPointerSize); | 1156 Page::kMaxRegularHeapObjectSize + kPointerSize); |
| 1157 int allocation_len = LenFromSize(allocation_amount); | 1157 int allocation_len = LenFromSize(allocation_amount); |
| (...skipping 5222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6380 | 6380 |
| 6381 PrintF("Context size : %d bytes\n", measure.Size()); | 6381 PrintF("Context size : %d bytes\n", measure.Size()); |
| 6382 PrintF("Context object count: %d\n", measure.Count()); | 6382 PrintF("Context object count: %d\n", measure.Count()); |
| 6383 | 6383 |
| 6384 CHECK_LE(1000, measure.Count()); | 6384 CHECK_LE(1000, measure.Count()); |
| 6385 CHECK_LE(50000, measure.Size()); | 6385 CHECK_LE(50000, measure.Size()); |
| 6386 | 6386 |
| 6387 CHECK_LE(measure.Count(), count_upper_limit); | 6387 CHECK_LE(measure.Count(), count_upper_limit); |
| 6388 CHECK_LE(measure.Size(), size_upper_limit); | 6388 CHECK_LE(measure.Size(), size_upper_limit); |
| 6389 } | 6389 } |
| OLD | NEW |