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

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

Issue 362153002: Transform functions marked as async (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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
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 5407 matching lines...) Expand 10 before | Expand all | Expand 10 after
5418 void Function::set_parameter_names(const Array& value) const { 5418 void Function::set_parameter_names(const Array& value) const {
5419 StorePointer(&raw_ptr()->parameter_names_, value.raw()); 5419 StorePointer(&raw_ptr()->parameter_names_, value.raw());
5420 } 5420 }
5421 5421
5422 5422
5423 void Function::set_kind(RawFunction::Kind value) const { 5423 void Function::set_kind(RawFunction::Kind value) const {
5424 set_kind_tag(KindBits::update(value, raw_ptr()->kind_tag_)); 5424 set_kind_tag(KindBits::update(value, raw_ptr()->kind_tag_));
5425 } 5425 }
5426 5426
5427 5427
5428 void Function::set_modifier(RawFunction::AsyncModifier value) const {
5429 set_kind_tag(ModifierBits::update(value, raw_ptr()->kind_tag_));
5430 }
5431
5432
5428 void Function::set_is_intrinsic(bool value) const { 5433 void Function::set_is_intrinsic(bool value) const {
5429 set_kind_tag(IntrinsicBit::update(value, raw_ptr()->kind_tag_)); 5434 set_kind_tag(IntrinsicBit::update(value, raw_ptr()->kind_tag_));
5430 } 5435 }
5431 5436
5432 5437
5433 void Function::set_is_recognized(bool value) const { 5438 void Function::set_is_recognized(bool value) const {
5434 set_kind_tag(RecognizedBit::update(value, raw_ptr()->kind_tag_)); 5439 set_kind_tag(RecognizedBit::update(value, raw_ptr()->kind_tag_));
5435 } 5440 }
5436 5441
5437 5442
(...skipping 10 matching lines...) Expand all
5448 void Function::set_is_const(bool value) const { 5453 void Function::set_is_const(bool value) const {
5449 set_kind_tag(ConstBit::update(value, raw_ptr()->kind_tag_)); 5454 set_kind_tag(ConstBit::update(value, raw_ptr()->kind_tag_));
5450 } 5455 }
5451 5456
5452 5457
5453 void Function::set_is_external(bool value) const { 5458 void Function::set_is_external(bool value) const {
5454 set_kind_tag(ExternalBit::update(value, raw_ptr()->kind_tag_)); 5459 set_kind_tag(ExternalBit::update(value, raw_ptr()->kind_tag_));
5455 } 5460 }
5456 5461
5457 5462
5463 void Function::set_is_async_closure(bool value) const {
5464 set_kind_tag(AsyncClosureBit::update(value, raw_ptr()->kind_tag_));
5465 }
5466
5467
5458 void Function::set_token_pos(intptr_t value) const { 5468 void Function::set_token_pos(intptr_t value) const {
5459 ASSERT(value >= 0); 5469 ASSERT(value >= 0);
5460 raw_ptr()->token_pos_ = value; 5470 raw_ptr()->token_pos_ = value;
5461 } 5471 }
5462 5472
5463 5473
5464 void Function::set_kind_tag(intptr_t value) const { 5474 void Function::set_kind_tag(intptr_t value) const {
5465 raw_ptr()->kind_tag_ = static_cast<uint16_t>(value); 5475 raw_ptr()->kind_tag_ = static_cast<uint32_t>(value);
5466 } 5476 }
5467 5477
5468 5478
5469 void Function::set_num_fixed_parameters(intptr_t value) const { 5479 void Function::set_num_fixed_parameters(intptr_t value) const {
5470 ASSERT(value >= 0); 5480 ASSERT(value >= 0);
5471 ASSERT(Utils::IsInt(16, value)); 5481 ASSERT(Utils::IsInt(16, value));
5472 raw_ptr()->num_fixed_parameters_ = static_cast<int16_t>(value); 5482 raw_ptr()->num_fixed_parameters_ = static_cast<int16_t>(value);
5473 } 5483 }
5474 5484
5475 5485
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
6045 bool is_external, 6055 bool is_external,
6046 bool is_native, 6056 bool is_native,
6047 const Object& owner, 6057 const Object& owner,
6048 intptr_t token_pos) { 6058 intptr_t token_pos) {
6049 ASSERT(!owner.IsNull()); 6059 ASSERT(!owner.IsNull());
6050 const Function& result = Function::Handle(Function::New()); 6060 const Function& result = Function::Handle(Function::New());
6051 result.set_parameter_types(Object::empty_array()); 6061 result.set_parameter_types(Object::empty_array());
6052 result.set_parameter_names(Object::empty_array()); 6062 result.set_parameter_names(Object::empty_array());
6053 result.set_name(name); 6063 result.set_name(name);
6054 result.set_kind(kind); 6064 result.set_kind(kind);
6065 result.set_modifier(RawFunction::kNoModifier);
6055 result.set_is_static(is_static); 6066 result.set_is_static(is_static);
6056 result.set_is_const(is_const); 6067 result.set_is_const(is_const);
6057 result.set_is_abstract(is_abstract); 6068 result.set_is_abstract(is_abstract);
6058 result.set_is_external(is_external); 6069 result.set_is_external(is_external);
6059 result.set_is_native(is_native); 6070 result.set_is_native(is_native);
6060 result.set_is_visible(true); // Will be computed later. 6071 result.set_is_visible(true); // Will be computed later.
6061 result.set_is_intrinsic(false); 6072 result.set_is_intrinsic(false);
6062 result.set_is_recognized(false); 6073 result.set_is_recognized(false);
6063 result.set_is_redirecting(false); 6074 result.set_is_redirecting(false);
6075 result.set_is_async_closure(false);
6064 result.set_owner(owner); 6076 result.set_owner(owner);
6065 result.set_token_pos(token_pos); 6077 result.set_token_pos(token_pos);
6066 result.set_end_token_pos(token_pos); 6078 result.set_end_token_pos(token_pos);
6067 result.set_num_fixed_parameters(0); 6079 result.set_num_fixed_parameters(0);
6068 result.set_num_optional_parameters(0); 6080 result.set_num_optional_parameters(0);
6069 result.set_usage_counter(0); 6081 result.set_usage_counter(0);
6070 result.set_deoptimization_counter(0); 6082 result.set_deoptimization_counter(0);
6071 result.set_optimized_instruction_count(0); 6083 result.set_optimized_instruction_count(0);
6072 result.set_optimized_call_site_count(0); 6084 result.set_optimized_call_site_count(0);
6073 result.set_is_optimizable(is_native ? false : true); 6085 result.set_is_optimizable(is_native ? false : true);
(...skipping 13278 matching lines...) Expand 10 before | Expand all | Expand 10 after
19352 return tag_label.ToCString(); 19364 return tag_label.ToCString();
19353 } 19365 }
19354 19366
19355 19367
19356 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19368 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19357 Instance::PrintJSONImpl(stream, ref); 19369 Instance::PrintJSONImpl(stream, ref);
19358 } 19370 }
19359 19371
19360 19372
19361 } // namespace dart 19373 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698