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

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: 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
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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 DCHECK(!CalledAsConstructor(isolate)); 1109 DCHECK(!CalledAsConstructor(isolate));
1110 Heap* heap = isolate->heap(); 1110 Heap* heap = isolate->heap();
1111 1111
1112 Handle<Object> receiver = args.receiver(); 1112 Handle<Object> receiver = args.receiver();
1113 1113
1114 // Get the object called. 1114 // Get the object called.
1115 JSObject* obj = JSObject::cast(*receiver); 1115 JSObject* obj = JSObject::cast(*receiver);
1116 1116
1117 // Get the invocation callback from the function descriptor that was 1117 // Get the invocation callback from the function descriptor that was
1118 // used to create the called object. 1118 // used to create the called object.
1119 DCHECK(obj->map()->has_instance_call_handler()); 1119 DCHECK(obj->map()->is_callable());
1120 JSFunction* constructor = JSFunction::cast(obj->map()->GetConstructor()); 1120 JSFunction* constructor = JSFunction::cast(obj->map()->GetConstructor());
1121 // TODO(ishell): turn this back to a DCHECK. 1121 // TODO(ishell): turn this back to a DCHECK.
1122 CHECK(constructor->shared()->IsApiFunction()); 1122 CHECK(constructor->shared()->IsApiFunction());
1123 Object* handler = 1123 Object* handler =
1124 constructor->shared()->get_api_func_data()->instance_call_handler(); 1124 constructor->shared()->get_api_func_data()->instance_call_handler();
1125 DCHECK(!handler->IsUndefined()); 1125 DCHECK(!handler->IsUndefined());
1126 // TODO(ishell): remove this debugging code. 1126 // TODO(ishell): remove this debugging code.
1127 CHECK(handler->IsCallHandlerInfo()); 1127 CHECK(handler->IsCallHandlerInfo());
1128 CallHandlerInfo* call_data = CallHandlerInfo::cast(handler); 1128 CallHandlerInfo* call_data = CallHandlerInfo::cast(handler);
1129 Object* callback_obj = call_data->callback(); 1129 Object* callback_obj = call_data->callback();
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1534 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1535 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1535 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1536 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 1536 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
1537 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1537 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1538 #undef DEFINE_BUILTIN_ACCESSOR_C 1538 #undef DEFINE_BUILTIN_ACCESSOR_C
1539 #undef DEFINE_BUILTIN_ACCESSOR_A 1539 #undef DEFINE_BUILTIN_ACCESSOR_A
1540 1540
1541 1541
1542 } // namespace internal 1542 } // namespace internal
1543 } // namespace v8 1543 } // namespace v8
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | src/objects-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698