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

Unified Diff: runtime/vm/stub_code_x64.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
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 8143)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -1281,10 +1281,8 @@
// Called for inline allocation of closures.
// Input parameters:
-// If the signature class is not parameterized, the receiver, if any, will be
-// at RSP + 8 instead of RSP + 16, since no type arguments are passed.
-// RSP + 16 (or RSP + 8): receiver (only if implicit instance closure).
-// RSP + 8 : type arguments object (only if signature class is parameterized).
+// RSP + 16 : receiver (null if not an implicit instance closure).
+// RSP + 8 : type arguments object (null if class is not parameterized).
// RSP : points to return address.
void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
const Function& func) {
@@ -1298,7 +1296,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 &&
@@ -1390,15 +1388,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.
- __ movq(R10, Address(RSP, kTypeArgumentsOffset));
- __ movq(Address(RAX, Closure::type_arguments_offset()), R10);
- } else {
- // Set to null.
- __ movq(Address(RAX, Closure::type_arguments_offset()), raw_null);
- }
+ __ movq(R10, Address(RSP, kTypeArgumentsOffset));
+ __ movq(Address(RAX, Closure::type_arguments_offset()), R10);
__ movq(Address(RAX, Closure::smrck_offset()), raw_null);
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698