blob: 91c68d688601c515967280261fbc4934d7e3d7fc [file] [log] [blame]
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001// Copyright 2012 the V8 project authors. All rights reserved.
Ben Murdochb8a8cc12014-11-26 15:28:44 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Steve Blocka7e24c12009-10-30 11:49:00 +00004
5#ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_
6#define V8_IA32_MACRO_ASSEMBLER_IA32_H_
7
Ben Murdochb8a8cc12014-11-26 15:28:44 +00008#include "src/assembler.h"
9#include "src/bailout-reason.h"
10#include "src/frames.h"
11#include "src/globals.h"
Steve Blocka7e24c12009-10-30 11:49:00 +000012
13namespace v8 {
14namespace internal {
15
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000016// Give alias names to registers for calling conventions.
17const Register kReturnRegister0 = {Register::kCode_eax};
18const Register kReturnRegister1 = {Register::kCode_edx};
Ben Murdoch097c5b22016-05-18 11:27:45 +010019const Register kReturnRegister2 = {Register::kCode_edi};
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000020const Register kJSFunctionRegister = {Register::kCode_edi};
21const Register kContextRegister = {Register::kCode_esi};
Ben Murdochc5610432016-08-08 18:44:38 +010022const Register kAllocateSizeRegister = {Register::kCode_edx};
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000023const Register kInterpreterAccumulatorRegister = {Register::kCode_eax};
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000024const Register kInterpreterBytecodeOffsetRegister = {Register::kCode_ecx};
25const Register kInterpreterBytecodeArrayRegister = {Register::kCode_edi};
Ben Murdochc5610432016-08-08 18:44:38 +010026const Register kInterpreterDispatchTableRegister = {Register::kCode_esi};
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000027const Register kJavaScriptCallArgCountRegister = {Register::kCode_eax};
28const Register kJavaScriptCallNewTargetRegister = {Register::kCode_edx};
29const Register kRuntimeCallFunctionRegister = {Register::kCode_ebx};
30const Register kRuntimeCallArgCountRegister = {Register::kCode_eax};
31
Leon Clarkee46be812010-01-19 14:06:41 +000032// Convenience for platform-independent signatures. We do not normally
33// distinguish memory operands from other operands on ia32.
34typedef Operand MemOperand;
35
Ben Murdoch3ef787d2012-04-12 10:51:47 +010036enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
37enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
Ben Murdochb8a8cc12014-11-26 15:28:44 +000038enum PointersToHereCheck {
39 kPointersToHereMaybeInteresting,
40 kPointersToHereAreAlwaysInteresting
41};
Ben Murdoch3ef787d2012-04-12 10:51:47 +010042
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000043enum RegisterValueType { REGISTER_VALUE_IS_SMI, REGISTER_VALUE_IS_INT32 };
Ben Murdochb8a8cc12014-11-26 15:28:44 +000044
Ben Murdochda12d292016-06-02 14:46:10 +010045enum class ReturnAddressState { kOnStack, kNotOnStack };
46
Ben Murdochb8a8cc12014-11-26 15:28:44 +000047#ifdef DEBUG
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000048bool AreAliased(Register reg1, Register reg2, Register reg3 = no_reg,
49 Register reg4 = no_reg, Register reg5 = no_reg,
50 Register reg6 = no_reg, Register reg7 = no_reg,
Ben Murdochb8a8cc12014-11-26 15:28:44 +000051 Register reg8 = no_reg);
52#endif
Ben Murdoch3ef787d2012-04-12 10:51:47 +010053
Steve Blocka7e24c12009-10-30 11:49:00 +000054// MacroAssembler implements a collection of frequently used macros.
55class MacroAssembler: public Assembler {
56 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000057 MacroAssembler(Isolate* isolate, void* buffer, int size,
58 CodeObjectRequired create_code_object);
Steve Blocka7e24c12009-10-30 11:49:00 +000059
Ben Murdochb8a8cc12014-11-26 15:28:44 +000060 void Load(Register dst, const Operand& src, Representation r);
61 void Store(Register src, const Operand& dst, Representation r);
62
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000063 // Load a register with a long value as efficiently as possible.
64 void Set(Register dst, int32_t x) {
65 if (x == 0) {
66 xor_(dst, dst);
67 } else {
68 mov(dst, Immediate(x));
69 }
70 }
71 void Set(const Operand& dst, int32_t x) { mov(dst, Immediate(x)); }
72
Ben Murdochb8a8cc12014-11-26 15:28:44 +000073 // Operations on roots in the root-array.
74 void LoadRoot(Register destination, Heap::RootListIndex index);
75 void StoreRoot(Register source, Register scratch, Heap::RootListIndex index);
76 void CompareRoot(Register with, Register scratch, Heap::RootListIndex index);
77 // These methods can only be used with constant roots (i.e. non-writable
78 // and not in new space).
79 void CompareRoot(Register with, Heap::RootListIndex index);
80 void CompareRoot(const Operand& with, Heap::RootListIndex index);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000081 void PushRoot(Heap::RootListIndex index);
82
83 // Compare the object in a register to a value and jump if they are equal.
84 void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal,
85 Label::Distance if_equal_distance = Label::kFar) {
86 CompareRoot(with, index);
87 j(equal, if_equal, if_equal_distance);
88 }
89 void JumpIfRoot(const Operand& with, Heap::RootListIndex index,
90 Label* if_equal,
91 Label::Distance if_equal_distance = Label::kFar) {
92 CompareRoot(with, index);
93 j(equal, if_equal, if_equal_distance);
94 }
95
96 // Compare the object in a register to a value and jump if they are not equal.
97 void JumpIfNotRoot(Register with, Heap::RootListIndex index,
98 Label* if_not_equal,
99 Label::Distance if_not_equal_distance = Label::kFar) {
100 CompareRoot(with, index);
101 j(not_equal, if_not_equal, if_not_equal_distance);
102 }
103 void JumpIfNotRoot(const Operand& with, Heap::RootListIndex index,
104 Label* if_not_equal,
105 Label::Distance if_not_equal_distance = Label::kFar) {
106 CompareRoot(with, index);
107 j(not_equal, if_not_equal, if_not_equal_distance);
108 }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000109
Ben Murdoch097c5b22016-05-18 11:27:45 +0100110 // These functions do not arrange the registers in any particular order so
111 // they are not useful for calls that can cause a GC. The caller can
112 // exclude up to 3 registers that do not need to be saved and restored.
113 void PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
114 Register exclusion2 = no_reg,
115 Register exclusion3 = no_reg);
116 void PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
117 Register exclusion2 = no_reg,
118 Register exclusion3 = no_reg);
119
Steve Blocka7e24c12009-10-30 11:49:00 +0000120 // ---------------------------------------------------------------------------
121 // GC Support
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000122 enum RememberedSetFinalAction { kReturnAtEnd, kFallThroughAtEnd };
Steve Blocka7e24c12009-10-30 11:49:00 +0000123
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100124 // Record in the remembered set the fact that we have a pointer to new space
125 // at the address pointed to by the addr register. Only works if addr is not
126 // in new space.
127 void RememberedSetHelper(Register object, // Used for debug code.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000128 Register addr, Register scratch,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100129 SaveFPRegsMode save_fp,
130 RememberedSetFinalAction and_then);
Steve Block6ded16b2010-05-10 14:33:55 +0100131
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000132 void CheckPageFlag(Register object, Register scratch, int mask, Condition cc,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100133 Label* condition_met,
134 Label::Distance condition_met_distance = Label::kFar);
Steve Block6ded16b2010-05-10 14:33:55 +0100135
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000136 void CheckPageFlagForMap(
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000137 Handle<Map> map, int mask, Condition cc, Label* condition_met,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000138 Label::Distance condition_met_distance = Label::kFar);
139
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100140 // Check if object is in new space. Jumps if the object is not in new space.
141 // The register scratch can be object itself, but scratch will be clobbered.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000142 void JumpIfNotInNewSpace(Register object, Register scratch, Label* branch,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100143 Label::Distance distance = Label::kFar) {
144 InNewSpace(object, scratch, zero, branch, distance);
145 }
146
147 // Check if object is in new space. Jumps if the object is in new space.
148 // The register scratch can be object itself, but it will be clobbered.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000149 void JumpIfInNewSpace(Register object, Register scratch, Label* branch,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100150 Label::Distance distance = Label::kFar) {
151 InNewSpace(object, scratch, not_zero, branch, distance);
152 }
153
154 // Check if an object has a given incremental marking color. Also uses ecx!
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000155 void HasColor(Register object, Register scratch0, Register scratch1,
156 Label* has_color, Label::Distance has_color_distance,
157 int first_bit, int second_bit);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100158
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000159 void JumpIfBlack(Register object, Register scratch0, Register scratch1,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100160 Label* on_black,
161 Label::Distance on_black_distance = Label::kFar);
162
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000163 // Checks the color of an object. If the object is white we jump to the
164 // incremental marker.
165 void JumpIfWhite(Register value, Register scratch1, Register scratch2,
166 Label* value_is_white, Label::Distance distance);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100167
168 // Notify the garbage collector that we wrote a pointer into an object.
169 // |object| is the object being stored into, |value| is the object being
170 // stored. value and scratch registers are clobbered by the operation.
171 // The offset is the offset from the start of the object, not the offset from
172 // the tagged HeapObject pointer. For use with FieldOperand(reg, off).
173 void RecordWriteField(
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000174 Register object, int offset, Register value, Register scratch,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100175 SaveFPRegsMode save_fp,
176 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000177 SmiCheck smi_check = INLINE_SMI_CHECK,
178 PointersToHereCheck pointers_to_here_check_for_value =
179 kPointersToHereMaybeInteresting);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100180
181 // As above, but the offset has the tag presubtracted. For use with
182 // Operand(reg, off).
183 void RecordWriteContextSlot(
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000184 Register context, int offset, Register value, Register scratch,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100185 SaveFPRegsMode save_fp,
186 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000187 SmiCheck smi_check = INLINE_SMI_CHECK,
188 PointersToHereCheck pointers_to_here_check_for_value =
189 kPointersToHereMaybeInteresting) {
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000190 RecordWriteField(context, offset + kHeapObjectTag, value, scratch, save_fp,
191 remembered_set_action, smi_check,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000192 pointers_to_here_check_for_value);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100193 }
194
195 // Notify the garbage collector that we wrote a pointer into a fixed array.
196 // |array| is the array being stored into, |value| is the
197 // object being stored. |index| is the array index represented as a
198 // Smi. All registers are clobbered by the operation RecordWriteArray
Steve Block8defd9f2010-07-08 12:39:36 +0100199 // filters out smis so it does not update the write barrier if the
200 // value is a smi.
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100201 void RecordWriteArray(
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000202 Register array, Register value, Register index, SaveFPRegsMode save_fp,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100203 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000204 SmiCheck smi_check = INLINE_SMI_CHECK,
205 PointersToHereCheck pointers_to_here_check_for_value =
206 kPointersToHereMaybeInteresting);
Steve Blocka7e24c12009-10-30 11:49:00 +0000207
Steve Block8defd9f2010-07-08 12:39:36 +0100208 // For page containing |object| mark region covering |address|
209 // dirty. |object| is the object being stored into, |value| is the
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100210 // object being stored. The address and value registers are clobbered by the
Steve Block8defd9f2010-07-08 12:39:36 +0100211 // operation. RecordWrite filters out smis so it does not update the
212 // write barrier if the value is a smi.
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100213 void RecordWrite(
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000214 Register object, Register address, Register value, SaveFPRegsMode save_fp,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100215 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000216 SmiCheck smi_check = INLINE_SMI_CHECK,
217 PointersToHereCheck pointers_to_here_check_for_value =
218 kPointersToHereMaybeInteresting);
Steve Block8defd9f2010-07-08 12:39:36 +0100219
Ben Murdoch097c5b22016-05-18 11:27:45 +0100220 // Notify the garbage collector that we wrote a code entry into a
221 // JSFunction. Only scratch is clobbered by the operation.
222 void RecordWriteCodeEntryField(Register js_function, Register code_entry,
223 Register scratch);
224
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000225 // For page containing |object| mark the region covering the object's map
226 // dirty. |object| is the object being stored into, |map| is the Map object
227 // that was stored.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000228 void RecordWriteForMap(Register object, Handle<Map> map, Register scratch1,
229 Register scratch2, SaveFPRegsMode save_fp);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000230
Steve Blocka7e24c12009-10-30 11:49:00 +0000231 // ---------------------------------------------------------------------------
232 // Debugger Support
233
Andrei Popescu402d9372010-02-26 13:31:12 +0000234 void DebugBreak();
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000235
236 // Generates function and stub prologue code.
Ben Murdochda12d292016-06-02 14:46:10 +0100237 void StubPrologue(StackFrame::Type type);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000238 void Prologue(bool code_pre_aging);
Steve Blocka7e24c12009-10-30 11:49:00 +0000239
Ben Murdochb0fe1622011-05-05 13:52:32 +0100240 // Enter specific kind of exit frame. Expects the number of
241 // arguments in register eax and sets up the number of arguments in
242 // register edi and the pointer to the first argument in register
243 // esi.
Ben Murdoch097c5b22016-05-18 11:27:45 +0100244 void EnterExitFrame(int argc, bool save_doubles);
Steve Blockd0582a62009-12-15 09:54:21 +0000245
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -0800246 void EnterApiExitFrame(int argc);
Steve Blocka7e24c12009-10-30 11:49:00 +0000247
248 // Leave the current exit frame. Expects the return value in
249 // register eax:edx (untouched) and the pointer to the first
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000250 // argument in register esi (if pop_arguments == true).
251 void LeaveExitFrame(bool save_doubles, bool pop_arguments = true);
Steve Blocka7e24c12009-10-30 11:49:00 +0000252
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -0800253 // Leave the current exit frame. Expects the return value in
254 // register eax (untouched).
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000255 void LeaveApiExitFrame(bool restore_context);
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -0800256
Steve Blockd0582a62009-12-15 09:54:21 +0000257 // Find the function context up the context chain.
258 void LoadContext(Register dst, int context_chain_length);
Steve Blocka7e24c12009-10-30 11:49:00 +0000259
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000260 // Load the global proxy from the current context.
261 void LoadGlobalProxy(Register dst);
262
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100263 // Conditionally load the cached Array transitioned map of type
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000264 // transitioned_kind from the native context if the map in register
265 // map_in_out is the cached Array map in the native context of
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100266 // expected_kind.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000267 void LoadTransitionedArrayMapConditional(ElementsKind expected_kind,
268 ElementsKind transitioned_kind,
269 Register map_in_out,
270 Register scratch,
271 Label* no_map_match);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100272
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100273 // Load the global function with the given index.
274 void LoadGlobalFunction(int index, Register function);
275
276 // Load the initial map from the global function. The registers
277 // function and map can be the same.
278 void LoadGlobalFunctionInitialMap(Register function, Register map);
279
Ben Murdochb0fe1622011-05-05 13:52:32 +0100280 // Push and pop the registers that can hold pointers.
281 void PushSafepointRegisters() { pushad(); }
282 void PopSafepointRegisters() { popad(); }
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100283 // Store the value in register/immediate src in the safepoint
284 // register stack slot for register dst.
285 void StoreToSafepointRegisterSlot(Register dst, Register src);
286 void StoreToSafepointRegisterSlot(Register dst, Immediate src);
287 void LoadFromSafepointRegisterSlot(Register dst, Register src);
Ben Murdochb0fe1622011-05-05 13:52:32 +0100288
Ben Murdoch097c5b22016-05-18 11:27:45 +0100289 // Nop, because ia32 does not have a root register.
290 void InitializeRootRegister() {}
291
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100292 void LoadHeapObject(Register result, Handle<HeapObject> object);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000293 void CmpHeapObject(Register reg, Handle<HeapObject> object);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100294 void PushHeapObject(Handle<HeapObject> object);
295
296 void LoadObject(Register result, Handle<Object> object) {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000297 AllowDeferredHandleDereference heap_object_check;
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100298 if (object->IsHeapObject()) {
299 LoadHeapObject(result, Handle<HeapObject>::cast(object));
300 } else {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000301 Move(result, Immediate(object));
302 }
303 }
304
305 void CmpObject(Register reg, Handle<Object> object) {
306 AllowDeferredHandleDereference heap_object_check;
307 if (object->IsHeapObject()) {
308 CmpHeapObject(reg, Handle<HeapObject>::cast(object));
309 } else {
310 cmp(reg, Immediate(object));
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100311 }
312 }
313
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400314 // Compare the given value and the value of weak cell.
315 void CmpWeakValue(Register value, Handle<WeakCell> cell, Register scratch);
316
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000317 void GetWeakValue(Register value, Handle<WeakCell> cell);
318
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400319 // Load the value of the weak cell in the value register. Branch to the given
320 // miss label if the weak cell was cleared.
321 void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss);
322
Steve Blocka7e24c12009-10-30 11:49:00 +0000323 // ---------------------------------------------------------------------------
324 // JavaScript invokes
325
Ben Murdochda12d292016-06-02 14:46:10 +0100326 // Removes current frame and its arguments from the stack preserving
327 // the arguments and a return address pushed to the stack for the next call.
328 // |ra_state| defines whether return address is already pushed to stack or
329 // not. Both |callee_args_count| and |caller_args_count_reg| do not include
330 // receiver. |callee_args_count| is not modified, |caller_args_count_reg|
331 // is trashed. |number_of_temp_values_after_return_address| specifies
332 // the number of words pushed to the stack after the return address. This is
333 // to allow "allocation" of scratch registers that this function requires
334 // by saving their values on the stack.
335 void PrepareForTailCall(const ParameterCount& callee_args_count,
336 Register caller_args_count_reg, Register scratch0,
337 Register scratch1, ReturnAddressState ra_state,
338 int number_of_temp_values_after_return_address);
339
Steve Blocka7e24c12009-10-30 11:49:00 +0000340 // Invoke the JavaScript function code by either calling or jumping.
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100341
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000342 void InvokeFunctionCode(Register function, Register new_target,
343 const ParameterCount& expected,
344 const ParameterCount& actual, InvokeFlag flag,
345 const CallWrapper& call_wrapper);
346
347 void FloodFunctionIfStepping(Register fun, Register new_target,
348 const ParameterCount& expected,
349 const ParameterCount& actual);
Steve Blocka7e24c12009-10-30 11:49:00 +0000350
351 // Invoke the JavaScript function in the given register. Changes the
352 // current context to the context in the function before invoking.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000353 void InvokeFunction(Register function, Register new_target,
354 const ParameterCount& actual, InvokeFlag flag,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000355 const CallWrapper& call_wrapper);
Steve Blocka7e24c12009-10-30 11:49:00 +0000356
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000357 void InvokeFunction(Register function, const ParameterCount& expected,
358 const ParameterCount& actual, InvokeFlag flag,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000359 const CallWrapper& call_wrapper);
360
361 void InvokeFunction(Handle<JSFunction> function,
362 const ParameterCount& expected,
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000363 const ParameterCount& actual, InvokeFlag flag,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000364 const CallWrapper& call_wrapper);
Andrei Popescu402d9372010-02-26 13:31:12 +0000365
Steve Blocka7e24c12009-10-30 11:49:00 +0000366 // Expression support
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000367 // cvtsi2sd instruction only writes to the low 64-bit of dst register, which
368 // hinders register renaming and makes dependence chains longer. So we use
369 // xorps to clear the dst register before cvtsi2sd to solve this issue.
370 void Cvtsi2sd(XMMRegister dst, Register src) { Cvtsi2sd(dst, Operand(src)); }
371 void Cvtsi2sd(XMMRegister dst, const Operand& src);
Steve Blocka7e24c12009-10-30 11:49:00 +0000372
Ben Murdoch097c5b22016-05-18 11:27:45 +0100373 void Cvtui2ss(XMMRegister dst, Register src, Register tmp);
374
Ben Murdochda12d292016-06-02 14:46:10 +0100375 void ShlPair(Register high, Register low, uint8_t imm8);
376 void ShlPair_cl(Register high, Register low);
377 void ShrPair(Register high, Register low, uint8_t imm8);
378 void ShrPair_cl(Register high, Register src);
379 void SarPair(Register high, Register low, uint8_t imm8);
380 void SarPair_cl(Register high, Register low);
381
Steve Block053d10c2011-06-13 19:13:29 +0100382 // Support for constant splitting.
383 bool IsUnsafeImmediate(const Immediate& x);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000384 void SafeMove(Register dst, const Immediate& x);
Steve Block053d10c2011-06-13 19:13:29 +0100385 void SafePush(const Immediate& x);
386
Steve Blocka7e24c12009-10-30 11:49:00 +0000387 // Compare object type for heap object.
388 // Incoming register is heap_object and outgoing register is map.
389 void CmpObjectType(Register heap_object, InstanceType type, Register map);
390
391 // Compare instance type for map.
392 void CmpInstanceType(Register map, InstanceType type);
393
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000394 // Check if a map for a JSObject indicates that the object has fast elements.
395 // Jump to the specified label if it does not.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000396 void CheckFastElements(Register map, Label* fail,
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000397 Label::Distance distance = Label::kFar);
398
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100399 // Check if a map for a JSObject indicates that the object can have both smi
400 // and HeapObject elements. Jump to the specified label if it does not.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000401 void CheckFastObjectElements(Register map, Label* fail,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100402 Label::Distance distance = Label::kFar);
403
404 // Check if a map for a JSObject indicates that the object has fast smi only
405 // elements. Jump to the specified label if it does not.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000406 void CheckFastSmiElements(Register map, Label* fail,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000407 Label::Distance distance = Label::kFar);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100408
409 // Check to see if maybe_number can be stored as a double in
410 // FastDoubleElements. If it can, store it at the index specified by key in
411 // the FastDoubleElements array elements, otherwise jump to fail.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000412 void StoreNumberToDoubleElements(Register maybe_number, Register elements,
413 Register key, Register scratch1,
414 XMMRegister scratch2, Label* fail,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000415 int offset = 0);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100416
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000417 // Compare an object's map with the specified map.
418 void CompareMap(Register obj, Handle<Map> map);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100419
Ben Murdoch257744e2011-11-30 15:57:28 +0000420 // Check if the map of an object is equal to a specified map and branch to
421 // label if not. Skip the smi check if not required (object is known to be a
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100422 // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match
423 // against maps that are ElementsKind transition maps of the specified map.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000424 void CheckMap(Register obj, Handle<Map> map, Label* fail,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000425 SmiCheckType smi_check_type);
Ben Murdoch257744e2011-11-30 15:57:28 +0000426
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400427 // Check if the map of an object is equal to a specified weak map and branch
428 // to a specified target if equal. Skip the smi check if not required
429 // (object is known to be a heap object)
430 void DispatchWeakMap(Register obj, Register scratch1, Register scratch2,
431 Handle<WeakCell> cell, Handle<Code> success,
432 SmiCheckType smi_check_type);
Andrei Popescu31002712010-02-23 13:46:05 +0000433
Leon Clarkee46be812010-01-19 14:06:41 +0000434 // Check if the object in register heap_object is a string. Afterwards the
435 // register map contains the object map and the register instance_type
436 // contains the instance_type. The registers map and instance_type can be the
437 // same in which case it contains the instance type afterwards. Either of the
438 // registers map and instance_type can be the same as heap_object.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000439 Condition IsObjectStringType(Register heap_object, Register map,
Leon Clarkee46be812010-01-19 14:06:41 +0000440 Register instance_type);
441
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000442 // Check if the object in register heap_object is a name. Afterwards the
443 // register map contains the object map and the register instance_type
444 // contains the instance_type. The registers map and instance_type can be the
445 // same in which case it contains the instance type afterwards. Either of the
446 // registers map and instance_type can be the same as heap_object.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000447 Condition IsObjectNameType(Register heap_object, Register map,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000448 Register instance_type);
449
Steve Blocka7e24c12009-10-30 11:49:00 +0000450 // FCmp is similar to integer cmp, but requires unsigned
451 // jcc instructions (je, ja, jae, jb, jbe, je, and jz).
452 void FCmp();
453
Ben Murdoch257744e2011-11-30 15:57:28 +0000454 void ClampUint8(Register reg);
455
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000456 void ClampDoubleToUint8(XMMRegister input_reg, XMMRegister scratch_reg,
Ben Murdoch257744e2011-11-30 15:57:28 +0000457 Register result_reg);
458
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000459 void SlowTruncateToI(Register result_reg, Register input_reg,
460 int offset = HeapNumber::kValueOffset - kHeapObjectTag);
461
462 void TruncateHeapNumberToI(Register result_reg, Register input_reg);
463 void TruncateDoubleToI(Register result_reg, XMMRegister input_reg);
464
465 void DoubleToI(Register result_reg, XMMRegister input_reg,
466 XMMRegister scratch, MinusZeroMode minus_zero_mode,
467 Label* lost_precision, Label* is_nan, Label* minus_zero,
468 Label::Distance dst = Label::kFar);
Ben Murdoch257744e2011-11-30 15:57:28 +0000469
Leon Clarkee46be812010-01-19 14:06:41 +0000470 // Smi tagging support.
471 void SmiTag(Register reg) {
Ben Murdoch69a99ed2011-11-30 16:03:39 +0000472 STATIC_ASSERT(kSmiTag == 0);
473 STATIC_ASSERT(kSmiTagSize == 1);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100474 add(reg, reg);
Leon Clarkee46be812010-01-19 14:06:41 +0000475 }
476 void SmiUntag(Register reg) {
477 sar(reg, kSmiTagSize);
478 }
479
Iain Merrick75681382010-08-19 15:07:18 +0100480 // Modifies the register even if it does not contain a Smi!
Iain Merrick75681382010-08-19 15:07:18 +0100481 void SmiUntag(Register reg, Label* is_smi) {
Ben Murdoch69a99ed2011-11-30 16:03:39 +0000482 STATIC_ASSERT(kSmiTagSize == 1);
Iain Merrick75681382010-08-19 15:07:18 +0100483 sar(reg, kSmiTagSize);
Ben Murdoch69a99ed2011-11-30 16:03:39 +0000484 STATIC_ASSERT(kSmiTag == 0);
Iain Merrick75681382010-08-19 15:07:18 +0100485 j(not_carry, is_smi);
486 }
487
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400488 void LoadUint32(XMMRegister dst, Register src) {
489 LoadUint32(dst, Operand(src));
490 }
491 void LoadUint32(XMMRegister dst, const Operand& src);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000492
Steve Block1e0659c2011-05-24 12:43:12 +0100493 // Jump the register contains a smi.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000494 inline void JumpIfSmi(Register value, Label* smi_label,
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000495 Label::Distance distance = Label::kFar) {
Steve Block1e0659c2011-05-24 12:43:12 +0100496 test(value, Immediate(kSmiTagMask));
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000497 j(zero, smi_label, distance);
498 }
499 // Jump if the operand is a smi.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000500 inline void JumpIfSmi(Operand value, Label* smi_label,
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000501 Label::Distance distance = Label::kFar) {
502 test(value, Immediate(kSmiTagMask));
503 j(zero, smi_label, distance);
Steve Block1e0659c2011-05-24 12:43:12 +0100504 }
505 // Jump if register contain a non-smi.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000506 inline void JumpIfNotSmi(Register value, Label* not_smi_label,
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000507 Label::Distance distance = Label::kFar) {
Steve Block1e0659c2011-05-24 12:43:12 +0100508 test(value, Immediate(kSmiTagMask));
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000509 j(not_zero, not_smi_label, distance);
Steve Block1e0659c2011-05-24 12:43:12 +0100510 }
511
Ben Murdochc5610432016-08-08 18:44:38 +0100512 // Jump if the value cannot be represented by a smi.
513 inline void JumpIfNotValidSmiValue(Register value, Register scratch,
514 Label* on_invalid,
515 Label::Distance distance = Label::kFar) {
516 mov(scratch, value);
517 add(scratch, Immediate(0x40000000U));
518 j(sign, on_invalid, distance);
519 }
520
521 // Jump if the unsigned integer value cannot be represented by a smi.
522 inline void JumpIfUIntNotValidSmiValue(
523 Register value, Label* on_invalid,
524 Label::Distance distance = Label::kFar) {
525 cmp(value, Immediate(0x40000000U));
526 j(above_equal, on_invalid, distance);
527 }
528
Ben Murdoch257744e2011-11-30 15:57:28 +0000529 void LoadInstanceDescriptors(Register map, Register descriptors);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000530 void EnumLength(Register dst, Register map);
531 void NumberOfOwnDescriptors(Register dst, Register map);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000532 void LoadAccessor(Register dst, Register holder, int accessor_index,
533 AccessorComponent accessor);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000534
535 template<typename Field>
536 void DecodeField(Register reg) {
537 static const int shift = Field::kShift;
538 static const int mask = Field::kMask >> Field::kShift;
539 if (shift != 0) {
540 sar(reg, shift);
541 }
542 and_(reg, Immediate(mask));
543 }
544
545 template<typename Field>
546 void DecodeFieldToSmi(Register reg) {
547 static const int shift = Field::kShift;
548 static const int mask = (Field::kMask >> Field::kShift) << kSmiTagSize;
549 STATIC_ASSERT((mask & (0x80000000u >> (kSmiTagSize - 1))) == 0);
550 STATIC_ASSERT(kSmiTag == 0);
551 if (shift < kSmiTagSize) {
552 shl(reg, kSmiTagSize - shift);
553 } else if (shift > kSmiTagSize) {
554 sar(reg, shift - kSmiTagSize);
555 }
556 and_(reg, Immediate(mask));
557 }
Iain Merrick75681382010-08-19 15:07:18 +0100558
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100559 void LoadPowerOf2(XMMRegister dst, Register scratch, int power);
560
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000561 // Abort execution if argument is not a number, enabled via --debug-code.
562 void AssertNumber(Register object);
Ben Murdochda12d292016-06-02 14:46:10 +0100563 void AssertNotNumber(Register object);
Steve Block6ded16b2010-05-10 14:33:55 +0100564
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000565 // Abort execution if argument is not a smi, enabled via --debug-code.
566 void AssertSmi(Register object);
Andrei Popescu402d9372010-02-26 13:31:12 +0000567
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000568 // Abort execution if argument is a smi, enabled via --debug-code.
569 void AssertNotSmi(Register object);
Iain Merrick75681382010-08-19 15:07:18 +0100570
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000571 // Abort execution if argument is not a string, enabled via --debug-code.
572 void AssertString(Register object);
573
574 // Abort execution if argument is not a name, enabled via --debug-code.
575 void AssertName(Register object);
576
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000577 // Abort execution if argument is not a JSFunction, enabled via --debug-code.
578 void AssertFunction(Register object);
579
580 // Abort execution if argument is not a JSBoundFunction,
581 // enabled via --debug-code.
582 void AssertBoundFunction(Register object);
583
Ben Murdochc5610432016-08-08 18:44:38 +0100584 // Abort execution if argument is not a JSGeneratorObject,
585 // enabled via --debug-code.
586 void AssertGeneratorObject(Register object);
587
Ben Murdoch097c5b22016-05-18 11:27:45 +0100588 // Abort execution if argument is not a JSReceiver, enabled via --debug-code.
589 void AssertReceiver(Register object);
590
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000591 // Abort execution if argument is not undefined or an AllocationSite, enabled
592 // via --debug-code.
593 void AssertUndefinedOrAllocationSite(Register object);
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100594
Steve Blocka7e24c12009-10-30 11:49:00 +0000595 // ---------------------------------------------------------------------------
596 // Exception handling
597
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000598 // Push a new stack handler and link it into stack handler chain.
599 void PushStackHandler();
Steve Blocka7e24c12009-10-30 11:49:00 +0000600
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000601 // Unlink the stack handler on top of the stack from the stack handler chain.
602 void PopStackHandler();
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100603
Steve Blocka7e24c12009-10-30 11:49:00 +0000604 // ---------------------------------------------------------------------------
605 // Inline caching support
606
Steve Blocka7e24c12009-10-30 11:49:00 +0000607 // Generate code for checking access rights - used for security checks
608 // on access to global objects across environments. The holder register
609 // is left untouched, but the scratch register is clobbered.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000610 void CheckAccessGlobalProxy(Register holder_reg, Register scratch1,
611 Register scratch2, Label* miss);
Steve Blocka7e24c12009-10-30 11:49:00 +0000612
Ben Murdochc7cc0282012-03-05 14:35:55 +0000613 void GetNumberHash(Register r0, Register scratch);
Steve Blocka7e24c12009-10-30 11:49:00 +0000614
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000615 void LoadFromNumberDictionary(Label* miss, Register elements, Register key,
616 Register r0, Register r1, Register r2,
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000617 Register result);
618
Steve Blocka7e24c12009-10-30 11:49:00 +0000619 // ---------------------------------------------------------------------------
620 // Allocation support
621
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000622 // Allocate an object in new space or old space. If the given space
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000623 // is exhausted control continues at the gc_required label. The allocated
624 // object is returned in result and end of the new object is returned in
625 // result_end. The register scratch can be passed as no_reg in which case
626 // an additional object reference will be added to the reloc info. The
627 // returned pointers in result and result_end have not yet been tagged as
628 // heap objects. If result_contains_top_on_entry is true the content of
629 // result is known to be the allocation top on entry (could be result_end
630 // from a previous call). If result_contains_top_on_entry is true scratch
Steve Blocka7e24c12009-10-30 11:49:00 +0000631 // should be no_reg as it is never used.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000632 void Allocate(int object_size, Register result, Register result_end,
633 Register scratch, Label* gc_required, AllocationFlags flags);
Steve Blocka7e24c12009-10-30 11:49:00 +0000634
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000635 void Allocate(int header_size, ScaleFactor element_size,
636 Register element_count, RegisterValueType element_count_type,
637 Register result, Register result_end, Register scratch,
638 Label* gc_required, AllocationFlags flags);
Steve Blocka7e24c12009-10-30 11:49:00 +0000639
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000640 void Allocate(Register object_size, Register result, Register result_end,
641 Register scratch, Label* gc_required, AllocationFlags flags);
Steve Blocka7e24c12009-10-30 11:49:00 +0000642
Ben Murdochc5610432016-08-08 18:44:38 +0100643 // FastAllocate is right now only used for folded allocations. It just
644 // increments the top pointer without checking against limit. This can only
645 // be done if it was proved earlier that the allocation will succeed.
646 void FastAllocate(int object_size, Register result, Register result_end,
647 AllocationFlags flags);
648 void FastAllocate(Register object_size, Register result, Register result_end,
649 AllocationFlags flags);
650
Steve Block3ce2e202009-11-05 08:53:23 +0000651 // Allocate a heap number in new space with undefined value. The
652 // register scratch2 can be passed as no_reg; the others must be
653 // valid registers. Returns tagged pointer in result register, or
654 // jumps to gc_required if new space is full.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000655 void AllocateHeapNumber(Register result, Register scratch1, Register scratch2,
656 Label* gc_required, MutableMode mode = IMMUTABLE);
Steve Block3ce2e202009-11-05 08:53:23 +0000657
Steve Blockd0582a62009-12-15 09:54:21 +0000658 // Allocate a sequential string. All the header fields of the string object
659 // are initialized.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000660 void AllocateTwoByteString(Register result, Register length,
661 Register scratch1, Register scratch2,
662 Register scratch3, Label* gc_required);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000663 void AllocateOneByteString(Register result, Register length,
664 Register scratch1, Register scratch2,
665 Register scratch3, Label* gc_required);
666 void AllocateOneByteString(Register result, int length, Register scratch1,
667 Register scratch2, Label* gc_required);
Steve Blockd0582a62009-12-15 09:54:21 +0000668
669 // Allocate a raw cons string object. Only the map field of the result is
670 // initialized.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000671 void AllocateTwoByteConsString(Register result, Register scratch1,
672 Register scratch2, Label* gc_required);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000673 void AllocateOneByteConsString(Register result, Register scratch1,
674 Register scratch2, Label* gc_required);
Steve Blockd0582a62009-12-15 09:54:21 +0000675
Ben Murdoch69a99ed2011-11-30 16:03:39 +0000676 // Allocate a raw sliced string object. Only the map field of the result is
677 // initialized.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000678 void AllocateTwoByteSlicedString(Register result, Register scratch1,
679 Register scratch2, Label* gc_required);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000680 void AllocateOneByteSlicedString(Register result, Register scratch1,
681 Register scratch2, Label* gc_required);
Ben Murdoch69a99ed2011-11-30 16:03:39 +0000682
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000683 // Allocate and initialize a JSValue wrapper with the specified {constructor}
684 // and {value}.
685 void AllocateJSValue(Register result, Register constructor, Register value,
686 Register scratch, Label* gc_required);
687
Ben Murdochb8e0da22011-05-16 14:20:40 +0100688 // Copy memory, byte-by-byte, from source to destination. Not optimized for
689 // long or aligned copies.
690 // The contents of index and scratch are destroyed.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000691 void CopyBytes(Register source, Register destination, Register length,
Ben Murdochb8e0da22011-05-16 14:20:40 +0100692 Register scratch);
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -0800693
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000694 // Initialize fields with filler values. Fields starting at |current_address|
695 // not including |end_address| are overwritten with the value in |filler|. At
696 // the end the loop, |current_address| takes the value of |end_address|.
697 void InitializeFieldsWithFiller(Register current_address,
698 Register end_address, Register filler);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100699
Steve Blocka7e24c12009-10-30 11:49:00 +0000700 // ---------------------------------------------------------------------------
701 // Support functions.
702
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100703 // Check a boolean-bit of a Smi field.
704 void BooleanBitTest(Register object, int field_offset, int bit_index);
705
Steve Blocka7e24c12009-10-30 11:49:00 +0000706 // Check if result is zero and op is negative.
707 void NegativeZeroTest(Register result, Register op, Label* then_label);
708
Steve Blocka7e24c12009-10-30 11:49:00 +0000709 // Check if result is zero and any of op1 and op2 are negative.
710 // Register scratch is destroyed, and it must be different from op2.
711 void NegativeZeroTest(Register result, Register op1, Register op2,
712 Register scratch, Label* then_label);
713
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000714 // Machine code version of Map::GetConstructor().
715 // |temp| holds |result|'s map when done.
716 void GetMapConstructor(Register result, Register map, Register temp);
717
Steve Blocka7e24c12009-10-30 11:49:00 +0000718 // Try to get function prototype of a function and puts the value in
719 // the result register. Checks that the function really is a
720 // function and jumps to the miss label if the fast checks fail. The
721 // function register will be untouched; the other registers may be
722 // clobbered.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000723 void TryGetFunctionPrototype(Register function, Register result,
724 Register scratch, Label* miss);
Steve Blocka7e24c12009-10-30 11:49:00 +0000725
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100726 // Picks out an array index from the hash field.
727 // Register use:
728 // hash - holds the index's hash. Clobbered.
729 // index - holds the overwritten index on exit.
730 void IndexFromHash(Register hash, Register index);
731
Steve Blocka7e24c12009-10-30 11:49:00 +0000732 // ---------------------------------------------------------------------------
733 // Runtime calls
734
Leon Clarkee46be812010-01-19 14:06:41 +0000735 // Call a code stub. Generate the code if necessary.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000736 void CallStub(CodeStub* stub, TypeFeedbackId ast_id = TypeFeedbackId::None());
Steve Blocka7e24c12009-10-30 11:49:00 +0000737
Leon Clarkee46be812010-01-19 14:06:41 +0000738 // Tail call a code stub (jump). Generate the code if necessary.
Steve Blockd0582a62009-12-15 09:54:21 +0000739 void TailCallStub(CodeStub* stub);
740
Steve Blocka7e24c12009-10-30 11:49:00 +0000741 // Return from a code stub after popping its arguments.
742 void StubReturn(int argc);
743
744 // Call a runtime routine.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000745 void CallRuntime(const Runtime::Function* f, int num_arguments,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000746 SaveFPRegsMode save_doubles = kDontSaveFPRegs);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000747 void CallRuntimeSaveDoubles(Runtime::FunctionId fid) {
748 const Runtime::Function* function = Runtime::FunctionForId(fid);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000749 CallRuntime(function, function->nargs, kSaveFPRegs);
750 }
Steve Blocka7e24c12009-10-30 11:49:00 +0000751
752 // Convenience function: Same as above, but takes the fid instead.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000753 void CallRuntime(Runtime::FunctionId fid,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000754 SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000755 const Runtime::Function* function = Runtime::FunctionForId(fid);
756 CallRuntime(function, function->nargs, save_doubles);
757 }
758
759 // Convenience function: Same as above, but takes the fid instead.
760 void CallRuntime(Runtime::FunctionId fid, int num_arguments,
761 SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
762 CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000763 }
Steve Blocka7e24c12009-10-30 11:49:00 +0000764
Ben Murdochbb769b22010-08-11 14:56:33 +0100765 // Convenience function: call an external reference.
766 void CallExternalReference(ExternalReference ref, int num_arguments);
767
Steve Block6ded16b2010-05-10 14:33:55 +0100768 // Convenience function: tail call a runtime routine (jump).
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000769 void TailCallRuntime(Runtime::FunctionId fid);
Steve Blocka7e24c12009-10-30 11:49:00 +0000770
Steve Block6ded16b2010-05-10 14:33:55 +0100771 // Before calling a C-function from generated code, align arguments on stack.
772 // After aligning the frame, arguments must be stored in esp[0], esp[4],
773 // etc., not pushed. The argument count assumes all arguments are word sized.
774 // Some compilers/platforms require the stack to be aligned when calling
775 // C++ code.
776 // Needs a scratch register to do some arithmetic. This register will be
777 // trashed.
778 void PrepareCallCFunction(int num_arguments, Register scratch);
779
780 // Calls a C function and cleans up the space for arguments allocated
781 // by PrepareCallCFunction. The called function is not allowed to trigger a
782 // garbage collection, since that might move the code and invalidate the
783 // return address (unless this is somehow accounted for by the called
784 // function).
785 void CallCFunction(ExternalReference function, int num_arguments);
786 void CallCFunction(Register function, int num_arguments);
787
Steve Blocka7e24c12009-10-30 11:49:00 +0000788 // Jump to a runtime routine.
Steve Block6ded16b2010-05-10 14:33:55 +0100789 void JumpToExternalReference(const ExternalReference& ext);
Steve Blocka7e24c12009-10-30 11:49:00 +0000790
Steve Blocka7e24c12009-10-30 11:49:00 +0000791 // ---------------------------------------------------------------------------
792 // Utilities
793
794 void Ret();
795
Steve Block1e0659c2011-05-24 12:43:12 +0100796 // Return and drop arguments from stack, where the number of arguments
797 // may be bigger than 2^16 - 1. Requires a scratch register.
798 void Ret(int bytes_dropped, Register scratch);
799
Leon Clarkee46be812010-01-19 14:06:41 +0000800 // Emit code to discard a non-negative number of pointer-sized elements
801 // from the stack, clobbering only the esp register.
802 void Drop(int element_count);
803
804 void Call(Label* target) { call(target); }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000805 void Call(Handle<Code> target, RelocInfo::Mode rmode) { call(target, rmode); }
806 void Jump(Handle<Code> target, RelocInfo::Mode rmode) { jmp(target, rmode); }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000807 void Push(Register src) { push(src); }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000808 void Push(const Operand& src) { push(src); }
809 void Push(Immediate value) { push(value); }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000810 void Pop(Register dst) { pop(dst); }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000811 void Pop(const Operand& dst) { pop(dst); }
812 void PushReturnAddressFrom(Register src) { push(src); }
813 void PopReturnAddressTo(Register dst) { pop(dst); }
814
815 // Non-SSE2 instructions.
816 void Pextrd(Register dst, XMMRegister src, int8_t imm8);
817 void Pinsrd(XMMRegister dst, Register src, int8_t imm8) {
818 Pinsrd(dst, Operand(src), imm8);
819 }
820 void Pinsrd(XMMRegister dst, const Operand& src, int8_t imm8);
821
822 void Lzcnt(Register dst, Register src) { Lzcnt(dst, Operand(src)); }
823 void Lzcnt(Register dst, const Operand& src);
824
825 void Tzcnt(Register dst, Register src) { Tzcnt(dst, Operand(src)); }
826 void Tzcnt(Register dst, const Operand& src);
827
828 void Popcnt(Register dst, Register src) { Popcnt(dst, Operand(src)); }
829 void Popcnt(Register dst, const Operand& src);
Leon Clarkee46be812010-01-19 14:06:41 +0000830
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100831 // Move if the registers are not identical.
832 void Move(Register target, Register source);
833
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000834 // Move a constant into a destination using the most efficient encoding.
835 void Move(Register dst, const Immediate& x);
836 void Move(const Operand& dst, const Immediate& x);
837
838 // Move an immediate into an XMM register.
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400839 void Move(XMMRegister dst, uint32_t src);
840 void Move(XMMRegister dst, uint64_t src);
Ben Murdoch097c5b22016-05-18 11:27:45 +0100841 void Move(XMMRegister dst, float src) { Move(dst, bit_cast<uint32_t>(src)); }
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400842 void Move(XMMRegister dst, double src) { Move(dst, bit_cast<uint64_t>(src)); }
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000843
Ben Murdochda12d292016-06-02 14:46:10 +0100844 void Move(Register dst, Handle<Object> handle) { LoadObject(dst, handle); }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000845 void Move(Register dst, Smi* source) { Move(dst, Immediate(source)); }
846
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000847 // Push a handle value.
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100848 void Push(Handle<Object> handle) { push(Immediate(handle)); }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000849 void Push(Smi* smi) { Push(Immediate(smi)); }
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000850
Ben Murdoch8b112d22011-06-08 16:22:53 +0100851 Handle<Object> CodeObject() {
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000852 DCHECK(!code_object_.is_null());
Ben Murdoch8b112d22011-06-08 16:22:53 +0100853 return code_object_;
854 }
Steve Blocka7e24c12009-10-30 11:49:00 +0000855
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000856 // Emit code for a truncating division by a constant. The dividend register is
857 // unchanged, the result is in edx, and eax gets clobbered.
858 void TruncatingDiv(Register dividend, int32_t divisor);
Steve Blocka7e24c12009-10-30 11:49:00 +0000859
860 // ---------------------------------------------------------------------------
861 // StatsCounter support
862
863 void SetCounter(StatsCounter* counter, int value);
864 void IncrementCounter(StatsCounter* counter, int value);
865 void DecrementCounter(StatsCounter* counter, int value);
Leon Clarked91b9f72010-01-27 17:25:45 +0000866 void IncrementCounter(Condition cc, StatsCounter* counter, int value);
867 void DecrementCounter(Condition cc, StatsCounter* counter, int value);
Steve Blocka7e24c12009-10-30 11:49:00 +0000868
Steve Blocka7e24c12009-10-30 11:49:00 +0000869 // ---------------------------------------------------------------------------
870 // Debugging
871
872 // Calls Abort(msg) if the condition cc is not satisfied.
873 // Use --debug_code to enable.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000874 void Assert(Condition cc, BailoutReason reason);
Steve Blocka7e24c12009-10-30 11:49:00 +0000875
Iain Merrick75681382010-08-19 15:07:18 +0100876 void AssertFastElements(Register elements);
877
Steve Blocka7e24c12009-10-30 11:49:00 +0000878 // Like Assert(), but always enabled.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000879 void Check(Condition cc, BailoutReason reason);
Steve Blocka7e24c12009-10-30 11:49:00 +0000880
881 // Print a message to stdout and abort execution.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000882 void Abort(BailoutReason reason);
Steve Blocka7e24c12009-10-30 11:49:00 +0000883
Steve Block6ded16b2010-05-10 14:33:55 +0100884 // Check that the stack is aligned.
885 void CheckStackAlignment();
886
Steve Blocka7e24c12009-10-30 11:49:00 +0000887 // Verify restrictions about code generated in stubs.
888 void set_generating_stub(bool value) { generating_stub_ = value; }
889 bool generating_stub() { return generating_stub_; }
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100890 void set_has_frame(bool value) { has_frame_ = value; }
891 bool has_frame() { return has_frame_; }
892 inline bool AllowThisStubCall(CodeStub* stub);
Steve Blocka7e24c12009-10-30 11:49:00 +0000893
Leon Clarked91b9f72010-01-27 17:25:45 +0000894 // ---------------------------------------------------------------------------
895 // String utilities.
896
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000897 // Check whether the instance type represents a flat one-byte string. Jump to
898 // the label if not. If the instance type can be scratched specify same
899 // register for both instance type and scratch.
900 void JumpIfInstanceTypeIsNotSequentialOneByte(
901 Register instance_type, Register scratch,
902 Label* on_not_flat_one_byte_string);
903
904 // Checks if both objects are sequential one-byte strings, and jumps to label
Leon Clarked91b9f72010-01-27 17:25:45 +0000905 // if either is not.
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000906 void JumpIfNotBothSequentialOneByteStrings(
907 Register object1, Register object2, Register scratch1, Register scratch2,
908 Label* on_not_flat_one_byte_strings);
909
910 // Checks if the given register or operand is a unique name
911 void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name,
912 Label::Distance distance = Label::kFar) {
913 JumpIfNotUniqueNameInstanceType(Operand(reg), not_unique_name, distance);
914 }
915
916 void JumpIfNotUniqueNameInstanceType(Operand operand, Label* not_unique_name,
917 Label::Distance distance = Label::kFar);
918
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000919 void EmitSeqStringSetCharCheck(Register string, Register index,
920 Register value, uint32_t encoding_mask);
Leon Clarked91b9f72010-01-27 17:25:45 +0000921
Ben Murdoch8b112d22011-06-08 16:22:53 +0100922 static int SafepointRegisterStackIndex(Register reg) {
923 return SafepointRegisterStackIndex(reg.code());
924 }
925
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000926 // Load the type feedback vector from a JavaScript frame.
927 void EmitLoadTypeFeedbackVector(Register vector);
928
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100929 // Activation support.
930 void EnterFrame(StackFrame::Type type);
Emily Bernierd0a1eb72015-03-24 16:35:39 -0400931 void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg);
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100932 void LeaveFrame(StackFrame::Type type);
933
934 // Expects object in eax and returns map with validated enum cache
935 // in eax. Assumes that any other register can be used as a scratch.
936 void CheckEnumCache(Label* call_runtime);
937
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000938 // AllocationMemento support. Arrays may have an associated
939 // AllocationMemento object that can be checked for in order to pretransition
940 // to another type.
941 // On entry, receiver_reg should point to the array object.
942 // scratch_reg gets clobbered.
943 // If allocation info is present, conditional code is set to equal.
944 void TestJSArrayForAllocationMemento(Register receiver_reg,
945 Register scratch_reg,
946 Label* no_memento_found);
947
948 void JumpIfJSArrayHasAllocationMemento(Register receiver_reg,
949 Register scratch_reg,
950 Label* memento_found) {
951 Label no_memento_found;
952 TestJSArrayForAllocationMemento(receiver_reg, scratch_reg,
953 &no_memento_found);
954 j(equal, memento_found);
955 bind(&no_memento_found);
956 }
957
958 // Jumps to found label if a prototype map has dictionary elements.
959 void JumpIfDictionaryInPrototypeChain(Register object, Register scratch0,
960 Register scratch1, Label* found);
961
Steve Blocka7e24c12009-10-30 11:49:00 +0000962 private:
Steve Blocka7e24c12009-10-30 11:49:00 +0000963 bool generating_stub_;
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100964 bool has_frame_;
Andrei Popescu31002712010-02-23 13:46:05 +0000965 // This handle will be patched with the code object on installation.
966 Handle<Object> code_object_;
Steve Blocka7e24c12009-10-30 11:49:00 +0000967
968 // Helper functions for generating invokes.
969 void InvokePrologue(const ParameterCount& expected,
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000970 const ParameterCount& actual, Label* done,
971 bool* definitely_mismatches, InvokeFlag flag,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100972 Label::Distance done_distance,
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000973 const CallWrapper& call_wrapper);
Steve Blocka7e24c12009-10-30 11:49:00 +0000974
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100975 void EnterExitFramePrologue();
Ben Murdochb0fe1622011-05-05 13:52:32 +0100976 void EnterExitFrameEpilogue(int argc, bool save_doubles);
Steve Blockd0582a62009-12-15 09:54:21 +0000977
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000978 void LeaveExitFrameEpilogue(bool restore_context);
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -0800979
Steve Blocka7e24c12009-10-30 11:49:00 +0000980 // Allocation support helpers.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000981 void LoadAllocationTopHelper(Register result, Register scratch,
Steve Blocka7e24c12009-10-30 11:49:00 +0000982 AllocationFlags flags);
Leon Clarkee46be812010-01-19 14:06:41 +0000983
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000984 void UpdateAllocationTopHelper(Register result_end, Register scratch,
Ben Murdochb8a8cc12014-11-26 15:28:44 +0000985 AllocationFlags flags);
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100986
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100987 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000988 void InNewSpace(Register object, Register scratch, Condition cc,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100989 Label* condition_met,
990 Label::Distance condition_met_distance = Label::kFar);
991
992 // Helper for finding the mark bits for an address. Afterwards, the
993 // bitmap register points at the word with the mark bits and the mask
994 // the position of the first bit. Uses ecx as scratch and leaves addr_reg
995 // unchanged.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000996 inline void GetMarkBits(Register addr_reg, Register bitmap_reg,
Ben Murdoch3ef787d2012-04-12 10:51:47 +0100997 Register mask_reg);
998
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100999 // Compute memory operands for safepoint stack slots.
1000 Operand SafepointRegisterSlot(Register reg);
1001 static int SafepointRegisterStackIndex(int reg_code);
1002
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001003 // Needs access to SafepointRegisterStackIndex for compiled frame
Ben Murdoche0cee9b2011-05-25 10:26:03 +01001004 // traversal.
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001005 friend class StandardFrame;
Steve Blocka7e24c12009-10-30 11:49:00 +00001006};
1007
Steve Blocka7e24c12009-10-30 11:49:00 +00001008// The code patcher is used to patch (typically) small parts of code e.g. for
1009// debugging and other types of instrumentation. When using the code patcher
1010// the exact number of bytes specified must be emitted. Is not legal to emit
1011// relocation information. If any of these constraints are violated it causes
1012// an assertion.
1013class CodePatcher {
1014 public:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001015 CodePatcher(Isolate* isolate, byte* address, int size);
1016 ~CodePatcher();
Steve Blocka7e24c12009-10-30 11:49:00 +00001017
1018 // Macro assembler to emit code.
1019 MacroAssembler* masm() { return &masm_; }
1020
1021 private:
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001022 byte* address_; // The address of the code being patched.
1023 int size_; // Number of bytes of the expected patch size.
Steve Blocka7e24c12009-10-30 11:49:00 +00001024 MacroAssembler masm_; // Macro assembler used to generate the code.
1025};
1026
Steve Blocka7e24c12009-10-30 11:49:00 +00001027// -----------------------------------------------------------------------------
1028// Static helper functions.
1029
1030// Generate an Operand for loading a field from an object.
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001031inline Operand FieldOperand(Register object, int offset) {
Steve Blocka7e24c12009-10-30 11:49:00 +00001032 return Operand(object, offset - kHeapObjectTag);
1033}
1034
Steve Blocka7e24c12009-10-30 11:49:00 +00001035// Generate an Operand for loading an indexed field from an object.
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001036inline Operand FieldOperand(Register object, Register index, ScaleFactor scale,
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001037 int offset) {
Steve Blocka7e24c12009-10-30 11:49:00 +00001038 return Operand(object, index, scale, offset - kHeapObjectTag);
1039}
1040
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001041inline Operand FixedArrayElementOperand(Register array, Register index_as_smi,
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001042 int additional_offset = 0) {
1043 int offset = FixedArray::kHeaderSize + additional_offset * kPointerSize;
1044 return FieldOperand(array, index_as_smi, times_half_pointer_size, offset);
1045}
1046
Ben Murdoch3ef787d2012-04-12 10:51:47 +01001047inline Operand ContextOperand(Register context, int index) {
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -08001048 return Operand(context, Context::SlotOffset(index));
1049}
1050
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001051inline Operand ContextOperand(Register context, Register index) {
1052 return Operand(context, index, times_pointer_size, Context::SlotOffset(0));
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -08001053}
1054
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001055inline Operand NativeContextOperand() {
1056 return ContextOperand(esi, Context::NATIVE_CONTEXT_INDEX);
1057}
Steve Blocka7e24c12009-10-30 11:49:00 +00001058
1059#ifdef GENERATED_CODE_COVERAGE
1060extern void LogGeneratedCodeCoverage(const char* file_line);
1061#define CODE_COVERAGE_STRINGIFY(x) #x
1062#define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x)
1063#define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__)
1064#define ACCESS_MASM(masm) { \
1065 byte* ia32_coverage_function = \
1066 reinterpret_cast<byte*>(FUNCTION_ADDR(LogGeneratedCodeCoverage)); \
1067 masm->pushfd(); \
1068 masm->pushad(); \
1069 masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \
1070 masm->call(ia32_coverage_function, RelocInfo::RUNTIME_ENTRY); \
1071 masm->pop(eax); \
1072 masm->popad(); \
1073 masm->popfd(); \
1074 } \
1075 masm->
1076#else
1077#define ACCESS_MASM(masm) masm->
1078#endif
1079
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001080} // namespace internal
1081} // namespace v8
Steve Blocka7e24c12009-10-30 11:49:00 +00001082
1083#endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_