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

Side by Side Diff: src/builtins.cc

Issue 1316933002: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase again. Created 5 years, 3 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/bootstrapper.cc ('k') | src/code-stubs-hydrogen.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/builtins.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 DCHECK(!CalledAsConstructor(isolate)); 899 DCHECK(!CalledAsConstructor(isolate));
900 Heap* heap = isolate->heap(); 900 Heap* heap = isolate->heap();
901 901
902 Handle<Object> receiver = args.receiver(); 902 Handle<Object> receiver = args.receiver();
903 903
904 // Get the object called. 904 // Get the object called.
905 JSObject* obj = JSObject::cast(*receiver); 905 JSObject* obj = JSObject::cast(*receiver);
906 906
907 // Get the invocation callback from the function descriptor that was 907 // Get the invocation callback from the function descriptor that was
908 // used to create the called object. 908 // used to create the called object.
909 DCHECK(obj->map()->has_instance_call_handler()); 909 DCHECK(obj->map()->is_callable());
910 JSFunction* constructor = JSFunction::cast(obj->map()->GetConstructor()); 910 JSFunction* constructor = JSFunction::cast(obj->map()->GetConstructor());
911 // TODO(ishell): turn this back to a DCHECK. 911 // TODO(ishell): turn this back to a DCHECK.
912 CHECK(constructor->shared()->IsApiFunction()); 912 CHECK(constructor->shared()->IsApiFunction());
913 Object* handler = 913 Object* handler =
914 constructor->shared()->get_api_func_data()->instance_call_handler(); 914 constructor->shared()->get_api_func_data()->instance_call_handler();
915 DCHECK(!handler->IsUndefined()); 915 DCHECK(!handler->IsUndefined());
916 // TODO(ishell): remove this debugging code. 916 // TODO(ishell): remove this debugging code.
917 CHECK(handler->IsCallHandlerInfo()); 917 CHECK(handler->IsCallHandlerInfo());
918 CallHandlerInfo* call_data = CallHandlerInfo::cast(handler); 918 CallHandlerInfo* call_data = CallHandlerInfo::cast(handler);
919 Object* callback_obj = call_data->callback(); 919 Object* callback_obj = call_data->callback();
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1313 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1314 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1314 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1315 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 1315 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
1316 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1316 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1317 #undef DEFINE_BUILTIN_ACCESSOR_C 1317 #undef DEFINE_BUILTIN_ACCESSOR_C
1318 #undef DEFINE_BUILTIN_ACCESSOR_A 1318 #undef DEFINE_BUILTIN_ACCESSOR_A
1319 1319
1320 1320
1321 } // namespace internal 1321 } // namespace internal
1322 } // namespace v8 1322 } // namespace v8
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698