OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 Object* structure, | 334 Object* structure, |
335 Name* name) { | 335 Name* name) { |
336 Isolate* isolate = name->GetIsolate(); | 336 Isolate* isolate = name->GetIsolate(); |
337 // To accommodate both the old and the new api we switch on the | 337 // To accommodate both the old and the new api we switch on the |
338 // data structure used to store the callbacks. Eventually foreign | 338 // data structure used to store the callbacks. Eventually foreign |
339 // callbacks should be phased out. | 339 // callbacks should be phased out. |
340 if (structure->IsForeign()) { | 340 if (structure->IsForeign()) { |
341 AccessorDescriptor* callback = | 341 AccessorDescriptor* callback = |
342 reinterpret_cast<AccessorDescriptor*>( | 342 reinterpret_cast<AccessorDescriptor*>( |
343 Foreign::cast(structure)->foreign_address()); | 343 Foreign::cast(structure)->foreign_address()); |
344 MaybeObject* value = (callback->getter)(receiver, callback->data); | 344 MaybeObject* value = (callback->getter)(isolate, receiver, callback->data); |
345 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 345 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
346 return value; | 346 return value; |
347 } | 347 } |
348 | 348 |
349 // api style callbacks. | 349 // api style callbacks. |
350 if (structure->IsAccessorInfo()) { | 350 if (structure->IsAccessorInfo()) { |
351 if (!AccessorInfo::cast(structure)->IsCompatibleReceiver(receiver)) { | 351 if (!AccessorInfo::cast(structure)->IsCompatibleReceiver(receiver)) { |
352 Handle<Object> name_handle(name, isolate); | 352 Handle<Object> name_handle(name, isolate); |
353 Handle<Object> receiver_handle(receiver, isolate); | 353 Handle<Object> receiver_handle(receiver, isolate); |
354 Handle<Object> args[2] = { name_handle, receiver_handle }; | 354 Handle<Object> args[2] = { name_handle, receiver_handle }; |
(...skipping 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2825 ASSERT(!value->IsTheHole()); | 2825 ASSERT(!value->IsTheHole()); |
2826 Handle<Object> value_handle(value, isolate); | 2826 Handle<Object> value_handle(value, isolate); |
2827 | 2827 |
2828 // To accommodate both the old and the new api we switch on the | 2828 // To accommodate both the old and the new api we switch on the |
2829 // data structure used to store the callbacks. Eventually foreign | 2829 // data structure used to store the callbacks. Eventually foreign |
2830 // callbacks should be phased out. | 2830 // callbacks should be phased out. |
2831 if (structure->IsForeign()) { | 2831 if (structure->IsForeign()) { |
2832 AccessorDescriptor* callback = | 2832 AccessorDescriptor* callback = |
2833 reinterpret_cast<AccessorDescriptor*>( | 2833 reinterpret_cast<AccessorDescriptor*>( |
2834 Foreign::cast(structure)->foreign_address()); | 2834 Foreign::cast(structure)->foreign_address()); |
2835 MaybeObject* obj = (callback->setter)(this, value, callback->data); | 2835 MaybeObject* obj = (callback->setter)( |
| 2836 isolate, this, value, callback->data); |
2836 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 2837 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
2837 if (obj->IsFailure()) return obj; | 2838 if (obj->IsFailure()) return obj; |
2838 return *value_handle; | 2839 return *value_handle; |
2839 } | 2840 } |
2840 | 2841 |
2841 if (structure->IsExecutableAccessorInfo()) { | 2842 if (structure->IsExecutableAccessorInfo()) { |
2842 // api style callbacks | 2843 // api style callbacks |
2843 ExecutableAccessorInfo* data = ExecutableAccessorInfo::cast(structure); | 2844 ExecutableAccessorInfo* data = ExecutableAccessorInfo::cast(structure); |
2844 if (!data->IsCompatibleReceiver(this)) { | 2845 if (!data->IsCompatibleReceiver(this)) { |
2845 Handle<Object> name_handle(name, isolate); | 2846 Handle<Object> name_handle(name, isolate); |
(...skipping 13148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15994 #define ERROR_MESSAGES_TEXTS(C, T) T, | 15995 #define ERROR_MESSAGES_TEXTS(C, T) T, |
15995 static const char* error_messages_[] = { | 15996 static const char* error_messages_[] = { |
15996 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 15997 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
15997 }; | 15998 }; |
15998 #undef ERROR_MESSAGES_TEXTS | 15999 #undef ERROR_MESSAGES_TEXTS |
15999 return error_messages_[reason]; | 16000 return error_messages_[reason]; |
16000 } | 16001 } |
16001 | 16002 |
16002 | 16003 |
16003 } } // namespace v8::internal | 16004 } } // namespace v8::internal |
OLD | NEW |