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/messages.h" | 8 #include "src/messages.h" |
9 #include "src/runtime/runtime-utils.h" | 9 #include "src/runtime/runtime-utils.h" |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift); | 47 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift); |
48 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift); | 48 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift); |
49 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice); | 49 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice); |
50 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice); | 50 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice); |
51 InstallBuiltin(isolate, holder, "concat", Builtins::kArrayConcat); | 51 InstallBuiltin(isolate, holder, "concat", Builtins::kArrayConcat); |
52 | 52 |
53 return *holder; | 53 return *holder; |
54 } | 54 } |
55 | 55 |
56 | 56 |
| 57 RUNTIME_FUNCTION(Runtime_FixedArrayGet) { |
| 58 SealHandleScope shs(isolate); |
| 59 DCHECK(args.length() == 2); |
| 60 CONVERT_ARG_CHECKED(FixedArray, object, 0); |
| 61 CONVERT_SMI_ARG_CHECKED(index, 1); |
| 62 return object->get(index); |
| 63 } |
| 64 |
| 65 |
| 66 RUNTIME_FUNCTION(Runtime_FixedArraySet) { |
| 67 SealHandleScope shs(isolate); |
| 68 DCHECK(args.length() == 3); |
| 69 CONVERT_ARG_CHECKED(FixedArray, object, 0); |
| 70 CONVERT_SMI_ARG_CHECKED(index, 1); |
| 71 CONVERT_ARG_CHECKED(Object, value, 2); |
| 72 object->set(index, value); |
| 73 return isolate->heap()->undefined_value(); |
| 74 } |
| 75 |
| 76 |
57 RUNTIME_FUNCTION(Runtime_TransitionElementsKind) { | 77 RUNTIME_FUNCTION(Runtime_TransitionElementsKind) { |
58 HandleScope scope(isolate); | 78 HandleScope scope(isolate); |
59 RUNTIME_ASSERT(args.length() == 2); | 79 RUNTIME_ASSERT(args.length() == 2); |
60 CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); | 80 CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); |
61 CONVERT_ARG_HANDLE_CHECKED(Map, map, 1); | 81 CONVERT_ARG_HANDLE_CHECKED(Map, map, 1); |
62 JSObject::TransitionElementsKind(array, map->elements_kind()); | 82 JSObject::TransitionElementsKind(array, map->elements_kind()); |
63 return *array; | 83 return *array; |
64 } | 84 } |
65 | 85 |
66 | 86 |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 | 1412 |
1393 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { | 1413 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { |
1394 SealHandleScope shs(isolate); | 1414 SealHandleScope shs(isolate); |
1395 DCHECK(args.length() == 2); | 1415 DCHECK(args.length() == 2); |
1396 // Returning undefined means that this fast path fails and one has to resort | 1416 // Returning undefined means that this fast path fails and one has to resort |
1397 // to a slow path. | 1417 // to a slow path. |
1398 return isolate->heap()->undefined_value(); | 1418 return isolate->heap()->undefined_value(); |
1399 } | 1419 } |
1400 } | 1420 } |
1401 } // namespace v8::internal | 1421 } // namespace v8::internal |
OLD | NEW |