Chromium Code Reviews| 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 namespace v8 { | 10 namespace v8 { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift); | 46 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift); |
| 47 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift); | 47 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift); |
| 48 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice); | 48 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice); |
| 49 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice); | 49 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice); |
| 50 InstallBuiltin(isolate, holder, "concat", Builtins::kArrayConcat); | 50 InstallBuiltin(isolate, holder, "concat", Builtins::kArrayConcat); |
| 51 | 51 |
| 52 return *holder; | 52 return *holder; |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 RUNTIME_FUNCTION(Runtime_FixedArrayGet) { | |
| 57 SealHandleScope shs(isolate); | |
| 58 DCHECK(args.length() == 2); | |
| 59 CONVERT_ARG_CHECKED(FixedArray, object, 0); | |
| 60 CONVERT_SMI_ARG_CHECKED(index, 1); | |
| 61 return object->get(index); | |
| 62 } | |
| 63 | |
| 64 | |
| 65 RUNTIME_FUNCTION(Runtime_FixedArraySet) { | |
| 66 SealHandleScope shs(isolate); | |
| 67 DCHECK(args.length() == 3); | |
| 68 CONVERT_ARG_CHECKED(FixedArray, object, 0); | |
| 69 CONVERT_SMI_ARG_CHECKED(index, 1); | |
| 70 CONVERT_ARG_CHECKED(Object, value, 2); | |
| 71 object->set(index, value); | |
| 72 return isolate->heap()->undefined_value(); | |
| 73 } | |
| 74 | |
| 75 | |
| 76 RUNTIME_FUNCTION(Runtime_GetTypeFeedbackVector) { | |
|
Benedikt Meurer
2015/05/11 04:40:12
runtime-array.cc doesn't seems to be a good candid
danno
2015/05/11 06:14:19
Done.
| |
| 77 SealHandleScope shs(isolate); | |
| 78 DCHECK(args.length() == 1); | |
| 79 CONVERT_ARG_CHECKED(JSFunction, function, 0); | |
| 80 return function->shared()->feedback_vector(); | |
| 81 } | |
| 82 | |
| 83 | |
| 56 RUNTIME_FUNCTION(Runtime_TransitionElementsKind) { | 84 RUNTIME_FUNCTION(Runtime_TransitionElementsKind) { |
| 57 HandleScope scope(isolate); | 85 HandleScope scope(isolate); |
| 58 RUNTIME_ASSERT(args.length() == 2); | 86 RUNTIME_ASSERT(args.length() == 2); |
| 59 CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); | 87 CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); |
| 60 CONVERT_ARG_HANDLE_CHECKED(Map, map, 1); | 88 CONVERT_ARG_HANDLE_CHECKED(Map, map, 1); |
| 61 JSObject::TransitionElementsKind(array, map->elements_kind()); | 89 JSObject::TransitionElementsKind(array, map->elements_kind()); |
| 62 return *array; | 90 return *array; |
| 63 } | 91 } |
| 64 | 92 |
| 65 | 93 |
| (...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1392 | 1420 |
| 1393 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { | 1421 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { |
| 1394 SealHandleScope shs(isolate); | 1422 SealHandleScope shs(isolate); |
| 1395 DCHECK(args.length() == 2); | 1423 DCHECK(args.length() == 2); |
| 1396 // Returning undefined means that this fast path fails and one has to resort | 1424 // Returning undefined means that this fast path fails and one has to resort |
| 1397 // to a slow path. | 1425 // to a slow path. |
| 1398 return isolate->heap()->undefined_value(); | 1426 return isolate->heap()->undefined_value(); |
| 1399 } | 1427 } |
| 1400 } | 1428 } |
| 1401 } // namespace v8::internal | 1429 } // namespace v8::internal |
| OLD | NEW |