| OLD | NEW |
| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/api-natives.h" |
| 8 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 9 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| 10 #include "src/bootstrapper.h" | 11 #include "src/bootstrapper.h" |
| 11 #include "src/builtins.h" | 12 #include "src/builtins.h" |
| 12 #include "src/cpu-profiler.h" | 13 #include "src/cpu-profiler.h" |
| 13 #include "src/gdb-jit.h" | 14 #include "src/gdb-jit.h" |
| 14 #include "src/heap/mark-compact.h" | 15 #include "src/heap/mark-compact.h" |
| 15 #include "src/heap-profiler.h" | 16 #include "src/heap-profiler.h" |
| 16 #include "src/ic/handler-compiler.h" | 17 #include "src/ic/handler-compiler.h" |
| 17 #include "src/ic/ic.h" | 18 #include "src/ic/ic.h" |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 HandleScope scope(isolate); | 1029 HandleScope scope(isolate); |
| 1029 Handle<JSFunction> function = args.called_function(); | 1030 Handle<JSFunction> function = args.called_function(); |
| 1030 // TODO(ishell): turn this back to a DCHECK. | 1031 // TODO(ishell): turn this back to a DCHECK. |
| 1031 CHECK(function->shared()->IsApiFunction()); | 1032 CHECK(function->shared()->IsApiFunction()); |
| 1032 | 1033 |
| 1033 Handle<FunctionTemplateInfo> fun_data( | 1034 Handle<FunctionTemplateInfo> fun_data( |
| 1034 function->shared()->get_api_func_data(), isolate); | 1035 function->shared()->get_api_func_data(), isolate); |
| 1035 if (is_construct) { | 1036 if (is_construct) { |
| 1036 ASSIGN_RETURN_ON_EXCEPTION( | 1037 ASSIGN_RETURN_ON_EXCEPTION( |
| 1037 isolate, fun_data, | 1038 isolate, fun_data, |
| 1038 isolate->factory()->ConfigureInstance( | 1039 ApiNatives::ConfigureInstance(isolate, fun_data, |
| 1039 fun_data, Handle<JSObject>::cast(args.receiver())), | 1040 Handle<JSObject>::cast(args.receiver())), |
| 1040 Object); | 1041 Object); |
| 1041 } | 1042 } |
| 1042 | 1043 |
| 1043 DCHECK(!args[0]->IsNull()); | 1044 DCHECK(!args[0]->IsNull()); |
| 1044 if (args[0]->IsUndefined()) args[0] = function->global_proxy(); | 1045 if (args[0]->IsUndefined()) args[0] = function->global_proxy(); |
| 1045 | 1046 |
| 1046 Object* raw_holder = fun_data->GetCompatibleReceiver(isolate, args[0]); | 1047 Object* raw_holder = fun_data->GetCompatibleReceiver(isolate, args[0]); |
| 1047 | 1048 |
| 1048 if (raw_holder->IsNull()) { | 1049 if (raw_holder->IsNull()) { |
| 1049 // This function cannot be called with the given receiver. Abort! | 1050 // This function cannot be called with the given receiver. Abort! |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1639 } | 1640 } |
| 1640 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1641 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1641 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1642 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1642 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1643 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1643 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1644 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1644 #undef DEFINE_BUILTIN_ACCESSOR_C | 1645 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1645 #undef DEFINE_BUILTIN_ACCESSOR_A | 1646 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1646 | 1647 |
| 1647 | 1648 |
| 1648 } } // namespace v8::internal | 1649 } } // namespace v8::internal |
| OLD | NEW |