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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 IllegalSetter, | 434 IllegalSetter, |
435 0 | 435 0 |
436 }; | 436 }; |
437 | 437 |
438 | 438 |
439 // | 439 // |
440 // Accessors::FunctionPrototype | 440 // Accessors::FunctionPrototype |
441 // | 441 // |
442 | 442 |
443 | 443 |
| 444 Handle<Object> Accessors::FunctionGetPrototype(Handle<Object> object) { |
| 445 Isolate* isolate = Isolate::Current(); |
| 446 CALL_HEAP_FUNCTION( |
| 447 isolate, Accessors::FunctionGetPrototype(*object, 0), Object); |
| 448 } |
| 449 |
| 450 |
444 MaybeObject* Accessors::FunctionGetPrototype(Object* object, void*) { | 451 MaybeObject* Accessors::FunctionGetPrototype(Object* object, void*) { |
445 Isolate* isolate = Isolate::Current(); | 452 Isolate* isolate = Isolate::Current(); |
446 JSFunction* function = FindInstanceOf<JSFunction>(isolate, object); | 453 JSFunction* function = FindInstanceOf<JSFunction>(isolate, object); |
447 if (function == NULL) return isolate->heap()->undefined_value(); | 454 if (function == NULL) return isolate->heap()->undefined_value(); |
448 while (!function->should_have_prototype()) { | 455 while (!function->should_have_prototype()) { |
449 function = FindInstanceOf<JSFunction>(isolate, function->GetPrototype()); | 456 function = FindInstanceOf<JSFunction>(isolate, function->GetPrototype()); |
450 // There has to be one because we hit the getter. | 457 // There has to be one because we hit the getter. |
451 ASSERT(function != NULL); | 458 ASSERT(function != NULL); |
452 } | 459 } |
453 | 460 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 info->set_data(Smi::FromInt(index)); | 847 info->set_data(Smi::FromInt(index)); |
841 Handle<Object> getter = v8::FromCData(&ModuleGetExport); | 848 Handle<Object> getter = v8::FromCData(&ModuleGetExport); |
842 Handle<Object> setter = v8::FromCData(&ModuleSetExport); | 849 Handle<Object> setter = v8::FromCData(&ModuleSetExport); |
843 info->set_getter(*getter); | 850 info->set_getter(*getter); |
844 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 851 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
845 return info; | 852 return info; |
846 } | 853 } |
847 | 854 |
848 | 855 |
849 } } // namespace v8::internal | 856 } } // namespace v8::internal |
OLD | NEW |