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

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

Issue 1980483003: [es6] Reintroduce the instanceof operator in the backends. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Igors comments. Created 4 years, 7 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/builtins-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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 RUNTIME_FUNCTION(Runtime_GreaterThanOrEqual) { 209 RUNTIME_FUNCTION(Runtime_GreaterThanOrEqual) {
210 HandleScope scope(isolate); 210 HandleScope scope(isolate);
211 DCHECK_EQ(2, args.length()); 211 DCHECK_EQ(2, args.length());
212 CONVERT_ARG_HANDLE_CHECKED(Object, x, 0); 212 CONVERT_ARG_HANDLE_CHECKED(Object, x, 0);
213 CONVERT_ARG_HANDLE_CHECKED(Object, y, 1); 213 CONVERT_ARG_HANDLE_CHECKED(Object, y, 1);
214 Maybe<bool> result = Object::GreaterThanOrEqual(x, y); 214 Maybe<bool> result = Object::GreaterThanOrEqual(x, y);
215 if (!result.IsJust()) return isolate->heap()->exception(); 215 if (!result.IsJust()) return isolate->heap()->exception();
216 return isolate->heap()->ToBoolean(result.FromJust()); 216 return isolate->heap()->ToBoolean(result.FromJust());
217 } 217 }
218 218
219 RUNTIME_FUNCTION(Runtime_InstanceOf) {
220 HandleScope shs(isolate);
221 DCHECK_EQ(2, args.length());
222 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
223 CONVERT_ARG_HANDLE_CHECKED(Object, callable, 1);
224 Handle<Object> result;
225 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
226 isolate, result, Object::InstanceOf(isolate, object, callable));
227 return *result;
228 }
229
219 } // namespace internal 230 } // namespace internal
220 } // namespace v8 231 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698