Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: src/runtime/runtime-operators.cc

Issue 1738883002: [runtime] Unify comparison operator runtime entries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698