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

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

Issue 1073173003: Eliminate object table and use regular object pool for deoptimization infos. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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/raw_object.h » ('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 12002 matching lines...) Expand 10 before | Expand all | Expand 10 after
12013 StorePointer(&raw_ptr()->stackmaps_, maps.raw()); 12013 StorePointer(&raw_ptr()->stackmaps_, maps.raw());
12014 } 12014 }
12015 12015
12016 12016
12017 void Code::set_deopt_info_array(const Array& array) const { 12017 void Code::set_deopt_info_array(const Array& array) const {
12018 ASSERT(array.IsOld()); 12018 ASSERT(array.IsOld());
12019 StorePointer(&raw_ptr()->deopt_info_array_, array.raw()); 12019 StorePointer(&raw_ptr()->deopt_info_array_, array.raw());
12020 } 12020 }
12021 12021
12022 12022
12023 void Code::set_object_table(const Array& array) const {
12024 ASSERT(array.IsOld());
12025 StorePointer(&raw_ptr()->object_table_, array.raw());
12026 }
12027
12028
12029 void Code::set_static_calls_target_table(const Array& value) const { 12023 void Code::set_static_calls_target_table(const Array& value) const {
12030 StorePointer(&raw_ptr()->static_calls_target_table_, value.raw()); 12024 StorePointer(&raw_ptr()->static_calls_target_table_, value.raw());
12031 #if defined(DEBUG) 12025 #if defined(DEBUG)
12032 // Check that the table is sorted by pc offsets. 12026 // Check that the table is sorted by pc offsets.
12033 // FlowGraphCompiler::AddStaticCallTarget adds pc-offsets to the table while 12027 // FlowGraphCompiler::AddStaticCallTarget adds pc-offsets to the table while
12034 // emitting assembly. This guarantees that every succeeding pc-offset is 12028 // emitting assembly. This guarantees that every succeeding pc-offset is
12035 // larger than the previously added one. 12029 // larger than the previously added one.
12036 for (intptr_t i = kSCallTableEntryLength; 12030 for (intptr_t i = kSCallTableEntryLength;
12037 i < value.Length(); 12031 i < value.Length();
12038 i += kSCallTableEntryLength) { 12032 i += kSCallTableEntryLength) {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
12268 instrs.raw()->StorePointer(reinterpret_cast<RawObject**>(addr), 12262 instrs.raw()->StorePointer(reinterpret_cast<RawObject**>(addr),
12269 object->raw()); 12263 object->raw());
12270 } 12264 }
12271 12265
12272 // Hook up Code and Instructions objects. 12266 // Hook up Code and Instructions objects.
12273 instrs.set_code(code.raw()); 12267 instrs.set_code(code.raw());
12274 code.set_instructions(instrs.raw()); 12268 code.set_instructions(instrs.raw());
12275 code.set_is_alive(true); 12269 code.set_is_alive(true);
12276 12270
12277 // Set object pool in Instructions object. 12271 // Set object pool in Instructions object.
12278 const GrowableObjectArray& object_pool = assembler->object_pool(); 12272 const GrowableObjectArray& object_pool = assembler->object_pool_data();
12279 if (object_pool.IsNull()) { 12273 if (object_pool.IsNull()) {
12280 instrs.set_object_pool(Object::empty_array().raw()); 12274 instrs.set_object_pool(Object::empty_array().raw());
12281 } else { 12275 } else {
12282 // TODO(regis): Once MakeArray takes a Heap::Space argument, call it here 12276 // TODO(regis): Once MakeArray takes a Heap::Space argument, call it here
12283 // with Heap::kOld and change the ARM and MIPS assemblers to work with a 12277 // with Heap::kOld and change the ARM and MIPS assemblers to work with a
12284 // GrowableObjectArray in new space. 12278 // GrowableObjectArray in new space.
12285 instrs.set_object_pool(Array::MakeArray(object_pool)); 12279 instrs.set_object_pool(Array::MakeArray(object_pool));
12286 } 12280 }
12287 if (FLAG_write_protect_code) { 12281 if (FLAG_write_protect_code) {
12288 uword address = RawObject::ToAddr(instrs.raw()); 12282 uword address = RawObject::ToAddr(instrs.raw());
(...skipping 8370 matching lines...) Expand 10 before | Expand all | Expand 10 after
20659 return tag_label.ToCString(); 20653 return tag_label.ToCString();
20660 } 20654 }
20661 20655
20662 20656
20663 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20657 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20664 Instance::PrintJSONImpl(stream, ref); 20658 Instance::PrintJSONImpl(stream, ref);
20665 } 20659 }
20666 20660
20667 20661
20668 } // namespace dart 20662 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698