| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 | 1169 |
| 1170 | 1170 |
| 1171 // ------------------------------------------------------------------------ | 1171 // ------------------------------------------------------------------------ |
| 1172 // StubCompiler implementation. | 1172 // StubCompiler implementation. |
| 1173 | 1173 |
| 1174 | 1174 |
| 1175 RUNTIME_FUNCTION(MaybeObject*, StoreCallbackProperty) { | 1175 RUNTIME_FUNCTION(MaybeObject*, StoreCallbackProperty) { |
| 1176 JSObject* recv = JSObject::cast(args[0]); | 1176 JSObject* recv = JSObject::cast(args[0]); |
| 1177 ExecutableAccessorInfo* callback = ExecutableAccessorInfo::cast(args[1]); | 1177 ExecutableAccessorInfo* callback = ExecutableAccessorInfo::cast(args[1]); |
| 1178 Address setter_address = v8::ToCData<Address>(callback->setter()); | 1178 Address setter_address = v8::ToCData<Address>(callback->setter()); |
| 1179 v8::AccessorSetter fun = FUNCTION_CAST<v8::AccessorSetter>(setter_address); | 1179 v8::AccessorSetterCallback fun = |
| 1180 FUNCTION_CAST<v8::AccessorSetterCallback>(setter_address); |
| 1180 ASSERT(fun != NULL); | 1181 ASSERT(fun != NULL); |
| 1181 ASSERT(callback->IsCompatibleReceiver(recv)); | 1182 ASSERT(callback->IsCompatibleReceiver(recv)); |
| 1182 Handle<Name> name = args.at<Name>(2); | 1183 Handle<Name> name = args.at<Name>(2); |
| 1183 Handle<Object> value = args.at<Object>(3); | 1184 Handle<Object> value = args.at<Object>(3); |
| 1184 HandleScope scope(isolate); | 1185 HandleScope scope(isolate); |
| 1185 | 1186 |
| 1186 // TODO(rossberg): Support symbols in the API. | 1187 // TODO(rossberg): Support symbols in the API. |
| 1187 if (name->IsSymbol()) return *value; | 1188 if (name->IsSymbol()) return *value; |
| 1188 Handle<String> str = Handle<String>::cast(name); | 1189 Handle<String> str = Handle<String>::cast(name); |
| 1189 | 1190 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1214 ASSERT(kArgsOffset == 2); | 1215 ASSERT(kArgsOffset == 2); |
| 1215 // No ReturnValue in interceptors. | 1216 // No ReturnValue in interceptors. |
| 1216 ASSERT_EQ(kArgsOffset + PCA::kArgsLength - 2, args.length()); | 1217 ASSERT_EQ(kArgsOffset + PCA::kArgsLength - 2, args.length()); |
| 1217 | 1218 |
| 1218 // TODO(rossberg): Support symbols in the API. | 1219 // TODO(rossberg): Support symbols in the API. |
| 1219 if (name_handle->IsSymbol()) | 1220 if (name_handle->IsSymbol()) |
| 1220 return isolate->heap()->no_interceptor_result_sentinel(); | 1221 return isolate->heap()->no_interceptor_result_sentinel(); |
| 1221 Handle<String> name = Handle<String>::cast(name_handle); | 1222 Handle<String> name = Handle<String>::cast(name_handle); |
| 1222 | 1223 |
| 1223 Address getter_address = v8::ToCData<Address>(interceptor_info->getter()); | 1224 Address getter_address = v8::ToCData<Address>(interceptor_info->getter()); |
| 1224 v8::NamedPropertyGetter getter = | 1225 v8::NamedPropertyGetterCallback getter = |
| 1225 FUNCTION_CAST<v8::NamedPropertyGetter>(getter_address); | 1226 FUNCTION_CAST<v8::NamedPropertyGetterCallback>(getter_address); |
| 1226 ASSERT(getter != NULL); | 1227 ASSERT(getter != NULL); |
| 1227 | 1228 |
| 1228 Handle<JSObject> receiver = | 1229 Handle<JSObject> receiver = |
| 1229 args.at<JSObject>(kArgsOffset - PCA::kThisIndex); | 1230 args.at<JSObject>(kArgsOffset - PCA::kThisIndex); |
| 1230 Handle<JSObject> holder = | 1231 Handle<JSObject> holder = |
| 1231 args.at<JSObject>(kArgsOffset - PCA::kHolderIndex); | 1232 args.at<JSObject>(kArgsOffset - PCA::kHolderIndex); |
| 1232 PropertyCallbackArguments callback_args(isolate, | 1233 PropertyCallbackArguments callback_args(isolate, |
| 1233 interceptor_info->data(), | 1234 interceptor_info->data(), |
| 1234 *receiver, | 1235 *receiver, |
| 1235 *holder); | 1236 *holder); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1284 | 1285 |
| 1285 Isolate* isolate = receiver_handle->GetIsolate(); | 1286 Isolate* isolate = receiver_handle->GetIsolate(); |
| 1286 | 1287 |
| 1287 // TODO(rossberg): Support symbols in the API. | 1288 // TODO(rossberg): Support symbols in the API. |
| 1288 if (name_handle->IsSymbol()) | 1289 if (name_handle->IsSymbol()) |
| 1289 return holder_handle->GetPropertyPostInterceptor( | 1290 return holder_handle->GetPropertyPostInterceptor( |
| 1290 *receiver_handle, *name_handle, attrs); | 1291 *receiver_handle, *name_handle, attrs); |
| 1291 Handle<String> name = Handle<String>::cast(name_handle); | 1292 Handle<String> name = Handle<String>::cast(name_handle); |
| 1292 | 1293 |
| 1293 Address getter_address = v8::ToCData<Address>(interceptor_info->getter()); | 1294 Address getter_address = v8::ToCData<Address>(interceptor_info->getter()); |
| 1294 v8::NamedPropertyGetter getter = | 1295 v8::NamedPropertyGetterCallback getter = |
| 1295 FUNCTION_CAST<v8::NamedPropertyGetter>(getter_address); | 1296 FUNCTION_CAST<v8::NamedPropertyGetterCallback>(getter_address); |
| 1296 ASSERT(getter != NULL); | 1297 ASSERT(getter != NULL); |
| 1297 | 1298 |
| 1298 PropertyCallbackArguments callback_args(isolate, | 1299 PropertyCallbackArguments callback_args(isolate, |
| 1299 interceptor_info->data(), | 1300 interceptor_info->data(), |
| 1300 *receiver_handle, | 1301 *receiver_handle, |
| 1301 *holder_handle); | 1302 *holder_handle); |
| 1302 { | 1303 { |
| 1303 // Use the interceptor getter. | 1304 // Use the interceptor getter. |
| 1304 HandleScope scope(isolate); | 1305 HandleScope scope(isolate); |
| 1305 v8::Handle<v8::Value> r = | 1306 v8::Handle<v8::Value> r = |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 Handle<FunctionTemplateInfo>( | 2190 Handle<FunctionTemplateInfo>( |
| 2190 FunctionTemplateInfo::cast(signature->receiver())); | 2191 FunctionTemplateInfo::cast(signature->receiver())); |
| 2191 } | 2192 } |
| 2192 } | 2193 } |
| 2193 | 2194 |
| 2194 is_simple_api_call_ = true; | 2195 is_simple_api_call_ = true; |
| 2195 } | 2196 } |
| 2196 | 2197 |
| 2197 | 2198 |
| 2198 } } // namespace v8::internal | 2199 } } // namespace v8::internal |
| OLD | NEW |