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 5224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5235 } | 5235 } |
5236 | 5236 |
5237 | 5237 |
5238 Handle<WeakCell> AddRetainedMap(Isolate* isolate, Heap* heap) { | 5238 Handle<WeakCell> AddRetainedMap(Isolate* isolate, Heap* heap) { |
5239 HandleScope inner_scope(isolate); | 5239 HandleScope inner_scope(isolate); |
5240 Handle<Map> map = Map::Create(isolate, 1); | 5240 Handle<Map> map = Map::Create(isolate, 1); |
5241 v8::Local<v8::Value> result = | 5241 v8::Local<v8::Value> result = |
5242 CompileRun("(function () { return {x : 10}; })();"); | 5242 CompileRun("(function () { return {x : 10}; })();"); |
5243 Handle<JSObject> proto = | 5243 Handle<JSObject> proto = |
5244 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result)); | 5244 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result)); |
5245 map->set_prototype(*proto); | 5245 Map::SetPrototype(map, proto); |
5246 heap->AddRetainedMap(map); | 5246 heap->AddRetainedMap(map); |
5247 return inner_scope.CloseAndEscape(Map::WeakCellForMap(map)); | 5247 return inner_scope.CloseAndEscape(Map::WeakCellForMap(map)); |
5248 } | 5248 } |
5249 | 5249 |
5250 | 5250 |
5251 void CheckMapRetainingFor(int n) { | 5251 void CheckMapRetainingFor(int n) { |
5252 FLAG_retain_maps_for_n_gc = n; | 5252 FLAG_retain_maps_for_n_gc = n; |
5253 Isolate* isolate = CcTest::i_isolate(); | 5253 Isolate* isolate = CcTest::i_isolate(); |
5254 Heap* heap = isolate->heap(); | 5254 Heap* heap = isolate->heap(); |
5255 Handle<WeakCell> weak_cell = AddRetainedMap(isolate, heap); | 5255 Handle<WeakCell> weak_cell = AddRetainedMap(isolate, heap); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5359 TestRightTrimFixedTypedArray(v8::kExternalUint32Array, 8, 6); | 5359 TestRightTrimFixedTypedArray(v8::kExternalUint32Array, 8, 6); |
5360 TestRightTrimFixedTypedArray(v8::kExternalUint32Array, 8 - 1, 6); | 5360 TestRightTrimFixedTypedArray(v8::kExternalUint32Array, 8 - 1, 6); |
5361 | 5361 |
5362 // 32-bit cases. | 5362 // 32-bit cases. |
5363 TestRightTrimFixedTypedArray(v8::kExternalUint8Array, 16, 3); | 5363 TestRightTrimFixedTypedArray(v8::kExternalUint8Array, 16, 3); |
5364 TestRightTrimFixedTypedArray(v8::kExternalUint8Array, 16 - 3, 3); | 5364 TestRightTrimFixedTypedArray(v8::kExternalUint8Array, 16 - 3, 3); |
5365 TestRightTrimFixedTypedArray(v8::kExternalUint16Array, 8, 3); | 5365 TestRightTrimFixedTypedArray(v8::kExternalUint16Array, 8, 3); |
5366 TestRightTrimFixedTypedArray(v8::kExternalUint16Array, 8 - 1, 3); | 5366 TestRightTrimFixedTypedArray(v8::kExternalUint16Array, 8 - 1, 3); |
5367 TestRightTrimFixedTypedArray(v8::kExternalUint32Array, 4, 3); | 5367 TestRightTrimFixedTypedArray(v8::kExternalUint32Array, 4, 3); |
5368 } | 5368 } |
OLD | NEW |