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

Side by Side Diff: runtime/vm/assembler_macros_x64.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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_macros_x64.h ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_X64)
7
8 #include "vm/assembler_macros.h"
9
10 #include "vm/assembler.h"
11
12 namespace dart {
13
14 DECLARE_FLAG(bool, inline_alloc);
15
16 #define __ assembler->
17
18 // Static.
19 void AssemblerMacros::TryAllocate(Assembler* assembler,
20 const Class& cls,
21 Label* failure,
22 bool near_jump,
23 Register instance_reg) {
24 ASSERT(failure != NULL);
25 if (FLAG_inline_alloc) {
26 Heap* heap = Isolate::Current()->heap();
27 const intptr_t instance_size = cls.instance_size();
28 __ movq(TMP, Immediate(heap->TopAddress()));
29 __ movq(instance_reg, Address(TMP, 0));
30 __ addq(instance_reg, Immediate(instance_size));
31 // instance_reg: potential next object start.
32 __ movq(TMP, Immediate(heap->EndAddress()));
33 __ cmpq(instance_reg, Address(TMP, 0));
34 __ j(ABOVE_EQUAL, failure, near_jump);
35 // Successfully allocated the object, now update top to point to
36 // next object start and store the class in the class field of object.
37 __ movq(TMP, Immediate(heap->TopAddress()));
38 __ movq(Address(TMP, 0), instance_reg);
39 ASSERT(instance_size >= kHeapObjectTag);
40 __ subq(instance_reg, Immediate(instance_size - kHeapObjectTag));
41 uword tags = 0;
42 tags = RawObject::SizeTag::update(instance_size, tags);
43 ASSERT(cls.id() != kIllegalCid);
44 tags = RawObject::ClassIdTag::update(cls.id(), tags);
45 __ movq(FieldAddress(instance_reg, Object::tags_offset()), Immediate(tags));
46 } else {
47 __ jmp(failure);
48 }
49 }
50
51
52 void AssemblerMacros::EnterDartFrame(Assembler* assembler,
53 intptr_t frame_size) {
54 const intptr_t offset = assembler->CodeSize();
55 __ EnterFrame(0);
56 Label dart_entry;
57 __ call(&dart_entry);
58 __ Bind(&dart_entry);
59 // Adjust saved PC for any intrinsic code that could have been generated
60 // before a frame is created.
61 if (offset != 0) {
62 __ addq(Address(RSP, 0), Immediate(-offset));
63 }
64 if (frame_size != 0) {
65 __ subq(RSP, Immediate(frame_size));
66 }
67 }
68
69
70 void AssemblerMacros::EnterStubFrame(Assembler* assembler) {
71 __ EnterFrame(0);
72 __ pushq(Immediate(0)); // Push 0 in the saved PC area for stub frames.
73 }
74
75 #undef __
76
77 } // namespace dart
78
79 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_macros_x64.h ('k') | runtime/vm/assembler_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698