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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 HandleScope scope(isolate); | 970 HandleScope scope(isolate); |
971 Handle<JSFunction> function = | 971 Handle<JSFunction> function = |
972 Handle<JSFunction>::cast(Utils::OpenHandle(*info.Holder())); | 972 Handle<JSFunction>::cast(Utils::OpenHandle(*info.Holder())); |
973 | 973 |
974 int length = 0; | 974 int length = 0; |
975 if (function->shared()->is_compiled()) { | 975 if (function->shared()->is_compiled()) { |
976 length = function->shared()->length(); | 976 length = function->shared()->length(); |
977 } else { | 977 } else { |
978 // If the function isn't compiled yet, the length is not computed | 978 // If the function isn't compiled yet, the length is not computed |
979 // correctly yet. Compile it now and return the right length. | 979 // correctly yet. Compile it now and return the right length. |
980 if (Compiler::EnsureCompiled(function, KEEP_EXCEPTION)) { | 980 if (Compiler::Compile(function, KEEP_EXCEPTION)) { |
981 length = function->shared()->length(); | 981 length = function->shared()->length(); |
982 } | 982 } |
983 if (isolate->has_pending_exception()) { | 983 if (isolate->has_pending_exception()) { |
984 isolate->OptionalRescheduleException(false); | 984 isolate->OptionalRescheduleException(false); |
985 } | 985 } |
986 } | 986 } |
987 Handle<Object> result(Smi::FromInt(length), isolate); | 987 Handle<Object> result(Smi::FromInt(length), isolate); |
988 info.GetReturnValue().Set(Utils::ToLocal(result)); | 988 info.GetReturnValue().Set(Utils::ToLocal(result)); |
989 } | 989 } |
990 | 990 |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1489 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1490 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1490 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1491 info->set_getter(*getter); | 1491 info->set_getter(*getter); |
1492 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1492 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1493 return info; | 1493 return info; |
1494 } | 1494 } |
1495 | 1495 |
1496 | 1496 |
1497 } // namespace internal | 1497 } // namespace internal |
1498 } // namespace v8 | 1498 } // namespace v8 |
OLD | NEW |