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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 1192103004: VM: New calling convention for generated code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ia32 port, addressed comments Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/flow_graph_compiler_ia32.cc
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 8df27dbc41ba19d88fd7e8082d2db15e78e01688..7e38ebcc8f3b85bbc3e8eacd1ddc3a7180247b05 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -188,7 +188,7 @@ void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler,
}
ASSERT(deopt_env() != NULL);
-
+ __ pushl(CODE_REG);
__ Call(*StubCode::Deoptimize_entry());
set_pc_offset(assem->CodeSize());
__ int3();
@@ -999,12 +999,9 @@ void FlowGraphCompiler::EmitFrameEntry() {
if (CanOptimizeFunction() &&
function.IsOptimizable() &&
(!is_optimizing() || may_reoptimize())) {
- const Register function_reg = EDI;
+ const Register function_reg = EBX;
__ LoadObject(function_reg, function);
- // Patch point is after the eventually inlined function object.
- entry_patch_pc_offset_ = assembler()->CodeSize();
-
// Reoptimization of an optimized function is triggered by counting in
// IC stubs, but not at the entry of the function.
if (!is_optimizing()) {
@@ -1012,10 +1009,8 @@ void FlowGraphCompiler::EmitFrameEntry() {
}
__ cmpl(FieldAddress(function_reg, Function::usage_counter_offset()),
Immediate(GetOptimizationThreshold()));
- ASSERT(function_reg == EDI);
+ ASSERT(function_reg == EBX);
__ J(GREATER_EQUAL, *StubCode::OptimizeFunction_entry());
- } else if (!flow_graph().IsCompiledForOsr()) {
- entry_patch_pc_offset_ = assembler()->CodeSize();
}
__ Comment("Enter frame");
if (flow_graph().IsCompiledForOsr()) {
@@ -1136,10 +1131,6 @@ void FlowGraphCompiler::CompileGraph() {
__ int3();
GenerateDeferredCode();
- // Emit function patching code. This will be swapped with the first 5 bytes
- // at entry point.
- patch_code_pc_offset_ = assembler()->CodeSize();
- __ Jmp(*StubCode::FixCallersTarget_entry());
if (is_optimizing()) {
lazy_deopt_pc_offset_ = assembler()->CodeSize();
@@ -1262,7 +1253,7 @@ void FlowGraphCompiler::EmitOptimizedInstanceCall(
// top-level function (parsed_function().function()) which could be
// reoptimized and which counter needs to be incremented.
// Pass the function explicitly, it is used in IC stub.
- __ LoadObject(EDI, parsed_function().function());
+ __ LoadObject(EBX, parsed_function().function());
__ LoadObject(ECX, ic_data);
GenerateDartCall(deopt_id,
token_pos,
@@ -1303,7 +1294,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
table->Lookup(name, arguments_descriptor));
- const Register receiverR = EDI;
+ const Register receiverR = ECX;
const Register cacheR = EBX;
const Register targetR = EBX;
__ movl(receiverR, Address(ESP, (argument_count - 1) * kWordSize));

Powered by Google App Engine
This is Rietveld 408576698