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" |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 DCHECK(raw_holder->IsJSObject()); | 1082 DCHECK(raw_holder->IsJSObject()); |
1083 | 1083 |
1084 FunctionCallbackArguments custom(isolate, | 1084 FunctionCallbackArguments custom(isolate, |
1085 data_obj, | 1085 data_obj, |
1086 *function, | 1086 *function, |
1087 raw_holder, | 1087 raw_holder, |
1088 &args[0] - 1, | 1088 &args[0] - 1, |
1089 args.length() - 1, | 1089 args.length() - 1, |
1090 is_construct); | 1090 is_construct); |
1091 | 1091 |
1092 v8::Handle<v8::Value> value = custom.Call(callback); | 1092 v8::Local<v8::Value> value = custom.Call(callback); |
1093 Handle<Object> result; | 1093 Handle<Object> result; |
1094 if (value.IsEmpty()) { | 1094 if (value.IsEmpty()) { |
1095 result = isolate->factory()->undefined_value(); | 1095 result = isolate->factory()->undefined_value(); |
1096 } else { | 1096 } else { |
1097 result = v8::Utils::OpenHandle(*value); | 1097 result = v8::Utils::OpenHandle(*value); |
1098 result->VerifyApiCallResultType(); | 1098 result->VerifyApiCallResultType(); |
1099 } | 1099 } |
1100 | 1100 |
1101 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); | 1101 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); |
1102 if (!is_construct || result->IsJSObject()) { | 1102 if (!is_construct || result->IsJSObject()) { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 HandleScope scope(isolate); | 1219 HandleScope scope(isolate); |
1220 LOG(isolate, ApiObjectAccess("call non-function", obj)); | 1220 LOG(isolate, ApiObjectAccess("call non-function", obj)); |
1221 | 1221 |
1222 FunctionCallbackArguments custom(isolate, | 1222 FunctionCallbackArguments custom(isolate, |
1223 call_data->data(), | 1223 call_data->data(), |
1224 constructor, | 1224 constructor, |
1225 obj, | 1225 obj, |
1226 &args[0] - 1, | 1226 &args[0] - 1, |
1227 args.length() - 1, | 1227 args.length() - 1, |
1228 is_construct_call); | 1228 is_construct_call); |
1229 v8::Handle<v8::Value> value = custom.Call(callback); | 1229 v8::Local<v8::Value> value = custom.Call(callback); |
1230 if (value.IsEmpty()) { | 1230 if (value.IsEmpty()) { |
1231 result = heap->undefined_value(); | 1231 result = heap->undefined_value(); |
1232 } else { | 1232 } else { |
1233 result = *reinterpret_cast<Object**>(*value); | 1233 result = *reinterpret_cast<Object**>(*value); |
1234 result->VerifyApiCallResultType(); | 1234 result->VerifyApiCallResultType(); |
1235 } | 1235 } |
1236 } | 1236 } |
1237 // Check for exceptions and return result. | 1237 // Check for exceptions and return result. |
1238 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); | 1238 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); |
1239 return result; | 1239 return result; |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1661 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1662 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1662 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1663 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1663 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
1664 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1664 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1665 #undef DEFINE_BUILTIN_ACCESSOR_C | 1665 #undef DEFINE_BUILTIN_ACCESSOR_C |
1666 #undef DEFINE_BUILTIN_ACCESSOR_A | 1666 #undef DEFINE_BUILTIN_ACCESSOR_A |
1667 | 1667 |
1668 | 1668 |
1669 } // namespace internal | 1669 } // namespace internal |
1670 } // namespace v8 | 1670 } // namespace v8 |
OLD | NEW |