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

Unified Diff: runtime/vm/assembler_ia32.cc

Issue 12398029: Remove the barely used macro assemblers after merging their contents to the base (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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/assembler_ia32.h ('k') | runtime/vm/assembler_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
===================================================================
--- runtime/vm/assembler_ia32.cc (revision 19430)
+++ runtime/vm/assembler_ia32.cc (working copy)
@@ -17,6 +17,7 @@
DEFINE_FLAG(bool, print_stop_message, true, "Print stop message.");
DEFINE_FLAG(bool, use_sse41, true, "Use SSE 4.1 if available");
+DECLARE_FLAG(bool, inline_alloc);
bool CPUFeatures::sse2_supported_ = false;
@@ -2114,6 +2115,58 @@
}
+void Assembler::TryAllocate(const Class& cls,
+ Label* failure,
+ bool near_jump,
+ Register instance_reg) {
+ ASSERT(failure != NULL);
+ if (FLAG_inline_alloc) {
+ Heap* heap = Isolate::Current()->heap();
+ const intptr_t instance_size = cls.instance_size();
+ movl(instance_reg, Address::Absolute(heap->TopAddress()));
+ addl(instance_reg, Immediate(instance_size));
+ // instance_reg: potential next object start.
+ cmpl(instance_reg, Address::Absolute(heap->EndAddress()));
+ j(ABOVE_EQUAL, failure, near_jump);
+ // Successfully allocated the object, now update top to point to
+ // next object start and store the class in the class field of object.
+ movl(Address::Absolute(heap->TopAddress()), instance_reg);
+ ASSERT(instance_size >= kHeapObjectTag);
+ subl(instance_reg, Immediate(instance_size - kHeapObjectTag));
+ uword tags = 0;
+ tags = RawObject::SizeTag::update(instance_size, tags);
+ ASSERT(cls.id() != kIllegalCid);
+ tags = RawObject::ClassIdTag::update(cls.id(), tags);
+ movl(FieldAddress(instance_reg, Object::tags_offset()), Immediate(tags));
+ } else {
+ jmp(failure);
+ }
+}
+
+
+void Assembler::EnterDartFrame(intptr_t frame_size) {
+ const intptr_t offset = CodeSize();
+ EnterFrame(0);
+ Label dart_entry;
+ call(&dart_entry);
+ Bind(&dart_entry);
+ // Adjust saved PC for any intrinsic code that could have been generated
+ // before a frame is created.
+ if (offset != 0) {
+ addl(Address(ESP, 0), Immediate(-offset));
+ }
+ if (frame_size != 0) {
+ subl(ESP, Immediate(frame_size));
+ }
+}
+
+
+void Assembler::EnterStubFrame() {
+ EnterFrame(0);
+ pushl(Immediate(0)); // Push 0 in the saved PC area for stub frames.
+}
+
+
void Assembler::Stop(const char* message) {
if (FLAG_print_stop_message) {
pushl(EAX); // Preserve EAX.
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698