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

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

Issue 16888013: Revert "Initial implementation of on-stack replacement (OSR)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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/stack_frame.h ('k') | runtime/vm/stub_code_x64.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/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 __ pushl(ic_reg); // Argument. 1428 __ pushl(ic_reg); // Argument.
1429 __ pushl(func_reg); // Argument. 1429 __ pushl(func_reg); // Argument.
1430 __ CallRuntime(kTraceICCallRuntimeEntry); 1430 __ CallRuntime(kTraceICCallRuntimeEntry);
1431 __ popl(EAX); // Discard argument; 1431 __ popl(EAX); // Discard argument;
1432 __ popl(EAX); // Discard argument; 1432 __ popl(EAX); // Discard argument;
1433 __ popl(ic_reg); // Restore. 1433 __ popl(ic_reg); // Restore.
1434 __ popl(argdesc_reg); // Restore. 1434 __ popl(argdesc_reg); // Restore.
1435 __ popl(func_reg); // Restore. 1435 __ popl(func_reg); // Restore.
1436 __ LeaveFrame(); 1436 __ LeaveFrame();
1437 } 1437 }
1438 Label is_hot;
1439 if (FlowGraphCompiler::CanOptimize()) {
1440 ASSERT(FLAG_optimization_counter_threshold > 1);
1441 __ cmpl(FieldAddress(func_reg, Function::usage_counter_offset()),
1442 Immediate(FLAG_optimization_counter_threshold));
1443 __ j(GREATER_EQUAL, &is_hot, Assembler::kNearJump);
1444 // As long as VM has no OSR do not optimize in the middle of the function
1445 // but only at exit so that we have collected all type feedback before
1446 // optimizing.
1447 }
1438 __ incl(FieldAddress(func_reg, Function::usage_counter_offset())); 1448 __ incl(FieldAddress(func_reg, Function::usage_counter_offset()));
1449 __ Bind(&is_hot);
1439 } 1450 }
1440 1451
1441 1452
1453
1442 // Loads function into 'temp_reg'. 1454 // Loads function into 'temp_reg'.
1443 void StubCode::GenerateUsageCounterIncrement(Assembler* assembler, 1455 void StubCode::GenerateUsageCounterIncrement(Assembler* assembler,
1444 Register temp_reg) { 1456 Register temp_reg) {
1445 Register ic_reg = ECX; 1457 Register ic_reg = ECX;
1446 Register func_reg = temp_reg; 1458 Register func_reg = temp_reg;
1447 ASSERT(ic_reg != func_reg); 1459 ASSERT(ic_reg != func_reg);
1448 __ movl(func_reg, FieldAddress(ic_reg, ICData::function_offset())); 1460 __ movl(func_reg, FieldAddress(ic_reg, ICData::function_offset()));
1461 Label is_hot;
1462 if (FlowGraphCompiler::CanOptimize()) {
1463 ASSERT(FLAG_optimization_counter_threshold > 1);
1464 // The usage_counter is always less than FLAG_optimization_counter_threshold
1465 // except when the function gets optimized.
1466 __ cmpl(FieldAddress(func_reg, Function::usage_counter_offset()),
1467 Immediate(FLAG_optimization_counter_threshold));
1468 __ j(EQUAL, &is_hot, Assembler::kNearJump);
1469 // As long as VM has no OSR do not optimize in the middle of the function
1470 // but only at exit so that we have collected all type feedback before
1471 // optimizing.
1472 }
1449 __ incl(FieldAddress(func_reg, Function::usage_counter_offset())); 1473 __ incl(FieldAddress(func_reg, Function::usage_counter_offset()));
1474 __ Bind(&is_hot);
1450 } 1475 }
1451 1476
1452 1477
1453 // Generate inline cache check for 'num_args'. 1478 // Generate inline cache check for 'num_args'.
1454 // ECX: Inline cache data object. 1479 // ECX: Inline cache data object.
1455 // EDX: Arguments descriptor array. 1480 // EDX: Arguments descriptor array.
1456 // TOS(0): return address 1481 // TOS(0): return address
1457 // Control flow: 1482 // Control flow:
1458 // - If receiver is null -> jump to IC miss. 1483 // - If receiver is null -> jump to IC miss.
1459 // - If receiver is Smi -> load Smi class. 1484 // - If receiver is Smi -> load Smi class.
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 __ Bind(&done); 2147 __ Bind(&done);
2123 __ popl(temp); 2148 __ popl(temp);
2124 __ popl(right); 2149 __ popl(right);
2125 __ popl(left); 2150 __ popl(left);
2126 __ ret(); 2151 __ ret();
2127 } 2152 }
2128 2153
2129 } // namespace dart 2154 } // namespace dart
2130 2155
2131 #endif // defined TARGET_ARCH_IA32 2156 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698