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

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 10448079: Address review comments in commited cl (issue 10460002). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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/stub_code_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 8115)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -1296,10 +1296,8 @@
// Called for inline allocation of closures.
// Input parameters:
-// If the signature class is not parameterized, the receiver, if any, will be
-// at ESP + 4 instead of ESP + 8, since no type arguments are passed.
-// ESP + 8 (or ESP + 4): receiver (only if implicit instance closure).
-// ESP + 4 : type arguments object (only if signature class is parameterized).
+// ESP + 8 : receiver (only if implicit instance closure).
+// ESP + 4 : type arguments object (null if class is no parameterized).
// ESP : points to return address.
// Uses EAX, EBX, ECX, EDX as temporary registers.
void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
@@ -1314,7 +1312,7 @@
const Class& cls = Class::ZoneHandle(func.signature_class());
const bool has_type_arguments = cls.HasTypeArguments();
const intptr_t kTypeArgumentsOffset = 1 * kWordSize;
- const intptr_t kReceiverOffset = (has_type_arguments ? 2 : 1) * kWordSize;
+ const intptr_t kReceiverOffset = 2 * kWordSize;
const intptr_t closure_size = Closure::InstanceSize();
const intptr_t context_size = Context::InstanceSize(1); // Captured receiver.
if (FLAG_inline_alloc &&
@@ -1403,15 +1401,8 @@
}
// Set the type arguments field in the newly allocated closure.
- if (has_type_arguments) {
- ASSERT(!is_implicit_static_closure);
- // Use the passed-in type arguments.
- __ movl(EDX, Address(ESP, kTypeArgumentsOffset));
- __ movl(Address(EAX, Closure::type_arguments_offset()), EDX);
- } else {
- // Set to null.
- __ movl(Address(EAX, Closure::type_arguments_offset()), raw_null);
- }
+ __ movl(EDX, Address(ESP, kTypeArgumentsOffset));
+ __ movl(Address(EAX, Closure::type_arguments_offset()), EDX);
__ movl(Address(EAX, Closure::smrck_offset()), raw_null);

Powered by Google App Engine
This is Rietveld 408576698