blob: d261f57da72b68a862094cd85eb92c014f3dbc0f [file] [log] [blame]
ager@chromium.org9258b6b2008-09-11 09:11:10 +00001// Copyright 2006-2008 the V8 project authors. All rights reserved.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +00002// Redistribution and use in source and binary forms, with or without
3// modification, are permitted provided that the following conditions are
4// met:
5//
6// * Redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer.
8// * Redistributions in binary form must reproduce the above
9// copyright notice, this list of conditions and the following
10// disclaimer in the documentation and/or other materials provided
11// with the distribution.
12// * Neither the name of Google Inc. nor the names of its
13// contributors may be used to endorse or promote products derived
14// from this software without specific prior written permission.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28#ifndef V8_MACRO_ASSEMBLER_H_
29#define V8_MACRO_ASSEMBLER_H_
30
ager@chromium.orga1645e22009-09-09 19:27:10 +000031
32// Helper types to make boolean flag easier to read at call-site.
33enum InvokeFlag {
34 CALL_FUNCTION,
35 JUMP_FUNCTION
36};
37
38
39enum CodeLocation {
40 IN_JAVASCRIPT,
41 IN_JS_ENTRY,
42 IN_C_ENTRY
43};
44
45
46enum HandlerType {
47 TRY_CATCH_HANDLER,
48 TRY_FINALLY_HANDLER,
49 JS_ENTRY_HANDLER
50};
51
52
ager@chromium.org5c838252010-02-19 08:53:10 +000053// Invalid depth in prototype chain.
54const int kInvalidProtoDepth = -1;
ager@chromium.orga1645e22009-09-09 19:27:10 +000055
ager@chromium.org9085a012009-05-11 19:22:57 +000056#if V8_TARGET_ARCH_IA32
57#include "assembler.h"
58#include "ia32/assembler-ia32.h"
59#include "ia32/assembler-ia32-inl.h"
60#include "code.h" // must be after assembler_*.h
61#include "ia32/macro-assembler-ia32.h"
62#elif V8_TARGET_ARCH_X64
63#include "assembler.h"
64#include "x64/assembler-x64.h"
65#include "x64/assembler-x64-inl.h"
66#include "code.h" // must be after assembler_*.h
67#include "x64/macro-assembler-x64.h"
68#elif V8_TARGET_ARCH_ARM
ager@chromium.org3a37e9b2009-04-27 09:26:21 +000069#include "arm/constants-arm.h"
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +000070#include "assembler.h"
ager@chromium.org3a37e9b2009-04-27 09:26:21 +000071#include "arm/assembler-arm.h"
72#include "arm/assembler-arm-inl.h"
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +000073#include "code.h" // must be after assembler_*.h
ager@chromium.org3a37e9b2009-04-27 09:26:21 +000074#include "arm/macro-assembler-arm.h"
ager@chromium.org5c838252010-02-19 08:53:10 +000075#elif V8_TARGET_ARCH_MIPS
76#include "mips/constants-mips.h"
77#include "assembler.h"
78#include "mips/assembler-mips.h"
79#include "mips/assembler-mips-inl.h"
80#include "code.h" // must be after assembler_*.h
81#include "mips/macro-assembler-mips.h"
kasperl@chromium.org2abc4502009-07-02 07:00:29 +000082#else
83#error Unsupported target architecture.
ager@chromium.org5ec48922009-05-05 07:25:34 +000084#endif
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +000085
ricow@chromium.orgd236f4d2010-09-01 06:52:08 +000086namespace v8 {
87namespace internal {
88
89// Support for "structured" code comments.
90#ifdef DEBUG
91
92class Comment {
93 public:
94 Comment(MacroAssembler* masm, const char* msg);
95 ~Comment();
96
97 private:
98 MacroAssembler* masm_;
99 const char* msg_;
100};
101
102#else
103
104class Comment {
105 public:
106 Comment(MacroAssembler*, const char*) {}
107};
108
109#endif // DEBUG
110
111} } // namespace v8::internal
112
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000113#endif // V8_MACRO_ASSEMBLER_H_