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