Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Side by Side Diff: runtime/vm/object.cc

Issue 789643006: Introduce is_debuggable state bit on function objects (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2651 matching lines...) Expand 10 before | Expand all | Expand 10 after
2662 invocation.SetParameterNameAt(i, String::Handle(Symbols::New(name))); 2662 invocation.SetParameterNameAt(i, String::Handle(Symbols::New(name)));
2663 } 2663 }
2664 2664
2665 // Named parameters. 2665 // Named parameters.
2666 for (; i < desc.Count(); i++) { 2666 for (; i < desc.Count(); i++) {
2667 invocation.SetParameterTypeAt(i, Type::Handle(Type::DynamicType())); 2667 invocation.SetParameterTypeAt(i, Type::Handle(Type::DynamicType()));
2668 intptr_t index = i - desc.PositionalCount(); 2668 intptr_t index = i - desc.PositionalCount();
2669 invocation.SetParameterNameAt(i, String::Handle(desc.NameAt(index))); 2669 invocation.SetParameterNameAt(i, String::Handle(desc.NameAt(index)));
2670 } 2670 }
2671 invocation.set_result_type(Type::Handle(Type::DynamicType())); 2671 invocation.set_result_type(Type::Handle(Type::DynamicType()));
2672 invocation.set_is_debuggable(false);
2672 invocation.set_is_visible(false); // Not visible in stack trace. 2673 invocation.set_is_visible(false); // Not visible in stack trace.
2673 invocation.set_saved_args_desc(args_desc); 2674 invocation.set_saved_args_desc(args_desc);
2674 2675
2675 return invocation.raw(); 2676 return invocation.raw();
2676 } 2677 }
2677 2678
2678 2679
2679 RawArray* Class::invocation_dispatcher_cache() const { 2680 RawArray* Class::invocation_dispatcher_cache() const {
2680 return raw_ptr()->invocation_dispatcher_cache_; 2681 return raw_ptr()->invocation_dispatcher_cache_;
2681 } 2682 }
(...skipping 3508 matching lines...) Expand 10 before | Expand all | Expand 10 after
6190 result.set_name(name); 6191 result.set_name(name);
6191 result.set_kind(kind); 6192 result.set_kind(kind);
6192 result.set_recognized_kind(MethodRecognizer::kUnknown); 6193 result.set_recognized_kind(MethodRecognizer::kUnknown);
6193 result.set_modifier(RawFunction::kNoModifier); 6194 result.set_modifier(RawFunction::kNoModifier);
6194 result.set_is_static(is_static); 6195 result.set_is_static(is_static);
6195 result.set_is_const(is_const); 6196 result.set_is_const(is_const);
6196 result.set_is_abstract(is_abstract); 6197 result.set_is_abstract(is_abstract);
6197 result.set_is_external(is_external); 6198 result.set_is_external(is_external);
6198 result.set_is_native(is_native); 6199 result.set_is_native(is_native);
6199 result.set_is_visible(true); // Will be computed later. 6200 result.set_is_visible(true); // Will be computed later.
6201 result.set_is_debuggable(true); // Will be computed later.
6200 result.set_is_intrinsic(false); 6202 result.set_is_intrinsic(false);
6201 result.set_is_redirecting(false); 6203 result.set_is_redirecting(false);
6202 result.set_is_async_closure(false); 6204 result.set_is_async_closure(false);
6203 result.set_always_inline(false); 6205 result.set_always_inline(false);
6204 result.set_is_polymorphic_target(false); 6206 result.set_is_polymorphic_target(false);
6205 result.set_owner(owner); 6207 result.set_owner(owner);
6206 result.set_token_pos(token_pos); 6208 result.set_token_pos(token_pos);
6207 result.set_end_token_pos(token_pos); 6209 result.set_end_token_pos(token_pos);
6208 result.set_num_fixed_parameters(0); 6210 result.set_num_fixed_parameters(0);
6209 result.set_num_optional_parameters(0); 6211 result.set_num_optional_parameters(0);
6210 result.set_usage_counter(0); 6212 result.set_usage_counter(0);
6211 result.set_deoptimization_counter(0); 6213 result.set_deoptimization_counter(0);
6212 result.set_regexp_cid(kIllegalCid); 6214 result.set_regexp_cid(kIllegalCid);
6213 result.set_optimized_instruction_count(0); 6215 result.set_optimized_instruction_count(0);
6214 result.set_optimized_call_site_count(0); 6216 result.set_optimized_call_site_count(0);
6215 result.set_is_optimizable(is_native ? false : true); 6217 result.set_is_optimizable(is_native ? false : true);
6216 result.set_is_inlinable(true); 6218 result.set_is_inlinable(true);
6217 result.set_allows_hoisting_check_class(true); 6219 result.set_allows_hoisting_check_class(true);
6218 result.set_allows_bounds_check_generalization(true); 6220 result.set_allows_bounds_check_generalization(true);
6219 StubCode* stub_code = Isolate::Current()->stub_code(); 6221 StubCode* stub_code = Isolate::Current()->stub_code();
6220 result.SetInstructions(Code::Handle(stub_code->LazyCompile_entry()->code())); 6222 result.SetInstructions(Code::Handle(stub_code->LazyCompile_entry()->code()));
6221 if (kind == RawFunction::kClosureFunction) { 6223 if (kind == RawFunction::kClosureFunction) {
6222 const ClosureData& data = ClosureData::Handle(ClosureData::New()); 6224 const ClosureData& data = ClosureData::Handle(ClosureData::New());
6223 result.set_data(data); 6225 result.set_data(data);
6224 } 6226 }
6225
6226 return result.raw(); 6227 return result.raw();
6227 } 6228 }
6228 6229
6229 6230
6230 RawFunction* Function::Clone(const Class& new_owner) const { 6231 RawFunction* Function::Clone(const Class& new_owner) const {
6231 ASSERT(!IsConstructor()); 6232 ASSERT(!IsConstructor());
6232 Function& clone = Function::Handle(); 6233 Function& clone = Function::Handle();
6233 clone ^= Object::Clone(*this, Heap::kOld); 6234 clone ^= Object::Clone(*this, Heap::kOld);
6234 const Class& origin = Class::Handle(this->origin()); 6235 const Class& origin = Class::Handle(this->origin());
6235 const PatchClass& clone_owner = 6236 const PatchClass& clone_owner =
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
6290 Function::New(String::Handle(Symbols::New(":Eval")), 6291 Function::New(String::Handle(Symbols::New(":Eval")),
6291 RawFunction::kRegularFunction, 6292 RawFunction::kRegularFunction,
6292 is_static, 6293 is_static,
6293 /* is_const = */ false, 6294 /* is_const = */ false,
6294 /* is_abstract = */ false, 6295 /* is_abstract = */ false,
6295 /* is_external = */ false, 6296 /* is_external = */ false,
6296 /* is_native = */ false, 6297 /* is_native = */ false,
6297 owner, 6298 owner,
6298 0)); 6299 0));
6299 ASSERT(!script.IsNull()); 6300 ASSERT(!script.IsNull());
6301 result.set_is_debuggable(false);
6300 result.set_eval_script(script); 6302 result.set_eval_script(script);
6301 return result.raw(); 6303 return result.raw();
6302 } 6304 }
6303 6305
6304 RawFunction* Function::ImplicitClosureFunction() const { 6306 RawFunction* Function::ImplicitClosureFunction() const {
6305 // Return the existing implicit closure function if any. 6307 // Return the existing implicit closure function if any.
6306 if (implicit_closure_function() != Function::null()) { 6308 if (implicit_closure_function() != Function::null()) {
6307 return implicit_closure_function(); 6309 return implicit_closure_function();
6308 } 6310 }
6309 ASSERT(!IsSignatureFunction() && !IsClosureFunction()); 6311 ASSERT(!IsSignatureFunction() && !IsClosureFunction());
(...skipping 14320 matching lines...) Expand 10 before | Expand all | Expand 10 after
20630 return tag_label.ToCString(); 20632 return tag_label.ToCString();
20631 } 20633 }
20632 20634
20633 20635
20634 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20636 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20635 Instance::PrintJSONImpl(stream, ref); 20637 Instance::PrintJSONImpl(stream, ref);
20636 } 20638 }
20637 20639
20638 20640
20639 } // namespace dart 20641 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698