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 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 | 14 |
15 RUNTIME_FUNCTION(Runtime_StringGetRawHashField) { | 15 RUNTIME_FUNCTION(Runtime_StringGetRawHashField) { |
16 HandleScope scope(isolate); | 16 HandleScope scope(isolate); |
17 DCHECK(args.length() == 1); | 17 DCHECK(args.length() == 1); |
18 CONVERT_ARG_HANDLE_CHECKED(String, string, 0); | 18 CONVERT_ARG_HANDLE_CHECKED(String, string, 0); |
19 return *isolate->factory()->NewNumberFromUint(string->hash_field()); | 19 return *isolate->factory()->NewNumberFromUint(string->hash_field()); |
20 } | 20 } |
21 | 21 |
22 | 22 |
23 RUNTIME_FUNCTION(Runtime_TheHole) { | 23 RUNTIME_FUNCTION(Runtime_TheHole) { |
24 SealHandleScope shs(isolate); | 24 SealHandleScope shs(isolate); |
25 DCHECK(args.length() == 0); | 25 DCHECK(args.length() == 0); |
26 return isolate->heap()->the_hole_value(); | 26 return isolate->heap()->the_hole_value(); |
27 } | 27 } |
28 | 28 |
29 | 29 |
30 RUNTIME_FUNCTION(Runtime_FixedArrayGet) { | |
31 SealHandleScope shs(isolate); | |
32 DCHECK(args.length() == 2); | |
33 CONVERT_ARG_CHECKED(FixedArray, object, 0); | |
34 CONVERT_SMI_ARG_CHECKED(index, 1); | |
35 return object->get(index); | |
36 } | |
37 | |
38 | |
39 RUNTIME_FUNCTION(Runtime_FixedArraySet) { | |
40 SealHandleScope shs(isolate); | |
41 DCHECK(args.length() == 3); | |
42 CONVERT_ARG_CHECKED(FixedArray, object, 0); | |
43 CONVERT_SMI_ARG_CHECKED(index, 1); | |
44 CONVERT_ARG_CHECKED(Object, value, 2); | |
45 object->set(index, value); | |
46 return isolate->heap()->undefined_value(); | |
47 } | |
48 | |
49 | |
50 RUNTIME_FUNCTION(Runtime_JSCollectionGetTable) { | 30 RUNTIME_FUNCTION(Runtime_JSCollectionGetTable) { |
51 SealHandleScope shs(isolate); | 31 SealHandleScope shs(isolate); |
52 DCHECK(args.length() == 1); | 32 DCHECK(args.length() == 1); |
53 CONVERT_ARG_CHECKED(JSObject, object, 0); | 33 CONVERT_ARG_CHECKED(JSObject, object, 0); |
54 RUNTIME_ASSERT(object->IsJSSet() || object->IsJSMap()); | 34 RUNTIME_ASSERT(object->IsJSSet() || object->IsJSMap()); |
55 return static_cast<JSCollection*>(object)->table(); | 35 return static_cast<JSCollection*>(object)->table(); |
56 } | 36 } |
57 | 37 |
58 | 38 |
59 RUNTIME_FUNCTION(Runtime_GenericHash) { | 39 RUNTIME_FUNCTION(Runtime_GenericHash) { |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 | 415 |
436 RUNTIME_FUNCTION(Runtime_ObservationWeakMapCreate) { | 416 RUNTIME_FUNCTION(Runtime_ObservationWeakMapCreate) { |
437 HandleScope scope(isolate); | 417 HandleScope scope(isolate); |
438 DCHECK(args.length() == 0); | 418 DCHECK(args.length() == 0); |
439 Handle<JSWeakMap> weakmap = isolate->factory()->NewJSWeakMap(); | 419 Handle<JSWeakMap> weakmap = isolate->factory()->NewJSWeakMap(); |
440 Runtime::WeakCollectionInitialize(isolate, weakmap); | 420 Runtime::WeakCollectionInitialize(isolate, weakmap); |
441 return *weakmap; | 421 return *weakmap; |
442 } | 422 } |
443 } | 423 } |
444 } // namespace v8::internal | 424 } // namespace v8::internal |
OLD | NEW |