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/arguments.h" | 5 #include "src/arguments.h" |
6 #include "src/isolate-inl.h" | 6 #include "src/isolate-inl.h" |
7 #include "src/runtime/runtime-utils.h" | 7 #include "src/runtime/runtime-utils.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 HandleScope scope(isolate); | 133 HandleScope scope(isolate); |
134 DCHECK_EQ(2, args.length()); | 134 DCHECK_EQ(2, args.length()); |
135 CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0); | 135 CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0); |
136 CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1); | 136 CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1); |
137 Handle<Object> result; | 137 Handle<Object> result; |
138 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 138 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
139 Object::BitwiseXor(isolate, lhs, rhs)); | 139 Object::BitwiseXor(isolate, lhs, rhs)); |
140 return *result; | 140 return *result; |
141 } | 141 } |
142 | 142 |
| 143 RUNTIME_FUNCTION(Runtime_Equals) { |
| 144 HandleScope scope(isolate); |
| 145 DCHECK_EQ(2, args.length()); |
| 146 CONVERT_ARG_HANDLE_CHECKED(Object, x, 0); |
| 147 CONVERT_ARG_HANDLE_CHECKED(Object, y, 1); |
| 148 Maybe<bool> result = Object::Equals(x, y); |
| 149 if (!result.IsJust()) return isolate->heap()->exception(); |
| 150 return isolate->heap()->ToBoolean(result.FromJust()); |
| 151 } |
| 152 |
| 153 RUNTIME_FUNCTION(Runtime_NotEquals) { |
| 154 HandleScope scope(isolate); |
| 155 DCHECK_EQ(2, args.length()); |
| 156 CONVERT_ARG_HANDLE_CHECKED(Object, x, 0); |
| 157 CONVERT_ARG_HANDLE_CHECKED(Object, y, 1); |
| 158 Maybe<bool> result = Object::Equals(x, y); |
| 159 if (!result.IsJust()) return isolate->heap()->exception(); |
| 160 return isolate->heap()->ToBoolean(!result.FromJust()); |
| 161 } |
| 162 |
| 163 RUNTIME_FUNCTION(Runtime_StrictEquals) { |
| 164 SealHandleScope scope(isolate); |
| 165 DCHECK_EQ(2, args.length()); |
| 166 CONVERT_ARG_CHECKED(Object, x, 0); |
| 167 CONVERT_ARG_CHECKED(Object, y, 1); |
| 168 return isolate->heap()->ToBoolean(x->StrictEquals(y)); |
| 169 } |
| 170 |
| 171 RUNTIME_FUNCTION(Runtime_StrictNotEquals) { |
| 172 SealHandleScope scope(isolate); |
| 173 DCHECK_EQ(2, args.length()); |
| 174 CONVERT_ARG_CHECKED(Object, x, 0); |
| 175 CONVERT_ARG_CHECKED(Object, y, 1); |
| 176 return isolate->heap()->ToBoolean(!x->StrictEquals(y)); |
| 177 } |
| 178 |
143 } // namespace internal | 179 } // namespace internal |
144 } // namespace v8 | 180 } // namespace v8 |
OLD | NEW |