OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 2571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2582 } | 2582 } |
2583 | 2583 |
2584 // Named parameters. | 2584 // Named parameters. |
2585 for (; i < desc.Count(); i++) { | 2585 for (; i < desc.Count(); i++) { |
2586 invocation.SetParameterTypeAt(i, Type::Handle(Type::DynamicType())); | 2586 invocation.SetParameterTypeAt(i, Type::Handle(Type::DynamicType())); |
2587 intptr_t index = i - desc.PositionalCount(); | 2587 intptr_t index = i - desc.PositionalCount(); |
2588 invocation.SetParameterNameAt(i, String::Handle(desc.NameAt(index))); | 2588 invocation.SetParameterNameAt(i, String::Handle(desc.NameAt(index))); |
2589 } | 2589 } |
2590 invocation.set_result_type(Type::Handle(Type::DynamicType())); | 2590 invocation.set_result_type(Type::Handle(Type::DynamicType())); |
2591 invocation.set_is_debuggable(false); | 2591 invocation.set_is_debuggable(false); |
| 2592 invocation.set_is_visible(false); |
2592 invocation.set_is_reflectable(false); | 2593 invocation.set_is_reflectable(false); |
2593 invocation.set_saved_args_desc(args_desc); | 2594 invocation.set_saved_args_desc(args_desc); |
2594 | 2595 |
2595 return invocation.raw(); | 2596 return invocation.raw(); |
2596 } | 2597 } |
2597 | 2598 |
2598 | 2599 |
2599 RawArray* Class::invocation_dispatcher_cache() const { | 2600 RawArray* Class::invocation_dispatcher_cache() const { |
2600 return raw_ptr()->invocation_dispatcher_cache_; | 2601 return raw_ptr()->invocation_dispatcher_cache_; |
2601 } | 2602 } |
(...skipping 3527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6129 result.set_name(name); | 6130 result.set_name(name); |
6130 result.set_kind(kind); | 6131 result.set_kind(kind); |
6131 result.set_recognized_kind(MethodRecognizer::kUnknown); | 6132 result.set_recognized_kind(MethodRecognizer::kUnknown); |
6132 result.set_modifier(RawFunction::kNoModifier); | 6133 result.set_modifier(RawFunction::kNoModifier); |
6133 result.set_is_static(is_static); | 6134 result.set_is_static(is_static); |
6134 result.set_is_const(is_const); | 6135 result.set_is_const(is_const); |
6135 result.set_is_abstract(is_abstract); | 6136 result.set_is_abstract(is_abstract); |
6136 result.set_is_external(is_external); | 6137 result.set_is_external(is_external); |
6137 result.set_is_native(is_native); | 6138 result.set_is_native(is_native); |
6138 result.set_is_reflectable(true); // Will be computed later. | 6139 result.set_is_reflectable(true); // Will be computed later. |
| 6140 result.set_is_visible(true); // Will be computed later. |
6139 result.set_is_debuggable(true); // Will be computed later. | 6141 result.set_is_debuggable(true); // Will be computed later. |
6140 result.set_is_intrinsic(false); | 6142 result.set_is_intrinsic(false); |
6141 result.set_is_redirecting(false); | 6143 result.set_is_redirecting(false); |
6142 result.set_is_generated_body(false); | 6144 result.set_is_generated_body(false); |
6143 result.set_always_inline(false); | 6145 result.set_always_inline(false); |
6144 result.set_is_polymorphic_target(false); | 6146 result.set_is_polymorphic_target(false); |
6145 result.set_owner(owner); | 6147 result.set_owner(owner); |
6146 result.set_token_pos(token_pos); | 6148 result.set_token_pos(token_pos); |
6147 result.set_end_token_pos(token_pos); | 6149 result.set_end_token_pos(token_pos); |
6148 result.set_num_fixed_parameters(0); | 6150 result.set_num_fixed_parameters(0); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6230 RawFunction::kRegularFunction, | 6232 RawFunction::kRegularFunction, |
6231 is_static, | 6233 is_static, |
6232 /* is_const = */ false, | 6234 /* is_const = */ false, |
6233 /* is_abstract = */ false, | 6235 /* is_abstract = */ false, |
6234 /* is_external = */ false, | 6236 /* is_external = */ false, |
6235 /* is_native = */ false, | 6237 /* is_native = */ false, |
6236 owner, | 6238 owner, |
6237 0)); | 6239 0)); |
6238 ASSERT(!script.IsNull()); | 6240 ASSERT(!script.IsNull()); |
6239 result.set_is_debuggable(false); | 6241 result.set_is_debuggable(false); |
| 6242 result.set_is_visible(false); |
6240 result.set_eval_script(script); | 6243 result.set_eval_script(script); |
6241 return result.raw(); | 6244 return result.raw(); |
6242 } | 6245 } |
6243 | 6246 |
6244 RawFunction* Function::ImplicitClosureFunction() const { | 6247 RawFunction* Function::ImplicitClosureFunction() const { |
6245 // Return the existing implicit closure function if any. | 6248 // Return the existing implicit closure function if any. |
6246 if (implicit_closure_function() != Function::null()) { | 6249 if (implicit_closure_function() != Function::null()) { |
6247 return implicit_closure_function(); | 6250 return implicit_closure_function(); |
6248 } | 6251 } |
6249 ASSERT(!IsSignatureFunction() && !IsClosureFunction()); | 6252 ASSERT(!IsSignatureFunction() && !IsClosureFunction()); |
(...skipping 14083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20333 if (function.IsNull()) { | 20336 if (function.IsNull()) { |
20334 // Check if null function object indicates a stack trace overflow. | 20337 // Check if null function object indicates a stack trace overflow. |
20335 if ((i < (Length() - 1)) && | 20338 if ((i < (Length() - 1)) && |
20336 (FunctionAtFrame(i + 1) != Function::null())) { | 20339 (FunctionAtFrame(i + 1) != Function::null())) { |
20337 const char* kTruncated = "...\n...\n"; | 20340 const char* kTruncated = "...\n...\n"; |
20338 intptr_t truncated_len = strlen(kTruncated) + 1; | 20341 intptr_t truncated_len = strlen(kTruncated) + 1; |
20339 char* chars = isolate->current_zone()->Alloc<char>(truncated_len); | 20342 char* chars = isolate->current_zone()->Alloc<char>(truncated_len); |
20340 OS::SNPrint(chars, truncated_len, "%s", kTruncated); | 20343 OS::SNPrint(chars, truncated_len, "%s", kTruncated); |
20341 frame_strings.Add(chars); | 20344 frame_strings.Add(chars); |
20342 } | 20345 } |
20343 } else if (function.is_debuggable() || FLAG_show_invisible_frames) { | 20346 } else if (function.is_visible() || FLAG_show_invisible_frames) { |
20344 code = CodeAtFrame(i); | 20347 code = CodeAtFrame(i); |
20345 ASSERT(function.raw() == code.function()); | 20348 ASSERT(function.raw() == code.function()); |
20346 uword pc = code.EntryPoint() + Smi::Value(PcOffsetAtFrame(i)); | 20349 uword pc = code.EntryPoint() + Smi::Value(PcOffsetAtFrame(i)); |
20347 if (code.is_optimized() && expand_inlined()) { | 20350 if (code.is_optimized() && expand_inlined()) { |
20348 // Traverse inlined frames. | 20351 // Traverse inlined frames. |
20349 for (InlinedFunctionsIterator it(code, pc); | 20352 for (InlinedFunctionsIterator it(code, pc); |
20350 !it.Done() && (*frame_index < max_frames); it.Advance()) { | 20353 !it.Done() && (*frame_index < max_frames); it.Advance()) { |
20351 function = it.function(); | 20354 function = it.function(); |
20352 if (function.is_debuggable() || FLAG_show_invisible_frames) { | 20355 if (function.is_visible() || FLAG_show_invisible_frames) { |
20353 code = it.code(); | 20356 code = it.code(); |
20354 ASSERT(function.raw() == code.function()); | 20357 ASSERT(function.raw() == code.function()); |
20355 uword pc = it.pc(); | 20358 uword pc = it.pc(); |
20356 ASSERT(pc != 0); | 20359 ASSERT(pc != 0); |
20357 ASSERT(code.EntryPoint() <= pc); | 20360 ASSERT(code.EntryPoint() <= pc); |
20358 ASSERT(pc < (code.EntryPoint() + code.Size())); | 20361 ASSERT(pc < (code.EntryPoint() + code.Size())); |
20359 total_len += PrintOneStacktrace( | 20362 total_len += PrintOneStacktrace( |
20360 isolate, &frame_strings, pc, function, code, *frame_index); | 20363 isolate, &frame_strings, pc, function, code, *frame_index); |
20361 (*frame_index)++; // To account for inlined frames. | 20364 (*frame_index)++; // To account for inlined frames. |
20362 } | 20365 } |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20722 return tag_label.ToCString(); | 20725 return tag_label.ToCString(); |
20723 } | 20726 } |
20724 | 20727 |
20725 | 20728 |
20726 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20729 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
20727 Instance::PrintJSONImpl(stream, ref); | 20730 Instance::PrintJSONImpl(stream, ref); |
20728 } | 20731 } |
20729 | 20732 |
20730 | 20733 |
20731 } // namespace dart | 20734 } // namespace dart |
OLD | NEW |