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

Unified Diff: runtime/vm/assembler_macros_x64.cc

Issue 8760015: Disable x64 disassembler under win32. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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_macros_x64.h ('k') | runtime/vm/disassembler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_macros_x64.cc
===================================================================
--- runtime/vm/assembler_macros_x64.cc (revision 0)
+++ runtime/vm/assembler_macros_x64.cc (revision 0)
@@ -0,0 +1,58 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "vm/globals.h"
+#if defined(TARGET_ARCH_X64)
+
+#include "vm/assembler_macros.h"
+
+#include "vm/assembler.h"
+
+namespace dart {
+
+DECLARE_FLAG(bool, inline_alloc);
+
+#define __ assembler->
+
+// Static.
+void AssemblerMacros::TryAllocate(Assembler* assembler,
+ const Class& cls,
+ Register class_reg,
+ Label* failure,
+ Register instance_reg) {
+#if defined(DEBUG)
+ __ Untested("AssemblerMacros::TryAllocate");
+ Label ok;
+ __ LoadObject(instance_reg, cls);
+ __ cmpl(instance_reg, class_reg);
+ __ j(EQUAL, &ok, Assembler::kNearJump);
+ __ Stop("AssemblerMacros::TryAllocate, wrong arguments");
+ __ Bind(&ok);
+#endif
+ ASSERT(failure != NULL);
+ ASSERT(class_reg != instance_reg);
+ if (FLAG_inline_alloc) {
+ Heap* heap = Isolate::Current()->heap();
+ const intptr_t instance_size = cls.instance_size();
+ __ movq(instance_reg, Address::Absolute(heap->TopAddress()));
+ __ addq(instance_reg, Immediate(instance_size));
+ // instance_reg: potential next object start.
+ __ cmpq(instance_reg, Address::Absolute(heap->EndAddress()));
+ __ j(ABOVE_EQUAL, failure, Assembler::kNearJump);
+ // Successfully allocated the object, now update top to point to
+ // next object start and store the class in the class field of object.
+ __ movq(Address::Absolute(heap->TopAddress()), instance_reg);
+ ASSERT(instance_size >= kHeapObjectTag);
+ __ subq(instance_reg, Immediate(instance_size - kHeapObjectTag));
+ __ movq(FieldAddress(instance_reg, Instance::class_offset()), class_reg);
+ } else {
+ __ jmp(failure);
+ }
+}
+
+#undef __
+
+} // namespace dart
+
+#endif // defined TARGET_ARCH_X64
« no previous file with comments | « runtime/vm/assembler_macros_x64.h ('k') | runtime/vm/disassembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698