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/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" |
11 #include "src/bootstrapper.h" | 11 #include "src/bootstrapper.h" |
12 #include "src/builtins.h" | 12 #include "src/builtins.h" |
13 #include "src/cpu-profiler.h" | 13 #include "src/cpu-profiler.h" |
14 #include "src/gdb-jit.h" | 14 #include "src/gdb-jit.h" |
15 #include "src/heap/mark-compact.h" | 15 #include "src/heap/mark-compact.h" |
16 #include "src/heap-profiler.h" | 16 #include "src/heap-profiler.h" |
17 #include "src/ic/handler-compiler.h" | 17 #include "src/ic/handler-compiler.h" |
18 #include "src/ic/ic.h" | 18 #include "src/ic/ic.h" |
19 #include "src/messages.h" | |
20 #include "src/prototype.h" | 19 #include "src/prototype.h" |
21 #include "src/vm-state-inl.h" | 20 #include "src/vm-state-inl.h" |
22 | 21 |
23 namespace v8 { | 22 namespace v8 { |
24 namespace internal { | 23 namespace internal { |
25 | 24 |
26 namespace { | 25 namespace { |
27 | 26 |
28 // Arguments object passed to C++ builtins. | 27 // Arguments object passed to C++ builtins. |
29 template <BuiltinExtraArguments extra_args> | 28 template <BuiltinExtraArguments extra_args> |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 } | 1019 } |
1021 | 1020 |
1022 | 1021 |
1023 // ----------------------------------------------------------------------------- | 1022 // ----------------------------------------------------------------------------- |
1024 // Throwers for restricted function properties and strict arguments object | 1023 // Throwers for restricted function properties and strict arguments object |
1025 // properties | 1024 // properties |
1026 | 1025 |
1027 | 1026 |
1028 BUILTIN(RestrictedFunctionPropertiesThrower) { | 1027 BUILTIN(RestrictedFunctionPropertiesThrower) { |
1029 HandleScope scope(isolate); | 1028 HandleScope scope(isolate); |
1030 THROW_NEW_ERROR_RETURN_FAILURE( | 1029 THROW_NEW_ERROR_RETURN_FAILURE(isolate, |
1031 isolate, NewTypeError(MessageTemplate::kRestrictedFunctionProperties)); | 1030 NewTypeError("restricted_function_properties", |
| 1031 HandleVector<Object>(NULL, 0))); |
1032 } | 1032 } |
1033 | 1033 |
1034 | 1034 |
1035 BUILTIN(RestrictedStrictArgumentsPropertiesThrower) { | 1035 BUILTIN(RestrictedStrictArgumentsPropertiesThrower) { |
1036 HandleScope scope(isolate); | 1036 HandleScope scope(isolate); |
1037 THROW_NEW_ERROR_RETURN_FAILURE( | 1037 THROW_NEW_ERROR_RETURN_FAILURE( |
1038 isolate, NewTypeError(MessageTemplate::kStrictPoisonPill)); | 1038 isolate, |
| 1039 NewTypeError("strict_poison_pill", HandleVector<Object>(NULL, 0))); |
1039 } | 1040 } |
1040 | 1041 |
1041 | 1042 |
1042 // ----------------------------------------------------------------------------- | 1043 // ----------------------------------------------------------------------------- |
1043 // | 1044 // |
1044 | 1045 |
1045 | 1046 |
1046 template <bool is_construct> | 1047 template <bool is_construct> |
1047 MUST_USE_RESULT static MaybeHandle<Object> HandleApiCallHelper( | 1048 MUST_USE_RESULT static MaybeHandle<Object> HandleApiCallHelper( |
1048 Isolate* isolate, BuiltinArguments<NEEDS_CALLED_FUNCTION>& args) { | 1049 Isolate* isolate, BuiltinArguments<NEEDS_CALLED_FUNCTION>& args) { |
(...skipping 23 matching lines...) Expand all Loading... |
1072 isolate->ReportFailedAccessCheck(js_receiver); | 1073 isolate->ReportFailedAccessCheck(js_receiver); |
1073 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); | 1074 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); |
1074 } | 1075 } |
1075 } | 1076 } |
1076 } | 1077 } |
1077 | 1078 |
1078 Object* raw_holder = fun_data->GetCompatibleReceiver(isolate, args[0]); | 1079 Object* raw_holder = fun_data->GetCompatibleReceiver(isolate, args[0]); |
1079 | 1080 |
1080 if (raw_holder->IsNull()) { | 1081 if (raw_holder->IsNull()) { |
1081 // This function cannot be called with the given receiver. Abort! | 1082 // This function cannot be called with the given receiver. Abort! |
1082 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIllegalInvocation), | 1083 THROW_NEW_ERROR( |
1083 Object); | 1084 isolate, NewTypeError("illegal_invocation", HandleVector(&function, 1)), |
| 1085 Object); |
1084 } | 1086 } |
1085 | 1087 |
1086 Object* raw_call_data = fun_data->call_code(); | 1088 Object* raw_call_data = fun_data->call_code(); |
1087 if (!raw_call_data->IsUndefined()) { | 1089 if (!raw_call_data->IsUndefined()) { |
1088 // TODO(ishell): remove this debugging code. | 1090 // TODO(ishell): remove this debugging code. |
1089 CHECK(raw_call_data->IsCallHandlerInfo()); | 1091 CHECK(raw_call_data->IsCallHandlerInfo()); |
1090 CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data); | 1092 CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data); |
1091 Object* callback_obj = call_data->callback(); | 1093 Object* callback_obj = call_data->callback(); |
1092 v8::FunctionCallback callback = | 1094 v8::FunctionCallback callback = |
1093 v8::ToCData<v8::FunctionCallback>(callback_obj); | 1095 v8::ToCData<v8::FunctionCallback>(callback_obj); |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1670 } | 1672 } |
1671 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1673 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1672 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1674 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1673 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1675 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
1674 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1676 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1675 #undef DEFINE_BUILTIN_ACCESSOR_C | 1677 #undef DEFINE_BUILTIN_ACCESSOR_C |
1676 #undef DEFINE_BUILTIN_ACCESSOR_A | 1678 #undef DEFINE_BUILTIN_ACCESSOR_A |
1677 | 1679 |
1678 | 1680 |
1679 } } // namespace v8::internal | 1681 } } // namespace v8::internal |
OLD | NEW |