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

Unified Diff: vm/stub_code_ia32.cc

Issue 9965042: - Add a class index to the classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 9 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
« vm/snapshot.cc ('K') | « vm/snapshot.cc ('k') | vm/vm_sources.gypi » ('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 5947)
+++ vm/stub_code_ia32.cc (working copy)
@@ -624,7 +624,7 @@
const Immediate raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
- if (FLAG_inline_alloc) {
+ if (0 && FLAG_inline_alloc) {
// Compute the size to be allocated, it is based on the array length
// and it computed as:
// RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)).
@@ -978,7 +978,7 @@
void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
const Immediate raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
- if (FLAG_inline_alloc) {
+ if (0 && FLAG_inline_alloc) {
const Class& context_class = Class::ZoneHandle(Object::context_class());
Label slow_case;
Heap* heap = Isolate::Current()->heap();
@@ -1028,13 +1028,19 @@
__ cmpl(EBX, Immediate(RawObject::SizeTag::kMaxSizeTag));
__ j(ABOVE, &size_tag_overflow, Assembler::kNearJump);
__ shll(EBX, Immediate(RawObject::kSizeTagBit - kObjectAlignmentLog2));
- __ movl(FieldAddress(EAX, Context::tags_offset()), EBX); // Tags.
__ jmp(&done);
__ Bind(&size_tag_overflow);
// Set overflow size tag value.
- __ movl(FieldAddress(EAX, Context::tags_offset()), Immediate(0));
+ __ movl(EBX, Immediate(0));
+
__ Bind(&done);
+ // EAX: new object.
+ // EDX: number of context variables.
+ // EBX: size and bit tags.
+ __ orl(EBX,
+ Immediate(RawObject::ClassTag::encode(context_class.index())));
+ __ movl(FieldAddress(EAX, Context::tags_offset()), EBX); // Tags.
}
// Setup up number of context variables field.
@@ -1190,8 +1196,11 @@
__ LoadObject(EDX, cls); // Load class of object to be allocated.
__ movl(Address(EAX, Instance::class_offset()), EDX);
// Set the tags.
- __ movl(Address(EAX, Instance::tags_offset()),
- Immediate(RawObject::SizeTag::encode(instance_size)));
+ intptr_t tags = 0;
+ tags = RawObject::SizeTag::update(instance_size, tags);
+ ASSERT(cls.index() != kIllegalObjectKind);
+ tags = RawObject::ClassTag::update(cls.index(), tags);
+ __ movl(Address(EAX, Instance::tags_offset()), Immediate(tags));
// Initialize the remaining words of the object.
const Immediate raw_null =
@@ -1309,7 +1318,7 @@
const intptr_t kReceiverOffset = (has_type_arguments ? 2 : 1) * kWordSize;
const intptr_t closure_size = Closure::InstanceSize();
const intptr_t context_size = Context::InstanceSize(1); // Captured receiver.
- if (FLAG_inline_alloc &&
+ if (0 && FLAG_inline_alloc &&
PageSpace::IsPageAllocatableSize(closure_size + context_size)) {
Label slow_case;
Heap* heap = Isolate::Current()->heap();
« vm/snapshot.cc ('K') | « vm/snapshot.cc ('k') | vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698