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