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 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 return *ncr; | 1045 return *ncr; |
1046 } | 1046 } |
1047 UNREACHABLE(); | 1047 UNREACHABLE(); |
1048 } | 1048 } |
1049 return isolate->heap()->exception(); | 1049 return isolate->heap()->exception(); |
1050 } | 1050 } |
1051 | 1051 |
1052 RUNTIME_FUNCTION(Runtime_HasInPrototypeChain) { | 1052 RUNTIME_FUNCTION(Runtime_HasInPrototypeChain) { |
1053 HandleScope scope(isolate); | 1053 HandleScope scope(isolate); |
1054 DCHECK_EQ(2, args.length()); | 1054 DCHECK_EQ(2, args.length()); |
1055 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, object, 0); | 1055 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
1056 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); | 1056 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
1057 Maybe<bool> result = | 1057 if (!object->IsJSReceiver()) return isolate->heap()->false_value(); |
1058 JSReceiver::HasInPrototypeChain(isolate, object, prototype); | 1058 Maybe<bool> result = JSReceiver::HasInPrototypeChain( |
| 1059 isolate, Handle<JSReceiver>::cast(object), prototype); |
1059 MAYBE_RETURN(result, isolate->heap()->exception()); | 1060 MAYBE_RETURN(result, isolate->heap()->exception()); |
1060 return isolate->heap()->ToBoolean(result.FromJust()); | 1061 return isolate->heap()->ToBoolean(result.FromJust()); |
1061 } | 1062 } |
1062 | 1063 |
1063 | 1064 |
1064 // ES6 section 7.4.7 CreateIterResultObject ( value, done ) | 1065 // ES6 section 7.4.7 CreateIterResultObject ( value, done ) |
1065 RUNTIME_FUNCTION(Runtime_CreateIterResultObject) { | 1066 RUNTIME_FUNCTION(Runtime_CreateIterResultObject) { |
1066 HandleScope scope(isolate); | 1067 HandleScope scope(isolate); |
1067 DCHECK_EQ(2, args.length()); | 1068 DCHECK_EQ(2, args.length()); |
1068 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); | 1069 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 // While iteration alone may not have observable side-effects, calling | 1119 // While iteration alone may not have observable side-effects, calling |
1119 // toNumber on an object will. Make sure the arg is not an array of objects. | 1120 // toNumber on an object will. Make sure the arg is not an array of objects. |
1120 ElementsKind kind = JSObject::cast(*obj)->GetElementsKind(); | 1121 ElementsKind kind = JSObject::cast(*obj)->GetElementsKind(); |
1121 if (!IsFastNumberElementsKind(kind)) return isolate->heap()->ToBoolean(false); | 1122 if (!IsFastNumberElementsKind(kind)) return isolate->heap()->ToBoolean(false); |
1122 | 1123 |
1123 return isolate->heap()->ToBoolean(!obj->IterationHasObservableEffects()); | 1124 return isolate->heap()->ToBoolean(!obj->IterationHasObservableEffects()); |
1124 } | 1125 } |
1125 | 1126 |
1126 } // namespace internal | 1127 } // namespace internal |
1127 } // namespace v8 | 1128 } // namespace v8 |
OLD | NEW |