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

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

Issue 265443002: VM: Explicitly load function and context before calling a closure. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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) 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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 static_calls_target_table_.Add( 465 static_calls_target_table_.Add(
466 Smi::Handle(Smi::New(assembler()->CodeSize()))); 466 Smi::Handle(Smi::New(assembler()->CodeSize())));
467 ASSERT(Code::kSCallTableFunctionEntry == 1); 467 ASSERT(Code::kSCallTableFunctionEntry == 1);
468 static_calls_target_table_.Add(func); 468 static_calls_target_table_.Add(func);
469 ASSERT(Code::kSCallTableCodeEntry == 2); 469 ASSERT(Code::kSCallTableCodeEntry == 2);
470 static_calls_target_table_.Add(Code::Handle()); 470 static_calls_target_table_.Add(Code::Handle());
471 } 471 }
472 472
473 473
474 void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id, 474 void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id,
475 intptr_t token_pos) { 475 intptr_t token_pos,
476 intptr_t input_count) {
476 ASSERT(is_optimizing()); 477 ASSERT(is_optimizing());
478 Environment* env = pending_deoptimization_env_;
479 if (input_count > 0) {
480 env = env->DeepCopy(env->Length() - input_count);
481 }
477 CompilerDeoptInfo* info = 482 CompilerDeoptInfo* info =
478 new CompilerDeoptInfo(deopt_id, 483 new CompilerDeoptInfo(deopt_id,
479 ICData::kDeoptAtCall, 484 ICData::kDeoptAtCall,
480 pending_deoptimization_env_); 485 env);
481 info->set_pc_offset(assembler()->CodeSize()); 486 info->set_pc_offset(assembler()->CodeSize());
482 deopt_infos_.Add(info); 487 deopt_infos_.Add(info);
483 } 488 }
484 489
485 490
486 // This function must be in sync with FlowGraphCompiler::SaveLiveRegisters 491 // This function must be in sync with FlowGraphCompiler::SaveLiveRegisters
487 // and FlowGraphCompiler::SlowPathEnvironmentFor. 492 // and FlowGraphCompiler::SlowPathEnvironmentFor.
488 void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs) { 493 void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs) {
489 if (is_optimizing()) { 494 if (is_optimizing()) {
490 RegisterSet* registers = locs->live_registers(); 495 RegisterSet* registers = locs->live_registers();
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 1300
1296 for (int i = 0; i < len; i++) { 1301 for (int i = 0; i < len; i++) {
1297 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), 1302 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i),
1298 &Function::ZoneHandle(ic_data.GetTargetAt(i)), 1303 &Function::ZoneHandle(ic_data.GetTargetAt(i)),
1299 ic_data.GetCountAt(i))); 1304 ic_data.GetCountAt(i)));
1300 } 1305 }
1301 sorted->Sort(HighestCountFirst); 1306 sorted->Sort(HighestCountFirst);
1302 } 1307 }
1303 1308
1304 } // namespace dart 1309 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698