OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/runtime/runtime-utils.h" | 8 #include "src/runtime/runtime-utils.h" |
9 | 9 |
10 | 10 |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 SealHandleScope shs(isolate); | 292 SealHandleScope shs(isolate); |
293 DCHECK(args.length() == 2); | 293 DCHECK(args.length() == 2); |
294 CONVERT_ARG_CHECKED(JSMapIterator, holder, 0); | 294 CONVERT_ARG_CHECKED(JSMapIterator, holder, 0); |
295 CONVERT_ARG_CHECKED(JSArray, value_array, 1); | 295 CONVERT_ARG_CHECKED(JSArray, value_array, 1); |
296 return holder->Next(value_array); | 296 return holder->Next(value_array); |
297 } | 297 } |
298 | 298 |
299 | 299 |
300 void Runtime::WeakCollectionInitialize( | 300 void Runtime::WeakCollectionInitialize( |
301 Isolate* isolate, Handle<JSWeakCollection> weak_collection) { | 301 Isolate* isolate, Handle<JSWeakCollection> weak_collection) { |
302 DCHECK(weak_collection->map()->inobject_properties() == 0); | 302 DCHECK_EQ(0, weak_collection->map()->GetInObjectProperties()); |
303 Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 0); | 303 Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 0); |
304 weak_collection->set_table(*table); | 304 weak_collection->set_table(*table); |
305 } | 305 } |
306 | 306 |
307 | 307 |
308 RUNTIME_FUNCTION(Runtime_WeakCollectionInitialize) { | 308 RUNTIME_FUNCTION(Runtime_WeakCollectionInitialize) { |
309 HandleScope scope(isolate); | 309 HandleScope scope(isolate); |
310 DCHECK(args.length() == 1); | 310 DCHECK(args.length() == 1); |
311 CONVERT_ARG_HANDLE_CHECKED(JSWeakCollection, weak_collection, 0); | 311 CONVERT_ARG_HANDLE_CHECKED(JSWeakCollection, weak_collection, 0); |
312 Runtime::WeakCollectionInitialize(isolate, weak_collection); | 312 Runtime::WeakCollectionInitialize(isolate, weak_collection); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 449 |
450 RUNTIME_FUNCTION(Runtime_ObservationWeakMapCreate) { | 450 RUNTIME_FUNCTION(Runtime_ObservationWeakMapCreate) { |
451 HandleScope scope(isolate); | 451 HandleScope scope(isolate); |
452 DCHECK(args.length() == 0); | 452 DCHECK(args.length() == 0); |
453 Handle<JSWeakMap> weakmap = isolate->factory()->NewJSWeakMap(); | 453 Handle<JSWeakMap> weakmap = isolate->factory()->NewJSWeakMap(); |
454 Runtime::WeakCollectionInitialize(isolate, weakmap); | 454 Runtime::WeakCollectionInitialize(isolate, weakmap); |
455 return *weakmap; | 455 return *weakmap; |
456 } | 456 } |
457 } // namespace internal | 457 } // namespace internal |
458 } // namespace v8 | 458 } // namespace v8 |
OLD | NEW |