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

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

Issue 22915008: Tests for GuardField length check along with bug fixes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 5337 matching lines...) Expand 10 before | Expand all | Expand 10 after
5348 } else { 5348 } else {
5349 result.SetOffset(0); 5349 result.SetOffset(0);
5350 } 5350 }
5351 result.set_is_final(is_final); 5351 result.set_is_final(is_final);
5352 result.set_is_const(is_const); 5352 result.set_is_const(is_const);
5353 result.set_owner(owner); 5353 result.set_owner(owner);
5354 result.set_token_pos(token_pos); 5354 result.set_token_pos(token_pos);
5355 result.set_has_initializer(false); 5355 result.set_has_initializer(false);
5356 result.set_guarded_cid(kIllegalCid); 5356 result.set_guarded_cid(kIllegalCid);
5357 result.set_is_nullable(false); 5357 result.set_is_nullable(false);
5358 result.set_guarded_list_length(Field::kUnknownFixedLength); 5358 if (is_final) {
5359 result.set_guarded_list_length(Field::kUnknownFixedLength);
5360 } else {
5361 result.set_guarded_list_length(Field::kNoFixedLength);
5362 }
5359 result.set_dependent_code(Object::null_array()); 5363 result.set_dependent_code(Object::null_array());
5360 return result.raw(); 5364 return result.raw();
5361 } 5365 }
5362 5366
5363 5367
5364 5368
5365 RawField* Field::Clone(const Class& new_owner) const { 5369 RawField* Field::Clone(const Class& new_owner) const {
5366 Field& clone = Field::Handle(); 5370 Field& clone = Field::Handle();
5367 clone ^= Object::Clone(*this, Heap::kOld); 5371 clone ^= Object::Clone(*this, Heap::kOld);
5368 const Class& owner = Class::Handle(this->owner()); 5372 const Class& owner = Class::Handle(this->owner());
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
5568 if (list_length_unknown && list_length_changed && !force_invalidate) { 5572 if (list_length_unknown && list_length_changed && !force_invalidate) {
5569 // List length set for first time. 5573 // List length set for first time.
5570 set_guarded_list_length(list_length); 5574 set_guarded_list_length(list_length);
5571 return; 5575 return;
5572 } 5576 }
5573 5577
5574 if (!list_length_changed && !force_invalidate) { 5578 if (!list_length_changed && !force_invalidate) {
5575 // List length unchanged. 5579 // List length unchanged.
5576 return; 5580 return;
5577 } 5581 }
5578
5579 // Multiple list lengths assigned here, stop tracking length. 5582 // Multiple list lengths assigned here, stop tracking length.
5580 set_guarded_list_length(Field::kNoFixedLength); 5583 set_guarded_list_length(Field::kNoFixedLength);
5581 DeoptimizeDependentCode(); 5584 DeoptimizeDependentCode();
5582 } 5585 }
5583 5586
5584 5587
5585 void LiteralToken::set_literal(const String& literal) const { 5588 void LiteralToken::set_literal(const String& literal) const {
5586 StorePointer(&raw_ptr()->literal_, literal.raw()); 5589 StorePointer(&raw_ptr()->literal_, literal.raw());
5587 } 5590 }
5588 5591
(...skipping 9210 matching lines...) Expand 10 before | Expand all | Expand 10 after
14799 } 14802 }
14800 14803
14801 14804
14802 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 14805 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
14803 stream->OpenObject(); 14806 stream->OpenObject();
14804 stream->CloseObject(); 14807 stream->CloseObject();
14805 } 14808 }
14806 14809
14807 14810
14808 } // namespace dart 14811 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698