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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 1192103004: VM: New calling convention for generated code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index fb55f660f397e597849ddd6bd71d4f0e290e08bf..af73e52a6be8c4c38c6815bd5c330fd6b38cdd16 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -2933,16 +2933,16 @@ LocationSummary* InstanceCallInstr::MakeLocationSummary(Zone* zone,
}
-static uword TwoArgsSmiOpInlineCacheEntry(Token::Kind kind) {
+static RawCode* TwoArgsSmiOpInlineCacheCode(Token::Kind kind) {
if (!FLAG_two_args_smi_icd) {
return 0;
}
StubCode* stub_code = Isolate::Current()->stub_code();
switch (kind) {
- case Token::kADD: return stub_code->SmiAddInlineCacheEntryPoint();
- case Token::kSUB: return stub_code->SmiSubInlineCacheEntryPoint();
- case Token::kEQ: return stub_code->SmiEqualInlineCacheEntryPoint();
- default: return 0;
+ case Token::kADD: return stub_code->SmiAddInlineCacheCode();
+ case Token::kSUB: return stub_code->SmiSubInlineCacheCode();
+ case Token::kEQ: return stub_code->SmiEqualInlineCacheCode();
+ default: return Code::null();
}
}
@@ -2983,8 +2983,8 @@ void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Unoptimized code.
ASSERT(!HasICData());
bool is_smi_two_args_op = false;
- const uword label_address = TwoArgsSmiOpInlineCacheEntry(token_kind());
- if (label_address != 0) {
+ Code& stub = Code::Handle(TwoArgsSmiOpInlineCacheCode(token_kind()));
+ if (stub.raw() != Code::null()) {
// We have a dedicated inline cache stub for this operation, add an
// an initial Smi/Smi check with count 0.
ASSERT(call_ic_data->NumArgsTested() == 2);
@@ -3012,8 +3012,7 @@ void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
if (is_smi_two_args_op) {
ASSERT(ArgumentCount() == 2);
- ExternalLabel target_label(label_address);
- compiler->EmitInstanceCall(&target_label, *call_ic_data, ArgumentCount(),
+ compiler->EmitInstanceCall(stub, *call_ic_data, ArgumentCount(),
deopt_id(), token_pos(), locs());
} else if (FLAG_ic_range_profiling &&
(Token::IsBinaryArithmeticOperator(token_kind()) ||
@@ -3023,10 +3022,10 @@ void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(Token::IsBinaryArithmeticOperator(token_kind()) ==
(ArgumentCount() == 2));
StubCode* stub_code = compiler->isolate()->stub_code();
- ExternalLabel target_label((ArgumentCount() == 1) ?
- stub_code->UnaryRangeCollectingInlineCacheEntryPoint() :
- stub_code->BinaryRangeCollectingInlineCacheEntryPoint());
- compiler->EmitInstanceCall(&target_label, *call_ic_data, ArgumentCount(),
+ stub = ((ArgumentCount() == 1) ?
+ stub_code->UnaryRangeCollectingInlineCacheCode() :
+ stub_code->BinaryRangeCollectingInlineCacheCode());
+ compiler->EmitInstanceCall(stub, *call_ic_data, ArgumentCount(),
deopt_id(), token_pos(), locs());
} else {
compiler->GenerateInstanceCall(deopt_id(),

Powered by Google App Engine
This is Rietveld 408576698