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 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 } | 803 } |
804 } | 804 } |
805 } | 805 } |
806 | 806 |
807 | 807 |
808 // ------------------------------------------------------------------------ | 808 // ------------------------------------------------------------------------ |
809 // StubCompiler implementation. | 809 // StubCompiler implementation. |
810 | 810 |
811 | 811 |
812 RUNTIME_FUNCTION(MaybeObject*, StoreCallbackProperty) { | 812 RUNTIME_FUNCTION(MaybeObject*, StoreCallbackProperty) { |
813 JSObject* recv = JSObject::cast(args[0]); | 813 JSObject* receiver = JSObject::cast(args[0]); |
814 ExecutableAccessorInfo* callback = ExecutableAccessorInfo::cast(args[1]); | 814 JSObject* holder = JSObject::cast(args[1]); |
| 815 ExecutableAccessorInfo* callback = ExecutableAccessorInfo::cast(args[2]); |
815 Address setter_address = v8::ToCData<Address>(callback->setter()); | 816 Address setter_address = v8::ToCData<Address>(callback->setter()); |
816 v8::AccessorSetterCallback fun = | 817 v8::AccessorSetterCallback fun = |
817 FUNCTION_CAST<v8::AccessorSetterCallback>(setter_address); | 818 FUNCTION_CAST<v8::AccessorSetterCallback>(setter_address); |
818 ASSERT(fun != NULL); | 819 ASSERT(fun != NULL); |
819 ASSERT(callback->IsCompatibleReceiver(recv)); | 820 ASSERT(callback->IsCompatibleReceiver(receiver)); |
820 Handle<Name> name = args.at<Name>(2); | 821 Handle<Name> name = args.at<Name>(3); |
821 Handle<Object> value = args.at<Object>(3); | 822 Handle<Object> value = args.at<Object>(4); |
822 HandleScope scope(isolate); | 823 HandleScope scope(isolate); |
823 | 824 |
824 // TODO(rossberg): Support symbols in the API. | 825 // TODO(rossberg): Support symbols in the API. |
825 if (name->IsSymbol()) return *value; | 826 if (name->IsSymbol()) return *value; |
826 Handle<String> str = Handle<String>::cast(name); | 827 Handle<String> str = Handle<String>::cast(name); |
827 | 828 |
828 LOG(isolate, ApiNamedPropertyAccess("store", recv, *name)); | 829 LOG(isolate, ApiNamedPropertyAccess("store", receiver, *name)); |
829 PropertyCallbackArguments | 830 PropertyCallbackArguments |
830 custom_args(isolate, callback->data(), recv, recv); | 831 custom_args(isolate, callback->data(), receiver, holder); |
831 custom_args.Call(fun, v8::Utils::ToLocal(str), v8::Utils::ToLocal(value)); | 832 custom_args.Call(fun, v8::Utils::ToLocal(str), v8::Utils::ToLocal(value)); |
832 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 833 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
833 return *value; | 834 return *value; |
834 } | 835 } |
835 | 836 |
836 | 837 |
837 /** | 838 /** |
838 * Attempts to load a property with an interceptor (which must be present), | 839 * Attempts to load a property with an interceptor (which must be present), |
839 * but doesn't search the prototype chain. | 840 * but doesn't search the prototype chain. |
840 * | 841 * |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2029 Handle<FunctionTemplateInfo>( | 2030 Handle<FunctionTemplateInfo>( |
2030 FunctionTemplateInfo::cast(signature->receiver())); | 2031 FunctionTemplateInfo::cast(signature->receiver())); |
2031 } | 2032 } |
2032 } | 2033 } |
2033 | 2034 |
2034 is_simple_api_call_ = true; | 2035 is_simple_api_call_ = true; |
2035 } | 2036 } |
2036 | 2037 |
2037 | 2038 |
2038 } } // namespace v8::internal | 2039 } } // namespace v8::internal |
OLD | NEW |