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/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/base/once.h" | 9 #include "src/base/once.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 return *result_array; | 1003 return *result_array; |
1004 } | 1004 } |
1005 | 1005 |
1006 | 1006 |
1007 // ----------------------------------------------------------------------------- | 1007 // ----------------------------------------------------------------------------- |
1008 // Generator and strict mode poison pills | 1008 // Generator and strict mode poison pills |
1009 | 1009 |
1010 | 1010 |
1011 BUILTIN(StrictModePoisonPill) { | 1011 BUILTIN(StrictModePoisonPill) { |
1012 HandleScope scope(isolate); | 1012 HandleScope scope(isolate); |
1013 return isolate->Throw(*isolate->factory()->NewTypeError( | 1013 THROW_NEW_ERROR_RETURN_FAILURE( |
1014 "strict_poison_pill", HandleVector<Object>(NULL, 0))); | 1014 isolate, |
| 1015 NewTypeError("strict_poison_pill", HandleVector<Object>(NULL, 0))); |
1015 } | 1016 } |
1016 | 1017 |
1017 | 1018 |
1018 BUILTIN(GeneratorPoisonPill) { | 1019 BUILTIN(GeneratorPoisonPill) { |
1019 HandleScope scope(isolate); | 1020 HandleScope scope(isolate); |
1020 return isolate->Throw(*isolate->factory()->NewTypeError( | 1021 THROW_NEW_ERROR_RETURN_FAILURE( |
1021 "generator_poison_pill", HandleVector<Object>(NULL, 0))); | 1022 isolate, |
| 1023 NewTypeError("generator_poison_pill", HandleVector<Object>(NULL, 0))); |
1022 } | 1024 } |
1023 | 1025 |
1024 | 1026 |
1025 // ----------------------------------------------------------------------------- | 1027 // ----------------------------------------------------------------------------- |
1026 // | 1028 // |
1027 | 1029 |
1028 | 1030 |
1029 // Searches the hidden prototype chain of the given object for the first | 1031 // Searches the hidden prototype chain of the given object for the first |
1030 // object that is an instance of the given type. If no such object can | 1032 // object that is an instance of the given type. If no such object can |
1031 // be found then Heap::null_value() is returned. | 1033 // be found then Heap::null_value() is returned. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 if (shared->strict_mode() == SLOPPY && !shared->native()) { | 1110 if (shared->strict_mode() == SLOPPY && !shared->native()) { |
1109 Object* recv = args[0]; | 1111 Object* recv = args[0]; |
1110 DCHECK(!recv->IsNull()); | 1112 DCHECK(!recv->IsNull()); |
1111 if (recv->IsUndefined()) args[0] = function->global_proxy(); | 1113 if (recv->IsUndefined()) args[0] = function->global_proxy(); |
1112 } | 1114 } |
1113 | 1115 |
1114 Object* raw_holder = TypeCheck(heap, args.length(), &args[0], *fun_data); | 1116 Object* raw_holder = TypeCheck(heap, args.length(), &args[0], *fun_data); |
1115 | 1117 |
1116 if (raw_holder->IsNull()) { | 1118 if (raw_holder->IsNull()) { |
1117 // This function cannot be called with the given receiver. Abort! | 1119 // This function cannot be called with the given receiver. Abort! |
1118 Handle<Object> obj = | 1120 THROW_NEW_ERROR_RETURN_FAILURE( |
1119 isolate->factory()->NewTypeError( | 1121 isolate, |
1120 "illegal_invocation", HandleVector(&function, 1)); | 1122 NewTypeError("illegal_invocation", HandleVector(&function, 1))); |
1121 return isolate->Throw(*obj); | |
1122 } | 1123 } |
1123 | 1124 |
1124 Object* raw_call_data = fun_data->call_code(); | 1125 Object* raw_call_data = fun_data->call_code(); |
1125 if (!raw_call_data->IsUndefined()) { | 1126 if (!raw_call_data->IsUndefined()) { |
1126 CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data); | 1127 CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data); |
1127 Object* callback_obj = call_data->callback(); | 1128 Object* callback_obj = call_data->callback(); |
1128 v8::FunctionCallback callback = | 1129 v8::FunctionCallback callback = |
1129 v8::ToCData<v8::FunctionCallback>(callback_obj); | 1130 v8::ToCData<v8::FunctionCallback>(callback_obj); |
1130 Object* data_obj = call_data->data(); | 1131 Object* data_obj = call_data->data(); |
1131 Object* result; | 1132 Object* result; |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 } | 1655 } |
1655 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1656 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1656 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1657 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1657 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1658 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
1658 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1659 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1659 #undef DEFINE_BUILTIN_ACCESSOR_C | 1660 #undef DEFINE_BUILTIN_ACCESSOR_C |
1660 #undef DEFINE_BUILTIN_ACCESSOR_A | 1661 #undef DEFINE_BUILTIN_ACCESSOR_A |
1661 | 1662 |
1662 | 1663 |
1663 } } // namespace v8::internal | 1664 } } // namespace v8::internal |
OLD | NEW |