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

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

Issue 203523011: Introduce a lazy-compile stub for functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 6 years, 8 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/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.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" // 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"
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 __ cmpl(EDX, EAX); 1323 __ cmpl(EDX, EAX);
1324 __ j(NOT_EQUAL, &update, Assembler::kNearJump); 1324 __ j(NOT_EQUAL, &update, Assembler::kNearJump);
1325 1325
1326 __ Bind(&call_target_function); 1326 __ Bind(&call_target_function);
1327 // Call the target found in the cache. For a class id match, this is a 1327 // Call the target found in the cache. For a class id match, this is a
1328 // proper target for the given name and arguments descriptor. If the 1328 // proper target for the given name and arguments descriptor. If the
1329 // illegal class id was found, the target is a cache miss handler that can 1329 // illegal class id was found, the target is a cache miss handler that can
1330 // be invoked as a normal Dart function. 1330 // be invoked as a normal Dart function.
1331 __ movl(EAX, FieldAddress(EDI, ECX, TIMES_4, base + kWordSize)); 1331 __ movl(EAX, FieldAddress(EDI, ECX, TIMES_4, base + kWordSize));
1332 __ movl(EBX, FieldAddress(EAX, Function::code_offset())); 1332 __ movl(EBX, FieldAddress(EAX, Function::code_offset()));
1333 if (FLAG_collect_code) { 1333 __ movl(EBX, FieldAddress(EBX, Code::instructions_offset()));
1334 // If we are collecting code, the code object may be null.
1335 Label is_compiled;
1336 const Immediate& raw_null =
1337 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1338 __ cmpl(EBX, raw_null);
1339 __ j(NOT_EQUAL, &is_compiled, Assembler::kNearJump);
1340 __ call(&StubCode::CompileFunctionRuntimeCallLabel());
1341 AddCurrentDescriptor(PcDescriptors::kRuntimeCall,
1342 Isolate::kNoDeoptId,
1343 token_pos);
1344 RecordSafepoint(locs);
1345 __ movl(EBX, FieldAddress(EAX, Function::code_offset()));
1346 __ Bind(&is_compiled);
1347 }
1348 __ movl(EAX, FieldAddress(EBX, Code::instructions_offset()));
1349 __ LoadObject(ECX, ic_data); 1334 __ LoadObject(ECX, ic_data);
1350 __ LoadObject(EDX, arguments_descriptor); 1335 __ LoadObject(EDX, arguments_descriptor);
1351 __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); 1336 __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
1352 __ call(EAX); 1337 __ call(EBX);
1353 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); 1338 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos);
1354 RecordSafepoint(locs); 1339 RecordSafepoint(locs);
1355 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); 1340 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
1356 __ Drop(argument_count); 1341 __ Drop(argument_count);
1357 } 1342 }
1358 1343
1359 1344
1360 void FlowGraphCompiler::EmitOptimizedStaticCall( 1345 void FlowGraphCompiler::EmitOptimizedStaticCall(
1361 const Function& function, 1346 const Function& function,
1362 const Array& arguments_descriptor, 1347 const Array& arguments_descriptor,
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 __ movups(reg, Address(ESP, 0)); 1803 __ movups(reg, Address(ESP, 0));
1819 __ addl(ESP, Immediate(kFpuRegisterSize)); 1804 __ addl(ESP, Immediate(kFpuRegisterSize));
1820 } 1805 }
1821 1806
1822 1807
1823 #undef __ 1808 #undef __
1824 1809
1825 } // namespace dart 1810 } // namespace dart
1826 1811
1827 #endif // defined TARGET_ARCH_IA32 1812 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698