| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 // | 839 // |
| 840 | 840 |
| 841 static Handle<Object> GetFunctionPrototype(Isolate* isolate, | 841 static Handle<Object> GetFunctionPrototype(Isolate* isolate, |
| 842 Handle<Object> receiver) { | 842 Handle<Object> receiver) { |
| 843 Handle<JSFunction> function; | 843 Handle<JSFunction> function; |
| 844 { | 844 { |
| 845 DisallowHeapAllocation no_allocation; | 845 DisallowHeapAllocation no_allocation; |
| 846 JSFunction* function_raw = FindInstanceOf<JSFunction>(isolate, *receiver); | 846 JSFunction* function_raw = FindInstanceOf<JSFunction>(isolate, *receiver); |
| 847 if (function_raw == NULL) return isolate->factory()->undefined_value(); | 847 if (function_raw == NULL) return isolate->factory()->undefined_value(); |
| 848 while (!function_raw->should_have_prototype()) { | 848 while (!function_raw->should_have_prototype()) { |
| 849 function_raw = FindInstanceOf<JSFunction>(isolate, | 849 PrototypeIterator iter(isolate, function_raw); |
| 850 function_raw->GetPrototype()); | 850 function_raw = FindInstanceOf<JSFunction>(isolate, iter.GetCurrent()); |
| 851 // There has to be one because we hit the getter. | 851 // There has to be one because we hit the getter. |
| 852 ASSERT(function_raw != NULL); | 852 ASSERT(function_raw != NULL); |
| 853 } | 853 } |
| 854 function = Handle<JSFunction>(function_raw, isolate); | 854 function = Handle<JSFunction>(function_raw, isolate); |
| 855 } | 855 } |
| 856 | 856 |
| 857 if (!function->has_prototype()) { | 857 if (!function->has_prototype()) { |
| 858 Handle<Object> proto = isolate->factory()->NewFunctionPrototype(function); | 858 Handle<Object> proto = isolate->factory()->NewFunctionPrototype(function); |
| 859 JSFunction::SetPrototype(function, proto); | 859 JSFunction::SetPrototype(function, proto); |
| 860 } | 860 } |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1423 info->set_data(Smi::FromInt(index)); | 1423 info->set_data(Smi::FromInt(index)); |
| 1424 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1424 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
| 1425 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1425 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
| 1426 info->set_getter(*getter); | 1426 info->set_getter(*getter); |
| 1427 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1427 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
| 1428 return info; | 1428 return info; |
| 1429 } | 1429 } |
| 1430 | 1430 |
| 1431 | 1431 |
| 1432 } } // namespace v8::internal | 1432 } } // namespace v8::internal |
| OLD | NEW |