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/accessors.h" | 5 #include "src/accessors.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/execution.h" | 10 #include "src/execution.h" |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 HandleScope scope(isolate); | 810 HandleScope scope(isolate); |
811 Handle<JSFunction> function = | 811 Handle<JSFunction> function = |
812 Handle<JSFunction>::cast(Utils::OpenHandle(*info.Holder())); | 812 Handle<JSFunction>::cast(Utils::OpenHandle(*info.Holder())); |
813 | 813 |
814 int length = 0; | 814 int length = 0; |
815 if (function->shared()->is_compiled()) { | 815 if (function->shared()->is_compiled()) { |
816 length = function->shared()->length(); | 816 length = function->shared()->length(); |
817 } else { | 817 } else { |
818 // If the function isn't compiled yet, the length is not computed | 818 // If the function isn't compiled yet, the length is not computed |
819 // correctly yet. Compile it now and return the right length. | 819 // correctly yet. Compile it now and return the right length. |
820 if (Compiler::Compile(function, KEEP_EXCEPTION)) { | 820 if (Compiler::Compile(function, Compiler::KEEP_EXCEPTION)) { |
821 length = function->shared()->length(); | 821 length = function->shared()->length(); |
822 } | 822 } |
823 if (isolate->has_pending_exception()) { | 823 if (isolate->has_pending_exception()) { |
824 isolate->OptionalRescheduleException(false); | 824 isolate->OptionalRescheduleException(false); |
825 } | 825 } |
826 } | 826 } |
827 Handle<Object> result(Smi::FromInt(length), isolate); | 827 Handle<Object> result(Smi::FromInt(length), isolate); |
828 info.GetReturnValue().Set(Utils::ToLocal(result)); | 828 info.GetReturnValue().Set(Utils::ToLocal(result)); |
829 } | 829 } |
830 | 830 |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 Isolate* isolate = name->GetIsolate(); | 1206 Isolate* isolate = name->GetIsolate(); |
1207 Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport, | 1207 Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport, |
1208 &ModuleSetExport, attributes); | 1208 &ModuleSetExport, attributes); |
1209 info->set_data(Smi::FromInt(index)); | 1209 info->set_data(Smi::FromInt(index)); |
1210 return info; | 1210 return info; |
1211 } | 1211 } |
1212 | 1212 |
1213 | 1213 |
1214 } // namespace internal | 1214 } // namespace internal |
1215 } // namespace v8 | 1215 } // namespace v8 |
OLD | NEW |