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

Unified Diff: vm/stub_code_x64.cc

Issue 10271032: - Add extra checking when validating objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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 | « vm/stub_code_ia32.cc ('k') | vm/verifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/stub_code_x64.cc
===================================================================
--- vm/stub_code_x64.cc (revision 7183)
+++ vm/stub_code_x64.cc (working copy)
@@ -1146,12 +1146,15 @@
__ movq(Address(RCX,
InstantiatedTypeArguments::instantiator_type_arguments_offset()),
RDX);
- __ LoadObject(RDX,
- Class::ZoneHandle(Object::instantiated_type_arguments_class()));
+ const Class& ita_cls =
+ Class::ZoneHandle(Object::instantiated_type_arguments_class());
+ __ LoadObject(RDX, ita_cls);
__ movq(Address(RCX, Instance::class_offset()), RDX); // Set its class.
// Set the tags.
- __ movq(Address(RCX, Instance::tags_offset()),
- Immediate(RawObject::SizeTag::encode(type_args_size)));
+ uword tags = 0;
+ tags = RawObject::SizeTag::update(type_args_size, tags);
+ tags = RawObject::ClassTag::update(ita_cls.index(), tags);
+ __ movq(Address(RCX, Instance::tags_offset()), Immediate(tags));
// Set the new InstantiatedTypeArguments object (RCX) as the type
// arguments (RDI) of the new object (RAX).
__ movq(RDI, RCX);
@@ -1170,7 +1173,7 @@
__ LoadObject(RDX, cls); // Load class of object to be allocated.
__ movq(Address(RAX, Instance::class_offset()), RDX);
// Set the tags.
- intptr_t tags = 0;
+ uword tags = 0;
tags = RawObject::SizeTag::update(instance_size, tags);
ASSERT(cls.index() != kIllegalObjectKind);
tags = RawObject::ClassTag::update(cls.index(), tags);
@@ -1325,7 +1328,7 @@
__ LoadObject(R10, cls); // Load signature class of closure.
__ movq(Address(RAX, Closure::class_offset()), R10);
// Set the tags.
- intptr_t tags = 0;
+ uword tags = 0;
tags = RawObject::SizeTag::update(closure_size, tags);
tags = RawObject::ClassTag::update(cls.index(), tags);
__ movq(Address(RAX, Closure::tags_offset()), Immediate(tags));
@@ -1353,7 +1356,7 @@
__ LoadObject(R13, context_class);
__ movq(Address(RBX, Context::class_offset()), R13);
// Set the tags.
- intptr_t tags = 0;
+ uword tags = 0;
tags = RawObject::SizeTag::update(context_size, tags);
tags = RawObject::ClassTag::update(context_class.index(), tags);
__ movq(Address(RBX, Context::tags_offset()), Immediate(tags));
« no previous file with comments | « vm/stub_code_ia32.cc ('k') | vm/verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698