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

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

Issue 10356051: First steps toward a two stages new compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/code_generator.h" 8 #include "vm/code_generator.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 // - Match found -> jump to target. 1517 // - Match found -> jump to target.
1518 // - Match not found -> jump to IC miss. 1518 // - Match not found -> jump to IC miss.
1519 void StubCode::GenerateNArgsCheckInlineCacheStub(Assembler* assembler, 1519 void StubCode::GenerateNArgsCheckInlineCacheStub(Assembler* assembler,
1520 intptr_t num_args) { 1520 intptr_t num_args) {
1521 __ movl(EBX, FieldAddress(ECX, ICData::function_offset())); 1521 __ movl(EBX, FieldAddress(ECX, ICData::function_offset()));
1522 __ incl(FieldAddress(EBX, Function::usage_counter_offset())); 1522 __ incl(FieldAddress(EBX, Function::usage_counter_offset()));
1523 if (CodeGenerator::CanOptimize()) { 1523 if (CodeGenerator::CanOptimize()) {
1524 __ cmpl(FieldAddress(EBX, Function::usage_counter_offset()), 1524 __ cmpl(FieldAddress(EBX, Function::usage_counter_offset()),
1525 Immediate(FLAG_optimization_counter_threshold)); 1525 Immediate(FLAG_optimization_counter_threshold));
1526 Label not_yet_hot; 1526 Label not_yet_hot;
1527 __ j(LESS_EQUAL, &not_yet_hot); 1527 __ j(LESS_EQUAL, &not_yet_hot, Assembler::kNearJump);
1528 __ EnterFrame(0); 1528 __ EnterFrame(0);
1529 __ pushl(ECX); // Preserve inline cache data object. 1529 __ pushl(ECX); // Preserve inline cache data object.
1530 __ pushl(EDX); // Preserve arguments array. 1530 __ pushl(EDX); // Preserve arguments array.
1531 __ pushl(EBX); // Argument for runtime: function object. 1531 __ pushl(EBX); // Argument for runtime: function object.
1532 __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry); 1532 __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry);
1533 __ popl(EBX); // Remove argument. 1533 __ popl(EBX); // Remove argument.
1534 __ popl(EDX); // Restore arguments array. 1534 __ popl(EDX); // Restore arguments array.
1535 __ popl(ECX); // Restore inline cache data object. 1535 __ popl(ECX); // Restore inline cache data object.
1536 __ LeaveFrame(); 1536 __ LeaveFrame();
1537 __ Bind(&not_yet_hot); 1537 __ Bind(&not_yet_hot);
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 // TOS + 2: instance. 1854 // TOS + 2: instance.
1855 // TOS + 3: cache array. 1855 // TOS + 3: cache array.
1856 // Result in ECX: null -> not found, otherwise result (true or false). 1856 // Result in ECX: null -> not found, otherwise result (true or false).
1857 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) { 1857 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) {
1858 GenerateSubtypeNTestCacheStub(assembler, 3); 1858 GenerateSubtypeNTestCacheStub(assembler, 3);
1859 } 1859 }
1860 1860
1861 } // namespace dart 1861 } // namespace dart
1862 1862
1863 #endif // defined TARGET_ARCH_IA32 1863 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698