| 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/conversions-inl.h" | 8 #include "src/conversions-inl.h" |
| 9 #include "src/factory.h" | 9 #include "src/factory.h" |
| 10 | 10 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 318 |
| 319 | 319 |
| 320 RUNTIME_FUNCTION(Runtime_GetWeakSetValues) { | 320 RUNTIME_FUNCTION(Runtime_GetWeakSetValues) { |
| 321 HandleScope scope(isolate); | 321 HandleScope scope(isolate); |
| 322 DCHECK_EQ(2, args.length()); | 322 DCHECK_EQ(2, args.length()); |
| 323 CONVERT_ARG_HANDLE_CHECKED(JSWeakCollection, holder, 0); | 323 CONVERT_ARG_HANDLE_CHECKED(JSWeakCollection, holder, 0); |
| 324 CONVERT_NUMBER_CHECKED(int, max_values, Int32, args[1]); | 324 CONVERT_NUMBER_CHECKED(int, max_values, Int32, args[1]); |
| 325 CHECK(max_values >= 0); | 325 CHECK(max_values >= 0); |
| 326 return *JSWeakCollection::GetEntries(holder, max_values); | 326 return *JSWeakCollection::GetEntries(holder, max_values); |
| 327 } | 327 } |
| 328 |
| 329 RUNTIME_FUNCTION(Runtime_WeakRefInitialize) { |
| 330 HandleScope scope(isolate); |
| 331 DCHECK_EQ(3, args.length()); |
| 332 CONVERT_ARG_HANDLE_CHECKED(JSWeakRef, weak_ref, 0); |
| 333 CONVERT_ARG_HANDLE_CHECKED(JSObject, target, 1); |
| 334 CONVERT_ARG_HANDLE_CHECKED(JSFunction, executor, 2); |
| 335 CONVERT_ARG_HANDLE_CHECKED(Object, holdings, 3); |
| 336 JSWeakRef::Initialize(weak_ref, isolate, target, executor, holdings); |
| 337 return *weak_ref; |
| 338 } |
| 339 |
| 340 RUNTIME_FUNCTION(Runtime_WeakRefValue) { |
| 341 HandleScope scope(isolate); |
| 342 DCHECK_EQ(1, args.length()); |
| 343 CONVERT_ARG_HANDLE_CHECKED(JSWeakRef, weak_ref, 0); |
| 344 Handle<Object> value = JSWeakRef::Value(weak_ref, isolate); |
| 345 weak_ref->set_held(true); |
| 346 return *value; |
| 347 } |
| 348 |
| 349 RUNTIME_FUNCTION(Runtime_WeakRefClear) { |
| 350 HandleScope scope(isolate); |
| 351 DCHECK_EQ(1, args.length()); |
| 352 CONVERT_ARG_HANDLE_CHECKED(JSWeakRef, weak_ref, 0); |
| 353 JSWeakRef::Clear(weak_ref, isolate); |
| 354 return isolate->heap()->undefined_value(); |
| 355 } |
| 328 } // namespace internal | 356 } // namespace internal |
| 329 } // namespace v8 | 357 } // namespace v8 |
| OLD | NEW |