Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / nanojit / Fragmento.cpp
1 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */
2 /* vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5) */
3 /* ***** BEGIN LICENSE BLOCK *****
4  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5  *
6  * The contents of this file are subject to the Mozilla Public License Version
7  * 1.1 (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  * http://www.mozilla.org/MPL/
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is [Open Source Virtual Machine].
17  *
18  * The Initial Developer of the Original Code is
19  * Adobe System Incorporated.
20  * Portions created by the Initial Developer are Copyright (C) 2004-2007
21  * the Initial Developer. All Rights Reserved.
22  *
23  * Contributor(s):
24  *   Adobe AS3 Team
25  *   Mozilla TraceMonkey Team
26  *   Asko Tontti <atontti@cc.hut.fi>
27  *
28  * Alternatively, the contents of this file may be used under the terms of
29  * either the GNU General Public License Version 2 or later (the "GPL"), or
30  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31  * in which case the provisions of the GPL or the LGPL are applicable instead
32  * of those above. If you wish to allow use of your version of this file only
33  * under the terms of either the GPL or the LGPL, and not to allow others to
34  * use your version of this file under the terms of the MPL, indicate your
35  * decision by deleting the provisions above and replace them with the notice
36  * and other provisions required by the GPL or the LGPL. If you do not delete
37  * the provisions above, a recipient may use your version of this file under
38  * the terms of any one of the MPL, the GPL or the LGPL.
39  *
40  * ***** END LICENSE BLOCK ***** */
41
42 #include "nanojit.h"
43
44 namespace nanojit
45 {
46     #ifdef FEATURE_NANOJIT
47
48     using namespace avmplus;
49
50     //
51     // Fragment
52     //
53     Fragment::Fragment(const void* _ip
54                        verbose_only(, uint32_t profFragID))
55         :
56           lirbuf(NULL),
57           lastIns(NULL),
58           ip(_ip),
59           recordAttempts(0),
60           fragEntry(NULL),
61           verbose_only( loopLabel(NULL), )
62           verbose_only( profFragID(profFragID), )
63           verbose_only( profCount(0), )
64           verbose_only( nStaticExits(0), )
65           verbose_only( nCodeBytes(0), )
66           verbose_only( nExitBytes(0), )
67           verbose_only( guardNumberer(1), )
68           verbose_only( guardsForFrag(NULL), )
69           _code(NULL),
70           _hits(0)
71     {
72         // when frag profiling is enabled, profFragID should be >= 1,
73         // else it should be zero.  However, there's no way to assert
74         // that here since there's no way to determine whether frag
75         // profiling is enabled.
76     }
77     #endif /* FEATURE_NANOJIT */
78 }
79
80