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

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

Issue 1334283004: Revert "Move megamorphic cache table into the Dart heap." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_compiler_arm.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/dart.h" 5 #include "vm/dart.h"
6 6
7 #include "vm/code_observers.h" 7 #include "vm/code_observers.h"
8 #include "vm/cpu.h" 8 #include "vm/cpu.h"
9 #include "vm/dart_api_state.h" 9 #include "vm/dart_api_state.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 instructions_snapshot, 151 instructions_snapshot,
152 T); 152 T);
153 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot()); 153 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot());
154 if (!error.IsNull()) { 154 if (!error.IsNull()) {
155 return error.ToCString(); 155 return error.ToCString();
156 } 156 }
157 if (FLAG_trace_isolates) { 157 if (FLAG_trace_isolates) {
158 OS::Print("Size of vm isolate snapshot = %" Pd "\n", 158 OS::Print("Size of vm isolate snapshot = %" Pd "\n",
159 snapshot->length()); 159 snapshot->length());
160 vm_isolate_->heap()->PrintSizes(); 160 vm_isolate_->heap()->PrintSizes();
161 MegamorphicCacheTable::PrintSizes(vm_isolate_); 161 vm_isolate_->megamorphic_cache_table()->PrintSizes();
162 intptr_t size; 162 intptr_t size;
163 intptr_t capacity; 163 intptr_t capacity;
164 Symbols::GetStats(vm_isolate_, &size, &capacity); 164 Symbols::GetStats(vm_isolate_, &size, &capacity);
165 OS::Print("VM Isolate: Number of symbols : %" Pd "\n", size); 165 OS::Print("VM Isolate: Number of symbols : %" Pd "\n", size);
166 OS::Print("VM Isolate: Symbol table capacity : %" Pd "\n", capacity); 166 OS::Print("VM Isolate: Symbol table capacity : %" Pd "\n", capacity);
167 } 167 }
168 } else { 168 } else {
169 Symbols::InitOnce(vm_isolate_); 169 Symbols::InitOnce(vm_isolate_);
170 } 170 }
171 Scanner::InitOnce(); 171 Scanner::InitOnce();
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 IsolateSnapshotReader reader(snapshot->content(), 287 IsolateSnapshotReader reader(snapshot->content(),
288 snapshot->length(), 288 snapshot->length(),
289 Object::instructions_snapshot_buffer(), 289 Object::instructions_snapshot_buffer(),
290 T); 290 T);
291 const Error& error = Error::Handle(reader.ReadFullSnapshot()); 291 const Error& error = Error::Handle(reader.ReadFullSnapshot());
292 if (!error.IsNull()) { 292 if (!error.IsNull()) {
293 return error.raw(); 293 return error.raw();
294 } 294 }
295 if (FLAG_trace_isolates) { 295 if (FLAG_trace_isolates) {
296 I->heap()->PrintSizes(); 296 I->heap()->PrintSizes();
297 MegamorphicCacheTable::PrintSizes(I); 297 I->megamorphic_cache_table()->PrintSizes();
298 } 298 }
299 } else { 299 } else {
300 // Populate the isolate's symbol table with all symbols from the 300 // Populate the isolate's symbol table with all symbols from the
301 // VM isolate. We do this so that when we generate a full snapshot 301 // VM isolate. We do this so that when we generate a full snapshot
302 // for the isolate we have a unified symbol table that we can then 302 // for the isolate we have a unified symbol table that we can then
303 // read into the VM isolate. 303 // read into the VM isolate.
304 Symbols::AddPredefinedSymbolsToIsolate(); 304 Symbols::AddPredefinedSymbolsToIsolate();
305 } 305 }
306 306
307 Object::VerifyBuiltinVtables(); 307 Object::VerifyBuiltinVtables();
308 308
309 { 309 {
310 TimelineDurationScope tds(I, I->GetIsolateStream(), "StubCode::Init"); 310 TimelineDurationScope tds(I, I->GetIsolateStream(), "StubCode::Init");
311 StubCode::Init(I); 311 StubCode::Init(I);
312 } 312 }
313 313
314 MegamorphicCacheTable::InitMissHandler(I); 314 I->megamorphic_cache_table()->InitMissHandler();
315 if (snapshot_buffer == NULL) { 315 if (snapshot_buffer == NULL) {
316 if (!I->object_store()->PreallocateObjects()) { 316 if (!I->object_store()->PreallocateObjects()) {
317 return I->object_store()->sticky_error(); 317 return I->object_store()->sticky_error();
318 } 318 }
319 } 319 }
320 320
321 I->heap()->EnableGrowthControl(); 321 I->heap()->EnableGrowthControl();
322 I->set_init_callback_data(data); 322 I->set_init_callback_data(data);
323 Api::SetupAcquiredError(I); 323 Api::SetupAcquiredError(I);
324 if (FLAG_print_class_table) { 324 if (FLAG_print_class_table) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 return predefined_handles_->handles_.IsValidScopedHandle(address); 381 return predefined_handles_->handles_.IsValidScopedHandle(address);
382 } 382 }
383 383
384 384
385 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { 385 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) {
386 ASSERT(predefined_handles_ != NULL); 386 ASSERT(predefined_handles_ != NULL);
387 return predefined_handles_->api_handles_.IsValidHandle(handle); 387 return predefined_handles_->api_handles_.IsValidHandle(handle);
388 } 388 }
389 389
390 } // namespace dart 390 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698