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

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

Issue 1695743003: [builtins] Support SameValue and SameValueZero via runtime functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address bug in SameValue and SameValueZero for SIMD types. Created 4 years, 10 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.h ('k') | src/runtime/runtime-simd.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/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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 RUNTIME_FUNCTION(Runtime_StrictEquals) { 1125 RUNTIME_FUNCTION(Runtime_StrictEquals) {
1126 SealHandleScope scope(isolate); 1126 SealHandleScope scope(isolate);
1127 DCHECK_EQ(2, args.length()); 1127 DCHECK_EQ(2, args.length());
1128 CONVERT_ARG_CHECKED(Object, x, 0); 1128 CONVERT_ARG_CHECKED(Object, x, 0);
1129 CONVERT_ARG_CHECKED(Object, y, 1); 1129 CONVERT_ARG_CHECKED(Object, y, 1);
1130 // TODO(bmeurer): Change this at some point to return true/false instead. 1130 // TODO(bmeurer): Change this at some point to return true/false instead.
1131 return Smi::FromInt(x->StrictEquals(y) ? EQUAL : NOT_EQUAL); 1131 return Smi::FromInt(x->StrictEquals(y) ? EQUAL : NOT_EQUAL);
1132 } 1132 }
1133 1133
1134 1134
1135 RUNTIME_FUNCTION(Runtime_SameValue) {
1136 SealHandleScope scope(isolate);
1137 DCHECK_EQ(2, args.length());
1138 CONVERT_ARG_CHECKED(Object, x, 0);
1139 CONVERT_ARG_CHECKED(Object, y, 1);
1140 return isolate->heap()->ToBoolean(x->SameValue(y));
1141 }
1142
1143
1144 RUNTIME_FUNCTION(Runtime_SameValueZero) {
1145 SealHandleScope scope(isolate);
1146 DCHECK_EQ(2, args.length());
1147 CONVERT_ARG_CHECKED(Object, x, 0);
1148 CONVERT_ARG_CHECKED(Object, y, 1);
1149 return isolate->heap()->ToBoolean(x->SameValueZero(y));
1150 }
1151
1152
1135 // TODO(bmeurer): Kill this special wrapper and use TF compatible LessThan, 1153 // TODO(bmeurer): Kill this special wrapper and use TF compatible LessThan,
1136 // GreaterThan, etc. which return true or false. 1154 // GreaterThan, etc. which return true or false.
1137 RUNTIME_FUNCTION(Runtime_Compare) { 1155 RUNTIME_FUNCTION(Runtime_Compare) {
1138 HandleScope scope(isolate); 1156 HandleScope scope(isolate);
1139 DCHECK_EQ(3, args.length()); 1157 DCHECK_EQ(3, args.length());
1140 CONVERT_ARG_HANDLE_CHECKED(Object, x, 0); 1158 CONVERT_ARG_HANDLE_CHECKED(Object, x, 0);
1141 CONVERT_ARG_HANDLE_CHECKED(Object, y, 1); 1159 CONVERT_ARG_HANDLE_CHECKED(Object, y, 1);
1142 CONVERT_ARG_HANDLE_CHECKED(Object, ncr, 2); 1160 CONVERT_ARG_HANDLE_CHECKED(Object, ncr, 2);
1143 Maybe<ComparisonResult> result = Object::Compare(x, y); 1161 Maybe<ComparisonResult> result = Object::Compare(x, y);
1144 if (result.IsJust()) { 1162 if (result.IsJust()) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 DCHECK(args.length() == 2); 1269 DCHECK(args.length() == 2);
1252 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); 1270 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0);
1253 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); 1271 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1);
1254 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1272 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1255 isolate, o, JSReceiver::DefineProperties(isolate, o, properties)); 1273 isolate, o, JSReceiver::DefineProperties(isolate, o, properties));
1256 return *o; 1274 return *o;
1257 } 1275 }
1258 1276
1259 } // namespace internal 1277 } // namespace internal
1260 } // namespace v8 1278 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-simd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698