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 2425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2782 Object* call_obj = data->setter(); | 2784 Object* call_obj = data->setter(); |
2783 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj); | 2785 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj); |
2784 if (call_fun == NULL) return value; | 2786 if (call_fun == NULL) return value; |
2785 Handle<String> key(String::cast(name)); | 2787 Handle<String> key(String::cast(name)); |
2786 LOG(isolate, ApiNamedPropertyAccess("store", this, name)); | 2788 LOG(isolate, ApiNamedPropertyAccess("store", this, name)); |
2787 PropertyCallbackArguments | 2789 PropertyCallbackArguments |
2788 args(isolate, data->data(), this, JSObject::cast(holder)); | 2790 args(isolate, data->data(), this, JSObject::cast(holder)); |
2789 { | 2791 { |
2790 // Leaving JavaScript. | 2792 // Leaving JavaScript. |
2791 VMState<EXTERNAL> state(isolate); | 2793 VMState<EXTERNAL> state(isolate); |
| 2794 ExternalCallbackScope call_scope(isolate, |
| 2795 v8::ToCData<Address>(call_obj)); |
2792 args.Call(call_fun, | 2796 args.Call(call_fun, |
2793 v8::Utils::ToLocal(key), | 2797 v8::Utils::ToLocal(key), |
2794 v8::Utils::ToLocal(value_handle)); | 2798 v8::Utils::ToLocal(value_handle)); |
2795 } | 2799 } |
2796 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 2800 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
2797 return *value_handle; | 2801 return *value_handle; |
2798 } | 2802 } |
2799 | 2803 |
2800 if (structure->IsAccessorPair()) { | 2804 if (structure->IsAccessorPair()) { |
2801 Object* setter = AccessorPair::cast(structure)->setter(); | 2805 Object* setter = AccessorPair::cast(structure)->setter(); |
(...skipping 12836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15638 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 15642 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
15639 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 15643 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
15640 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 15644 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
15641 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 15645 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
15642 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 15646 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
15643 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 15647 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
15644 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 15648 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
15645 } | 15649 } |
15646 | 15650 |
15647 } } // namespace v8::internal | 15651 } } // namespace v8::internal |
OLD | NEW |