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

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

Issue 2930243002: [WIP] Refactor OrdinaryHasInstance to be self-contained.
Patch Set: Created 3 years, 6 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-operators.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 <memory> 7 #include <memory>
8 8
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 RUNTIME_FUNCTION(Runtime_ThrowIncompatibleMethodReceiver) { 231 RUNTIME_FUNCTION(Runtime_ThrowIncompatibleMethodReceiver) {
232 HandleScope scope(isolate); 232 HandleScope scope(isolate);
233 DCHECK_EQ(2, args.length()); 233 DCHECK_EQ(2, args.length());
234 CONVERT_ARG_HANDLE_CHECKED(Object, arg0, 0); 234 CONVERT_ARG_HANDLE_CHECKED(Object, arg0, 0);
235 CONVERT_ARG_HANDLE_CHECKED(Object, arg1, 1); 235 CONVERT_ARG_HANDLE_CHECKED(Object, arg1, 1);
236 THROW_NEW_ERROR_RETURN_FAILURE( 236 THROW_NEW_ERROR_RETURN_FAILURE(
237 isolate, 237 isolate,
238 NewTypeError(MessageTemplate::kIncompatibleMethodReceiver, arg0, arg1)); 238 NewTypeError(MessageTemplate::kIncompatibleMethodReceiver, arg0, arg1));
239 } 239 }
240 240
241 RUNTIME_FUNCTION(Runtime_ThrowInstanceofNonobjectProto) {
242 HandleScope scope(isolate);
243 DCHECK_EQ(1, args.length());
244 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 0);
245 THROW_NEW_ERROR_RETURN_FAILURE(
246 isolate,
247 NewTypeError(MessageTemplate::kInstanceofNonobjectProto, prototype));
248 }
249
241 RUNTIME_FUNCTION(Runtime_ThrowInvalidHint) { 250 RUNTIME_FUNCTION(Runtime_ThrowInvalidHint) {
242 HandleScope scope(isolate); 251 HandleScope scope(isolate);
243 DCHECK_EQ(1, args.length()); 252 DCHECK_EQ(1, args.length());
244 CONVERT_ARG_HANDLE_CHECKED(Object, hint, 0); 253 CONVERT_ARG_HANDLE_CHECKED(Object, hint, 0);
245 THROW_NEW_ERROR_RETURN_FAILURE( 254 THROW_NEW_ERROR_RETURN_FAILURE(
246 isolate, NewTypeError(MessageTemplate::kInvalidHint, hint)); 255 isolate, NewTypeError(MessageTemplate::kInvalidHint, hint));
247 } 256 }
248 257
249 RUNTIME_FUNCTION(Runtime_ThrowInvalidStringLength) { 258 RUNTIME_FUNCTION(Runtime_ThrowInvalidStringLength) {
250 HandleScope scope(isolate); 259 HandleScope scope(isolate);
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 isolate->counters()->runtime_call_stats()->Print(stats_stream); 533 isolate->counters()->runtime_call_stats()->Print(stats_stream);
525 isolate->counters()->runtime_call_stats()->Reset(); 534 isolate->counters()->runtime_call_stats()->Reset();
526 if (args[0]->IsString()) 535 if (args[0]->IsString())
527 std::fclose(f); 536 std::fclose(f);
528 else 537 else
529 std::fflush(f); 538 std::fflush(f);
530 return isolate->heap()->undefined_value(); 539 return isolate->heap()->undefined_value();
531 } 540 }
532 } 541 }
533 542
534 RUNTIME_FUNCTION(Runtime_OrdinaryHasInstance) {
535 HandleScope scope(isolate);
536 DCHECK_EQ(2, args.length());
537 CONVERT_ARG_HANDLE_CHECKED(Object, callable, 0);
538 CONVERT_ARG_HANDLE_CHECKED(Object, object, 1);
539 RETURN_RESULT_OR_FAILURE(
540 isolate, Object::OrdinaryHasInstance(isolate, callable, object));
541 }
542
543 RUNTIME_FUNCTION(Runtime_Typeof) { 543 RUNTIME_FUNCTION(Runtime_Typeof) {
544 HandleScope scope(isolate); 544 HandleScope scope(isolate);
545 DCHECK_EQ(1, args.length()); 545 DCHECK_EQ(1, args.length());
546 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 546 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
547 return *Object::TypeOf(isolate, object); 547 return *Object::TypeOf(isolate, object);
548 } 548 }
549 549
550 RUNTIME_FUNCTION(Runtime_AllowDynamicFunction) { 550 RUNTIME_FUNCTION(Runtime_AllowDynamicFunction) {
551 HandleScope scope(isolate); 551 HandleScope scope(isolate);
552 DCHECK_EQ(1, args.length()); 552 DCHECK_EQ(1, args.length());
(...skipping 13 matching lines...) Expand all
566 THROW_NEW_ERROR_RETURN_FAILURE( 566 THROW_NEW_ERROR_RETURN_FAILURE(
567 isolate, NewTypeError(MessageTemplate::kSymbolIteratorInvalid)); 567 isolate, NewTypeError(MessageTemplate::kSymbolIteratorInvalid));
568 } 568 }
569 569
570 return *isolate->factory()->NewJSAsyncFromSyncIterator( 570 return *isolate->factory()->NewJSAsyncFromSyncIterator(
571 Handle<JSReceiver>::cast(sync_iterator)); 571 Handle<JSReceiver>::cast(sync_iterator));
572 } 572 }
573 573
574 } // namespace internal 574 } // namespace internal
575 } // namespace v8 575 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-operators.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698