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

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

Issue 27802002: Disconnects code objects from infrequently used unoptimized functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
11 #include "vm/compiler.h"
11 #include "vm/dart_entry.h" 12 #include "vm/dart_entry.h"
12 #include "vm/deopt_instructions.h" 13 #include "vm/deopt_instructions.h"
13 #include "vm/il_printer.h" 14 #include "vm/il_printer.h"
14 #include "vm/locations.h" 15 #include "vm/locations.h"
15 #include "vm/object_store.h" 16 #include "vm/object_store.h"
16 #include "vm/parser.h" 17 #include "vm/parser.h"
17 #include "vm/stack_frame.h" 18 #include "vm/stack_frame.h"
18 #include "vm/stub_code.h" 19 #include "vm/stub_code.h"
19 #include "vm/symbols.h" 20 #include "vm/symbols.h"
20 21
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 __ j(ZERO, &call_target_function, Assembler::kNearJump); 1406 __ j(ZERO, &call_target_function, Assembler::kNearJump);
1406 __ cmpl(EDX, EAX); 1407 __ cmpl(EDX, EAX);
1407 __ j(NOT_EQUAL, &update, Assembler::kNearJump); 1408 __ j(NOT_EQUAL, &update, Assembler::kNearJump);
1408 1409
1409 __ Bind(&call_target_function); 1410 __ Bind(&call_target_function);
1410 // Call the target found in the cache. For a class id match, this is a 1411 // Call the target found in the cache. For a class id match, this is a
1411 // proper target for the given name and arguments descriptor. If the 1412 // proper target for the given name and arguments descriptor. If the
1412 // illegal class id was found, the target is a cache miss handler that can 1413 // illegal class id was found, the target is a cache miss handler that can
1413 // be invoked as a normal Dart function. 1414 // be invoked as a normal Dart function.
1414 __ movl(EAX, FieldAddress(EDI, ECX, TIMES_4, base + kWordSize)); 1415 __ movl(EAX, FieldAddress(EDI, ECX, TIMES_4, base + kWordSize));
1415 __ movl(EAX, FieldAddress(EAX, Function::code_offset())); 1416 __ movl(EBX, FieldAddress(EAX, Function::code_offset()));
1416 __ movl(EAX, FieldAddress(EAX, Code::instructions_offset())); 1417 if (FLAG_collect_code) {
1418 // If we are collecting code, the code object may be null.
1419 Label is_compiled;
1420 const Immediate& raw_null =
1421 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1422 __ cmpl(EBX, raw_null);
1423 __ j(NOT_EQUAL, &is_compiled, Assembler::kNearJump);
1424 __ EnterStubFrame();
1425 __ pushl(EDX); // Preserve arguments descriptor array.
1426 __ pushl(ECX); // Preserve IC data object.
1427 __ pushl(EAX); // Pass function.
1428 __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
1429 __ popl(EAX); // Restore function.
1430 __ popl(ECX); // Restore IC data array.
1431 __ popl(EDX); // Restore arguments descriptor array.
1432 __ LeaveFrame();
1433 __ movl(EBX, FieldAddress(EAX, Function::code_offset()));
1434 __ Bind(&is_compiled);
1435 }
1436 __ movl(EAX, FieldAddress(EBX, Code::instructions_offset()));
1417 __ LoadObject(ECX, ic_data); 1437 __ LoadObject(ECX, ic_data);
1418 __ LoadObject(EDX, arguments_descriptor); 1438 __ LoadObject(EDX, arguments_descriptor);
1419 __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); 1439 __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
1420 __ call(EAX); 1440 __ call(EAX);
1421 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); 1441 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos);
1422 RecordSafepoint(locs); 1442 RecordSafepoint(locs);
1423 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); 1443 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
1424 __ Drop(argument_count); 1444 __ Drop(argument_count);
1425 } 1445 }
1426 1446
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 __ movups(reg, Address(ESP, 0)); 1935 __ movups(reg, Address(ESP, 0));
1916 __ addl(ESP, Immediate(kFpuRegisterSize)); 1936 __ addl(ESP, Immediate(kFpuRegisterSize));
1917 } 1937 }
1918 1938
1919 1939
1920 #undef __ 1940 #undef __
1921 1941
1922 } // namespace dart 1942 } // namespace dart
1923 1943
1924 #endif // defined TARGET_ARCH_IA32 1944 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698