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/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 | 830 |
831 | 831 |
832 RUNTIME_FUNCTION(Runtime_ToPrimitive_Number) { | 832 RUNTIME_FUNCTION(Runtime_ToPrimitive_Number) { |
833 HandleScope scope(isolate); | 833 HandleScope scope(isolate); |
834 DCHECK_EQ(1, args.length()); | 834 DCHECK_EQ(1, args.length()); |
835 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); | 835 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); |
836 RETURN_RESULT_OR_FAILURE( | 836 RETURN_RESULT_OR_FAILURE( |
837 isolate, Object::ToPrimitive(input, ToPrimitiveHint::kNumber)); | 837 isolate, Object::ToPrimitive(input, ToPrimitiveHint::kNumber)); |
838 } | 838 } |
839 | 839 |
840 | |
841 RUNTIME_FUNCTION(Runtime_ToNumber) { | 840 RUNTIME_FUNCTION(Runtime_ToNumber) { |
842 HandleScope scope(isolate); | 841 HandleScope scope(isolate); |
843 DCHECK_EQ(1, args.length()); | 842 DCHECK_EQ(1, args.length()); |
844 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); | 843 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); |
845 RETURN_RESULT_OR_FAILURE(isolate, Object::ToNumber(input)); | 844 RETURN_RESULT_OR_FAILURE(isolate, Object::ToNumber(input)); |
846 } | 845 } |
847 | 846 |
848 | 847 |
849 RUNTIME_FUNCTION(Runtime_ToInteger) { | 848 RUNTIME_FUNCTION(Runtime_ToInteger) { |
850 HandleScope scope(isolate); | 849 HandleScope scope(isolate); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 isolate, o, key, &success, LookupIterator::OWN); | 965 isolate, o, key, &success, LookupIterator::OWN); |
967 if (!success) return isolate->heap()->exception(); | 966 if (!success) return isolate->heap()->exception(); |
968 MAYBE_RETURN( | 967 MAYBE_RETURN( |
969 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), | 968 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), |
970 isolate->heap()->exception()); | 969 isolate->heap()->exception()); |
971 return *value; | 970 return *value; |
972 } | 971 } |
973 | 972 |
974 } // namespace internal | 973 } // namespace internal |
975 } // namespace v8 | 974 } // namespace v8 |
OLD | NEW |