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 10475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10486 | 10486 |
10487 // If the callback object is a fixed array then it contains JavaScript | 10487 // If the callback object is a fixed array then it contains JavaScript |
10488 // getter and/or setter. | 10488 // getter and/or setter. |
10489 bool hasJavaScriptAccessors = result_type == CALLBACKS && | 10489 bool hasJavaScriptAccessors = result_type == CALLBACKS && |
10490 result_callback_obj->IsAccessorPair(); | 10490 result_callback_obj->IsAccessorPair(); |
10491 Handle<FixedArray> details = | 10491 Handle<FixedArray> details = |
10492 isolate->factory()->NewFixedArray(hasJavaScriptAccessors ? 5 : 2); | 10492 isolate->factory()->NewFixedArray(hasJavaScriptAccessors ? 5 : 2); |
10493 details->set(0, *value); | 10493 details->set(0, *value); |
10494 details->set(1, property_details); | 10494 details->set(1, property_details); |
10495 if (hasJavaScriptAccessors) { | 10495 if (hasJavaScriptAccessors) { |
| 10496 AccessorPair* accessors = AccessorPair::cast(*result_callback_obj); |
10496 details->set(2, isolate->heap()->ToBoolean(caught_exception)); | 10497 details->set(2, isolate->heap()->ToBoolean(caught_exception)); |
10497 details->set(3, AccessorPair::cast(*result_callback_obj)->getter()); | 10498 details->set(3, accessors->SafeGet(ACCESSOR_GETTER)); |
10498 details->set(4, AccessorPair::cast(*result_callback_obj)->setter()); | 10499 details->set(4, accessors->SafeGet(ACCESSOR_SETTER)); |
10499 } | 10500 } |
10500 | 10501 |
10501 return *isolate->factory()->NewJSArrayWithElements(details); | 10502 return *isolate->factory()->NewJSArrayWithElements(details); |
10502 } | 10503 } |
10503 if (i < length - 1) { | 10504 if (i < length - 1) { |
10504 jsproto = Handle<JSObject>(JSObject::cast(jsproto->GetPrototype())); | 10505 jsproto = Handle<JSObject>(JSObject::cast(jsproto->GetPrototype())); |
10505 } | 10506 } |
10506 } | 10507 } |
10507 | 10508 |
10508 return isolate->heap()->undefined_value(); | 10509 return isolate->heap()->undefined_value(); |
(...skipping 3114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13623 // Handle last resort GC and make sure to allow future allocations | 13624 // Handle last resort GC and make sure to allow future allocations |
13624 // to grow the heap without causing GCs (if possible). | 13625 // to grow the heap without causing GCs (if possible). |
13625 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13626 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13626 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13627 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13627 "Runtime::PerformGC"); | 13628 "Runtime::PerformGC"); |
13628 } | 13629 } |
13629 } | 13630 } |
13630 | 13631 |
13631 | 13632 |
13632 } } // namespace v8::internal | 13633 } } // namespace v8::internal |
OLD | NEW |