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

Unified Diff: runtime/vm/code_generator_ia32.cc

Issue 8234016: Inline allocation of implicit closures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator_ia32.cc
===================================================================
--- runtime/vm/code_generator_ia32.cc (revision 355)
+++ runtime/vm/code_generator_ia32.cc (working copy)
@@ -849,6 +849,7 @@
const ContextScope& context_scope = ContextScope::ZoneHandle(
node->scope()->PreserveOuterScope(current_context_level));
const Function& function = node->function();
+ ASSERT(function.IsNonImplicitClosureFunction());
ASSERT(!function.HasCode());
ASSERT(function.context_scope() == ContextScope::null());
function.set_context_scope(context_scope);
@@ -862,12 +863,13 @@
}
-void CodeGenerator::VisitStaticImplicitClosureNode(
- StaticImplicitClosureNode* node) {
+void CodeGenerator::VisitImplicitStaticClosureNode(
+ ImplicitStaticClosureNode* node) {
const Function& function = node->function();
+ ASSERT(function.IsImplicitStaticClosureFunction());
ASSERT(function.context_scope() != ContextScope::null());
const Code& stub = Code::Handle(
- StubCode::GetAllocationStubForStaticImplicitClosure(function));
+ StubCode::GetAllocationStubForClosure(function));
const ExternalLabel label(function.ToCString(), stub.EntryPoint());
GenerateCall(node->token_index(), &label);
if (IsResultNeeded(node)) {
@@ -876,24 +878,17 @@
}
-void CodeGenerator::VisitImplicitClosureNode(ImplicitClosureNode* node) {
+void CodeGenerator::VisitImplicitInstanceClosureNode(
+ ImplicitInstanceClosureNode* node) {
const Function& function = node->function();
+ ASSERT(function.IsImplicitInstanceClosureFunction());
ASSERT(function.context_scope() != ContextScope::null());
- const Immediate raw_null =
- Immediate(reinterpret_cast<intptr_t>(Object::null()));
- Label null_receiver;
node->receiver()->Visit(this);
- __ popl(EAX); // Get receiver.
- const Object& result = Object::ZoneHandle();
- __ PushObject(result); // Make room for the result of the runtime call.
- __ PushObject(function); // Push the type.
- __ pushl(EAX); // Push the receiver.
- GenerateCallRuntime(node->token_index(),
- kAllocateImplicitClosureRuntimeEntry);
- // Pop the parameters supplied to the runtime entry. The result of the
- // type check runtime call is the checked value.
- __ addl(ESP, Immediate(2 * kWordSize));
- __ popl(EAX); // Allocated closure.
+ const Code& stub = Code::Handle(
+ StubCode::GetAllocationStubForClosure(function));
+ const ExternalLabel label(function.ToCString(), stub.EntryPoint());
+ GenerateCall(node->token_index(), &label);
+ __ popl(ECX); // Pop receiver.
if (IsResultNeeded(node)) {
__ pushl(EAX);
}
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698