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

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

Issue 2010493002: Check CallSite arguments more rigorously (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove unneeded cast 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
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/ast/prettyprinter.h" 8 #include "src/ast/prettyprinter.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
11 #include "src/debug/debug.h" 11 #include "src/debug/debug.h"
12 #include "src/frames-inl.h" 12 #include "src/frames-inl.h"
13 #include "src/isolate-inl.h" 13 #include "src/isolate-inl.h"
14 #include "src/messages.h" 14 #include "src/messages.h"
15 #include "src/parsing/parser.h" 15 #include "src/parsing/parser.h"
16 #include "src/wasm/wasm-module.h"
16 17
17 namespace v8 { 18 namespace v8 {
18 namespace internal { 19 namespace internal {
19 20
20 RUNTIME_FUNCTION(Runtime_CheckIsBootstrapping) { 21 RUNTIME_FUNCTION(Runtime_CheckIsBootstrapping) {
21 SealHandleScope shs(isolate); 22 SealHandleScope shs(isolate);
22 DCHECK(args.length() == 0); 23 DCHECK(args.length() == 0);
23 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); 24 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
24 return isolate->heap()->undefined_value(); 25 return isolate->heap()->undefined_value();
25 } 26 }
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 HandleScope scope(isolate); 597 HandleScope scope(isolate);
597 DCHECK_EQ(2, args.length()); 598 DCHECK_EQ(2, args.length());
598 CONVERT_ARG_HANDLE_CHECKED(Object, callable, 0); 599 CONVERT_ARG_HANDLE_CHECKED(Object, callable, 0);
599 CONVERT_ARG_HANDLE_CHECKED(Object, object, 1); 600 CONVERT_ARG_HANDLE_CHECKED(Object, object, 1);
600 Handle<Object> result; 601 Handle<Object> result;
601 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 602 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
602 isolate, result, Object::OrdinaryHasInstance(isolate, callable, object)); 603 isolate, result, Object::OrdinaryHasInstance(isolate, callable, object));
603 return *result; 604 return *result;
604 } 605 }
605 606
607 RUNTIME_FUNCTION(Runtime_IsWasmObject) {
608 HandleScope scope(isolate);
609 DCHECK_EQ(1, args.length());
610 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
611 bool is_wasm_object = object->IsJSObject() &&
612 wasm::IsWasmObject(Handle<JSObject>::cast(object));
613 return *isolate->factory()->ToBoolean(is_wasm_object);
614 }
615
606 } // namespace internal 616 } // namespace internal
607 } // namespace v8 617 } // namespace v8
OLDNEW
« src/messages.cc ('K') | « src/runtime/runtime.h ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698