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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 if (call_fun == NULL) return isolate->heap()->undefined_value(); | 337 if (call_fun == NULL) return isolate->heap()->undefined_value(); |
338 HandleScope scope(isolate); | 338 HandleScope scope(isolate); |
339 JSObject* self = JSObject::cast(receiver); | 339 JSObject* self = JSObject::cast(receiver); |
340 Handle<String> key(String::cast(name)); | 340 Handle<String> key(String::cast(name)); |
341 LOG(isolate, ApiNamedPropertyAccess("load", self, name)); | 341 LOG(isolate, ApiNamedPropertyAccess("load", self, name)); |
342 PropertyCallbackArguments args(isolate, data->data(), self, this); | 342 PropertyCallbackArguments args(isolate, data->data(), self, this); |
343 v8::Handle<v8::Value> result; | 343 v8::Handle<v8::Value> result; |
344 { | 344 { |
345 // Leaving JavaScript. | 345 // Leaving JavaScript. |
346 VMState<EXTERNAL> state(isolate); | 346 VMState<EXTERNAL> state(isolate); |
| 347 ExternalCallbackScope call_scope(isolate, |
| 348 v8::ToCData<Address>(fun_obj)); |
347 result = args.Call(call_fun, v8::Utils::ToLocal(key)); | 349 result = args.Call(call_fun, v8::Utils::ToLocal(key)); |
348 } | 350 } |
349 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 351 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
350 if (result.IsEmpty()) { | 352 if (result.IsEmpty()) { |
351 return isolate->heap()->undefined_value(); | 353 return isolate->heap()->undefined_value(); |
352 } | 354 } |
353 Object* return_value = *v8::Utils::OpenHandle(*result); | 355 Object* return_value = *v8::Utils::OpenHandle(*result); |
354 return_value->VerifyApiCallResultType(); | 356 return_value->VerifyApiCallResultType(); |
355 return return_value; | 357 return return_value; |
356 } | 358 } |
(...skipping 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2784 Object* call_obj = data->setter(); | 2786 Object* call_obj = data->setter(); |
2785 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj); | 2787 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj); |
2786 if (call_fun == NULL) return value; | 2788 if (call_fun == NULL) return value; |
2787 Handle<String> key(String::cast(name)); | 2789 Handle<String> key(String::cast(name)); |
2788 LOG(isolate, ApiNamedPropertyAccess("store", this, name)); | 2790 LOG(isolate, ApiNamedPropertyAccess("store", this, name)); |
2789 PropertyCallbackArguments | 2791 PropertyCallbackArguments |
2790 args(isolate, data->data(), this, JSObject::cast(holder)); | 2792 args(isolate, data->data(), this, JSObject::cast(holder)); |
2791 { | 2793 { |
2792 // Leaving JavaScript. | 2794 // Leaving JavaScript. |
2793 VMState<EXTERNAL> state(isolate); | 2795 VMState<EXTERNAL> state(isolate); |
| 2796 ExternalCallbackScope call_scope(isolate, |
| 2797 v8::ToCData<Address>(call_obj)); |
2794 args.Call(call_fun, | 2798 args.Call(call_fun, |
2795 v8::Utils::ToLocal(key), | 2799 v8::Utils::ToLocal(key), |
2796 v8::Utils::ToLocal(value_handle)); | 2800 v8::Utils::ToLocal(value_handle)); |
2797 } | 2801 } |
2798 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 2802 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
2799 return *value_handle; | 2803 return *value_handle; |
2800 } | 2804 } |
2801 | 2805 |
2802 if (structure->IsAccessorPair()) { | 2806 if (structure->IsAccessorPair()) { |
2803 Object* setter = AccessorPair::cast(structure)->setter(); | 2807 Object* setter = AccessorPair::cast(structure)->setter(); |
(...skipping 12836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15640 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 15644 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
15641 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 15645 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
15642 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 15646 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
15643 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 15647 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
15644 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 15648 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
15645 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 15649 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
15646 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 15650 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
15647 } | 15651 } |
15648 | 15652 |
15649 } } // namespace v8::internal | 15653 } } // namespace v8::internal |
OLD | NEW |