| 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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 } | 795 } |
| 796 } | 796 } |
| 797 } | 797 } |
| 798 | 798 |
| 799 | 799 |
| 800 // ------------------------------------------------------------------------ | 800 // ------------------------------------------------------------------------ |
| 801 // StubCompiler implementation. | 801 // StubCompiler implementation. |
| 802 | 802 |
| 803 | 803 |
| 804 RUNTIME_FUNCTION(MaybeObject*, StoreCallbackProperty) { | 804 RUNTIME_FUNCTION(MaybeObject*, StoreCallbackProperty) { |
| 805 JSObject* recv = JSObject::cast(args[0]); | 805 JSObject* receiver = JSObject::cast(args[0]); |
| 806 ExecutableAccessorInfo* callback = ExecutableAccessorInfo::cast(args[1]); | 806 JSObject* holder = JSObject::cast(args[1]); |
| 807 ExecutableAccessorInfo* callback = ExecutableAccessorInfo::cast(args[2]); |
| 807 Address setter_address = v8::ToCData<Address>(callback->setter()); | 808 Address setter_address = v8::ToCData<Address>(callback->setter()); |
| 808 v8::AccessorSetterCallback fun = | 809 v8::AccessorSetterCallback fun = |
| 809 FUNCTION_CAST<v8::AccessorSetterCallback>(setter_address); | 810 FUNCTION_CAST<v8::AccessorSetterCallback>(setter_address); |
| 810 ASSERT(fun != NULL); | 811 ASSERT(fun != NULL); |
| 811 ASSERT(callback->IsCompatibleReceiver(recv)); | 812 ASSERT(callback->IsCompatibleReceiver(receiver)); |
| 812 Handle<Name> name = args.at<Name>(2); | 813 Handle<Name> name = args.at<Name>(3); |
| 813 Handle<Object> value = args.at<Object>(3); | 814 Handle<Object> value = args.at<Object>(4); |
| 814 HandleScope scope(isolate); | 815 HandleScope scope(isolate); |
| 815 | 816 |
| 816 // TODO(rossberg): Support symbols in the API. | 817 // TODO(rossberg): Support symbols in the API. |
| 817 if (name->IsSymbol()) return *value; | 818 if (name->IsSymbol()) return *value; |
| 818 Handle<String> str = Handle<String>::cast(name); | 819 Handle<String> str = Handle<String>::cast(name); |
| 819 | 820 |
| 820 LOG(isolate, ApiNamedPropertyAccess("store", recv, *name)); | 821 LOG(isolate, ApiNamedPropertyAccess("store", receiver, *name)); |
| 821 PropertyCallbackArguments | 822 PropertyCallbackArguments |
| 822 custom_args(isolate, callback->data(), recv, recv); | 823 custom_args(isolate, callback->data(), receiver, holder); |
| 823 custom_args.Call(fun, v8::Utils::ToLocal(str), v8::Utils::ToLocal(value)); | 824 custom_args.Call(fun, v8::Utils::ToLocal(str), v8::Utils::ToLocal(value)); |
| 824 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 825 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 825 return *value; | 826 return *value; |
| 826 } | 827 } |
| 827 | 828 |
| 828 | 829 |
| 829 /** | 830 /** |
| 830 * Attempts to load a property with an interceptor (which must be present), | 831 * Attempts to load a property with an interceptor (which must be present), |
| 831 * but doesn't search the prototype chain. | 832 * but doesn't search the prototype chain. |
| 832 * | 833 * |
| (...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2008 Handle<FunctionTemplateInfo>( | 2009 Handle<FunctionTemplateInfo>( |
| 2009 FunctionTemplateInfo::cast(signature->receiver())); | 2010 FunctionTemplateInfo::cast(signature->receiver())); |
| 2010 } | 2011 } |
| 2011 } | 2012 } |
| 2012 | 2013 |
| 2013 is_simple_api_call_ = true; | 2014 is_simple_api_call_ = true; |
| 2014 } | 2015 } |
| 2015 | 2016 |
| 2016 | 2017 |
| 2017 } } // namespace v8::internal | 2018 } } // namespace v8::internal |
| OLD | NEW |