| 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 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 field_name = Symbols::New("cid"#clazz); \ | 1450 field_name = Symbols::New("cid"#clazz); \ |
| 1451 field = Field::New(field_name, true, false, true, false, cls, 0); \ | 1451 field = Field::New(field_name, true, false, true, false, cls, 0); \ |
| 1452 value = Smi::New(k##clazz##Cid); \ | 1452 value = Smi::New(k##clazz##Cid); \ |
| 1453 field.set_value(value); \ | 1453 field.set_value(value); \ |
| 1454 field.set_type(Type::Handle(Type::IntType())); \ | 1454 field.set_type(Type::Handle(Type::IntType())); \ |
| 1455 cls.AddField(field); \ | 1455 cls.AddField(field); \ |
| 1456 | 1456 |
| 1457 CLASS_LIST_WITH_NULL(ADD_SET_FIELD) | 1457 CLASS_LIST_WITH_NULL(ADD_SET_FIELD) |
| 1458 #undef ADD_SET_FIELD | 1458 #undef ADD_SET_FIELD |
| 1459 | 1459 |
| 1460 object_store->InitAsyncObjects(); |
| 1461 |
| 1460 return Error::null(); | 1462 return Error::null(); |
| 1461 } | 1463 } |
| 1462 | 1464 |
| 1463 | 1465 |
| 1464 void Object::InitFromSnapshot(Isolate* isolate) { | 1466 void Object::InitFromSnapshot(Isolate* isolate) { |
| 1465 TIMERSCOPE(isolate, time_bootstrap); | 1467 TIMERSCOPE(isolate, time_bootstrap); |
| 1466 ObjectStore* object_store = isolate->object_store(); | 1468 ObjectStore* object_store = isolate->object_store(); |
| 1467 | 1469 |
| 1468 Class& cls = Class::Handle(); | 1470 Class& cls = Class::Handle(); |
| 1469 | 1471 |
| (...skipping 4021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5491 | 5493 |
| 5492 bool Function::IsOptimizable() const { | 5494 bool Function::IsOptimizable() const { |
| 5493 if (FLAG_coverage_dir != NULL) { | 5495 if (FLAG_coverage_dir != NULL) { |
| 5494 // Do not optimize if collecting coverage data. | 5496 // Do not optimize if collecting coverage data. |
| 5495 return false; | 5497 return false; |
| 5496 } | 5498 } |
| 5497 if (is_native()) { | 5499 if (is_native()) { |
| 5498 // Native methods don't need to be optimized. | 5500 // Native methods don't need to be optimized. |
| 5499 return false; | 5501 return false; |
| 5500 } | 5502 } |
| 5503 if (is_async_closure()) { |
| 5504 // TODO(hausner|fschneider): A suspected bug in the load elimination |
| 5505 // optimizer causes some async closures to fail. Until that bug is |
| 5506 // fixed, do not optimize async closures. |
| 5507 return false; |
| 5508 } |
| 5501 if (is_optimizable() && (script() != Script::null()) && | 5509 if (is_optimizable() && (script() != Script::null()) && |
| 5502 ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) { | 5510 ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) { |
| 5503 // Additional check needed for implicit getters. | 5511 // Additional check needed for implicit getters. |
| 5504 if (HasCode() && | 5512 if (HasCode() && |
| 5505 (Code::Handle(unoptimized_code()).Size() >= | 5513 (Code::Handle(unoptimized_code()).Size() >= |
| 5506 FLAG_huge_method_cutoff_in_code_size)) { | 5514 FLAG_huge_method_cutoff_in_code_size)) { |
| 5507 return false; | 5515 return false; |
| 5508 } else { | 5516 } else { |
| 5509 return true; | 5517 return true; |
| 5510 } | 5518 } |
| (...skipping 14754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20265 return tag_label.ToCString(); | 20273 return tag_label.ToCString(); |
| 20266 } | 20274 } |
| 20267 | 20275 |
| 20268 | 20276 |
| 20269 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20277 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 20270 Instance::PrintJSONImpl(stream, ref); | 20278 Instance::PrintJSONImpl(stream, ref); |
| 20271 } | 20279 } |
| 20272 | 20280 |
| 20273 | 20281 |
| 20274 } // namespace dart | 20282 } // namespace dart |
| OLD | NEW |