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

Unified Diff: vm/stub_code_ia32.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/raw_object.cc ('k') | vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/stub_code_ia32.cc
===================================================================
--- vm/stub_code_ia32.cc (revision 7183)
+++ vm/stub_code_ia32.cc (working copy)
@@ -1148,12 +1148,15 @@
__ movl(Address(ECX,
InstantiatedTypeArguments::instantiator_type_arguments_offset()),
EDX);
- __ LoadObject(EDX,
- Class::ZoneHandle(Object::instantiated_type_arguments_class()));
+ const Class& ita_cls =
+ Class::ZoneHandle(Object::instantiated_type_arguments_class());
+ __ LoadObject(EDX, ita_cls);
__ movl(Address(ECX, Instance::class_offset()), EDX); // Set its class.
// Set the tags.
- __ movl(Address(ECX, 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);
+ __ movl(Address(ECX, Instance::tags_offset()), Immediate(tags));
// Set the new InstantiatedTypeArguments object (ECX) as the type
// arguments (EDI) of the new object (EAX).
__ movl(EDI, ECX);
@@ -1172,7 +1175,7 @@
__ LoadObject(EDX, cls); // Load class of object to be allocated.
__ movl(Address(EAX, Instance::class_offset()), EDX);
// 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(EDX, cls); // Load signature class of closure.
__ movl(Address(EAX, Closure::class_offset()), EDX);
// Set the tags.
- intptr_t tags = 0;
+ uword tags = 0;
tags = RawObject::SizeTag::update(closure_size, tags);
tags = RawObject::ClassTag::update(cls.index(), tags);
__ movl(Address(EAX, Closure::tags_offset()), Immediate(tags));
@@ -1353,7 +1356,7 @@
__ LoadObject(EBX, context_class);
__ movl(Address(ECX, Context::class_offset()), EBX);
// 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);
__ movl(Address(ECX, Context::tags_offset()), Immediate(tags));
« no previous file with comments | « vm/raw_object.cc ('k') | vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698