OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 Vector<const char*> args_; | 65 Vector<const char*> args_; |
66 }; | 66 }; |
67 | 67 |
68 | 68 |
69 class FunctionEntry BASE_EMBEDDED { | 69 class FunctionEntry BASE_EMBEDDED { |
70 public: | 70 public: |
71 explicit FunctionEntry(Vector<unsigned> backing) : backing_(backing) { } | 71 explicit FunctionEntry(Vector<unsigned> backing) : backing_(backing) { } |
72 FunctionEntry() : backing_(Vector<unsigned>::empty()) { } | 72 FunctionEntry() : backing_(Vector<unsigned>::empty()) { } |
73 | 73 |
74 int start_pos() { return backing_[kStartPosOffset]; } | 74 int start_pos() { return backing_[kStartPosOffset]; } |
75 void set_start_pos(int value) { backing_[kStartPosOffset] = value; } | |
76 | |
77 int end_pos() { return backing_[kEndPosOffset]; } | 75 int end_pos() { return backing_[kEndPosOffset]; } |
78 void set_end_pos(int value) { backing_[kEndPosOffset] = value; } | |
79 | |
80 int literal_count() { return backing_[kLiteralCountOffset]; } | 76 int literal_count() { return backing_[kLiteralCountOffset]; } |
81 void set_literal_count(int value) { backing_[kLiteralCountOffset] = value; } | |
82 | |
83 int property_count() { return backing_[kPropertyCountOffset]; } | 77 int property_count() { return backing_[kPropertyCountOffset]; } |
84 void set_property_count(int value) { | 78 bool strict_mode() { return backing_[kStrictModeOffset] != 0; } |
85 backing_[kPropertyCountOffset] = value; | |
86 } | |
87 | 79 |
88 bool is_valid() { return backing_.length() > 0; } | 80 bool is_valid() { return backing_.length() > 0; } |
89 | 81 |
90 static const int kSize = 4; | 82 static const int kSize = 5; |
91 | 83 |
92 private: | 84 private: |
93 Vector<unsigned> backing_; | 85 Vector<unsigned> backing_; |
94 static const int kStartPosOffset = 0; | 86 static const int kStartPosOffset = 0; |
95 static const int kEndPosOffset = 1; | 87 static const int kEndPosOffset = 1; |
96 static const int kLiteralCountOffset = 2; | 88 static const int kLiteralCountOffset = 2; |
97 static const int kPropertyCountOffset = 3; | 89 static const int kPropertyCountOffset = 3; |
| 90 static const int kStrictModeOffset = 4; |
98 }; | 91 }; |
99 | 92 |
100 | 93 |
101 class ScriptDataImpl : public ScriptData { | 94 class ScriptDataImpl : public ScriptData { |
102 public: | 95 public: |
103 explicit ScriptDataImpl(Vector<unsigned> store) | 96 explicit ScriptDataImpl(Vector<unsigned> store) |
104 : store_(store), | 97 : store_(store), |
105 owns_store_(true) { } | 98 owns_store_(true) { } |
106 | 99 |
107 // Create an empty ScriptDataImpl that is guaranteed to not satisfy | 100 // Create an empty ScriptDataImpl that is guaranteed to not satisfy |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 private: | 746 private: |
754 static const int kTypeSlot = 0; | 747 static const int kTypeSlot = 0; |
755 static const int kElementsSlot = 1; | 748 static const int kElementsSlot = 1; |
756 | 749 |
757 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 750 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
758 }; | 751 }; |
759 | 752 |
760 } } // namespace v8::internal | 753 } } // namespace v8::internal |
761 | 754 |
762 #endif // V8_PARSER_H_ | 755 #endif // V8_PARSER_H_ |
OLD | NEW |