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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 10873027: Use the location summary to represent safepoint information. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.h ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_x64.cc
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 7ba260604b9b4154f181467a8155253a4e126271..a774e825cb3011a1cf1a794981c06d53d73adf27 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -454,7 +454,7 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t deopt_id,
intptr_t try_index,
const AbstractType& type,
bool negate_result,
- BitmapBuilder* stack_bitmap) {
+ LocationSummary* locs) {
ASSERT(type.IsFinalized() && !type.IsMalformed());
const Immediate raw_null =
@@ -495,7 +495,7 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t deopt_id,
__ LoadObject(RAX, test_cache);
__ pushq(RAX);
GenerateCallRuntime(deopt_id, token_pos, try_index,
- kInstanceofRuntimeEntry, stack_bitmap);
+ kInstanceofRuntimeEntry, locs);
// Pop the parameters supplied to the runtime entry. The result of the
// instanceof runtime call will be left as the result of the operation.
__ Drop(5);
@@ -539,7 +539,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t deopt_id,
intptr_t try_index,
const AbstractType& dst_type,
const String& dst_name,
- BitmapBuilder* stack_bitmap) {
+ LocationSummary* locs) {
ASSERT(token_pos >= 0);
ASSERT(!dst_type.IsNull());
ASSERT(dst_type.IsFinalized());
@@ -568,7 +568,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t deopt_id,
token_pos,
try_index,
kMalformedTypeErrorRuntimeEntry,
- stack_bitmap);
+ locs);
// We should never return here.
__ int3();
@@ -598,7 +598,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t deopt_id,
token_pos,
try_index,
kTypeCheckRuntimeEntry,
- stack_bitmap);
+ locs);
// Pop the parameters supplied to the runtime entry. The result of the
// type check runtime call is the checked value.
__ Drop(6);
@@ -774,11 +774,13 @@ void FlowGraphCompiler::CopyParameters() {
// dropped the spill slots.
BitmapBuilder* empty_stack_bitmap = new BitmapBuilder();
if (function.IsClosureFunction()) {
- GenerateCallRuntime(Isolate::kNoDeoptId,
- 0,
- CatchClauseNode::kInvalidTryIndex,
- kClosureArgumentMismatchRuntimeEntry,
- empty_stack_bitmap);
+ // We do not use GenerateCallRuntime because of the non-standard (empty)
+ // stackmap used here.
+ __ CallRuntime(kClosureArgumentMismatchRuntimeEntry);
+ AddCurrentDescriptor(PcDescriptors::kOther,
+ Isolate::kNoDeoptId,
+ 0, // No token position.
+ CatchClauseNode::kInvalidTryIndex);
} else {
ASSERT(!IsLeaf());
// Invoke noSuchMethod function.
@@ -797,20 +799,26 @@ void FlowGraphCompiler::CopyParameters() {
// RBX : ic-data.
// R10 : arguments descriptor array.
__ call(&StubCode::CallNoSuchMethodFunctionLabel());
- if (is_optimizing()) {
- stackmap_table_builder_->AddEntry(assembler()->CodeSize(),
- empty_stack_bitmap);
- }
+ }
+ if (is_optimizing()) {
+ stackmap_table_builder_->AddEntry(assembler()->CodeSize(),
+ empty_stack_bitmap);
}
if (FLAG_trace_functions) {
__ pushq(RAX); // Preserve result.
__ PushObject(Function::ZoneHandle(function.raw()));
- GenerateCallRuntime(Isolate::kNoDeoptId,
- 0,
- CatchClauseNode::kInvalidTryIndex,
- kTraceFunctionExitRuntimeEntry,
- empty_stack_bitmap);
+ // We do not use GenerateCallRuntime because of the non-standard (empty)
+ // stackmap used here.
+ __ CallRuntime(kTraceFunctionExitRuntimeEntry);
+ AddCurrentDescriptor(PcDescriptors::kOther,
+ Isolate::kNoDeoptId,
+ 0, // No token position.
+ CatchClauseNode::kInvalidTryIndex);
+ if (is_optimizing()) {
+ stackmap_table_builder_->AddEntry(assembler()->CodeSize(),
+ empty_stack_bitmap);
+ }
__ popq(RAX); // Remove argument.
__ popq(RAX); // Restore result.
}
@@ -915,11 +923,11 @@ void FlowGraphCompiler::CompileGraph() {
// For optimized code, keep a bitmap of the frame in order to build
// stackmaps for GC safepoints in the prologue.
- BitmapBuilder* stack_bitmap = NULL;
+ LocationSummary* prologue_locs = NULL;
if (is_optimizing()) {
// Spill slots are allocated but not initialized.
- stack_bitmap = new BitmapBuilder();
- stack_bitmap->SetLength(StackSize());
+ prologue_locs = new LocationSummary(0, 0, LocationSummary::kCall);
+ prologue_locs->stack_bitmap()->SetLength(StackSize());
}
// We check the number of passed arguments when we have to copy them due to
@@ -945,7 +953,7 @@ void FlowGraphCompiler::CompileGraph() {
function.token_pos(),
CatchClauseNode::kInvalidTryIndex,
kClosureArgumentMismatchRuntimeEntry,
- stack_bitmap);
+ prologue_locs);
} else {
__ Stop("Wrong number of arguments");
}
@@ -999,13 +1007,11 @@ void FlowGraphCompiler::GenerateCall(intptr_t token_pos,
intptr_t try_index,
const ExternalLabel* label,
PcDescriptors::Kind kind,
- BitmapBuilder* stack_bitmap) {
+ LocationSummary* locs) {
ASSERT(!IsLeaf());
__ call(label);
- if (is_optimizing() && (stack_bitmap != NULL)) {
- stackmap_table_builder_->AddEntry(assembler()->CodeSize(), stack_bitmap);
- }
AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos, try_index);
+ RecordSafepoint(locs);
}
@@ -1013,42 +1019,49 @@ void FlowGraphCompiler::GenerateCallRuntime(intptr_t deopt_id,
intptr_t token_pos,
intptr_t try_index,
const RuntimeEntry& entry,
- BitmapBuilder* stack_bitmap) {
+ LocationSummary* locs) {
ASSERT(!IsLeaf());
- ASSERT(!is_optimizing() || (stack_bitmap != NULL));
__ CallRuntime(entry);
- if (is_optimizing()) {
- stackmap_table_builder_->AddEntry(assembler()->CodeSize(), stack_bitmap);
- }
AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos, try_index);
+ RecordSafepoint(locs);
}
-intptr_t FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label,
- const ICData& ic_data,
- const Array& arguments_descriptor,
- intptr_t argument_count) {
+void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label,
+ const ICData& ic_data,
+ const Array& arguments_descriptor,
+ intptr_t argument_count,
+ intptr_t deopt_id,
+ intptr_t token_pos,
+ intptr_t try_index,
+ LocationSummary* locs) {
ASSERT(!IsLeaf());
__ LoadObject(RBX, ic_data);
__ LoadObject(R10, arguments_descriptor);
__ call(target_label);
- const intptr_t descr_offset = assembler()->CodeSize();
+ AddCurrentDescriptor(PcDescriptors::kIcCall, deopt_id, token_pos, try_index);
+ RecordSafepoint(locs);
+
__ Drop(argument_count);
- return descr_offset;
}
-intptr_t FlowGraphCompiler::EmitStaticCall(const Function& function,
- const Array& arguments_descriptor,
- intptr_t argument_count) {
+void FlowGraphCompiler::EmitStaticCall(const Function& function,
+ const Array& arguments_descriptor,
+ intptr_t argument_count,
+ intptr_t deopt_id,
+ intptr_t token_pos,
+ intptr_t try_index,
+ LocationSummary* locs) {
ASSERT(!IsLeaf());
__ LoadObject(RBX, function);
__ LoadObject(R10, arguments_descriptor);
__ call(&StubCode::CallStaticFunctionLabel());
- const intptr_t descr_offset = assembler()->CodeSize();
+ AddCurrentDescriptor(PcDescriptors::kFuncCall, deopt_id, token_pos,
+ try_index);
+ RecordSafepoint(locs);
__ Drop(argument_count);
- return descr_offset;
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.h ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698