| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 int end_pos() { return backing_[kEndPosOffset]; } | 64 int end_pos() { return backing_[kEndPosOffset]; } |
| 65 void set_end_pos(int value) { backing_[kEndPosOffset] = value; } | 65 void set_end_pos(int value) { backing_[kEndPosOffset] = value; } |
| 66 | 66 |
| 67 int literal_count() { return backing_[kLiteralCountOffset]; } | 67 int literal_count() { return backing_[kLiteralCountOffset]; } |
| 68 void set_literal_count(int value) { backing_[kLiteralCountOffset] = value; } | 68 void set_literal_count(int value) { backing_[kLiteralCountOffset] = value; } |
| 69 | 69 |
| 70 int property_count() { return backing_[kPropertyCountOffset]; } | 70 int property_count() { return backing_[kPropertyCountOffset]; } |
| 71 void set_property_count(int value) { backing_[kPropertyCountOffset] = value; } | 71 void set_property_count(int value) { backing_[kPropertyCountOffset] = value; } |
| 72 | 72 |
| 73 bool contains_array_literal() { | |
| 74 return backing_[kContainsArrayLiteralOffset] != 0; | |
| 75 } | |
| 76 void set_contains_array_literal(bool value) { | |
| 77 backing_[kContainsArrayLiteralOffset] = value ? 1 : 0; | |
| 78 } | |
| 79 | |
| 80 bool is_valid() { return backing_.length() > 0; } | 73 bool is_valid() { return backing_.length() > 0; } |
| 81 | 74 |
| 82 static const int kSize = 5; | 75 static const int kSize = 4; |
| 83 | 76 |
| 84 private: | 77 private: |
| 85 Vector<unsigned> backing_; | 78 Vector<unsigned> backing_; |
| 86 static const int kStartPosOffset = 0; | 79 static const int kStartPosOffset = 0; |
| 87 static const int kEndPosOffset = 1; | 80 static const int kEndPosOffset = 1; |
| 88 static const int kLiteralCountOffset = 2; | 81 static const int kLiteralCountOffset = 2; |
| 89 static const int kPropertyCountOffset = 3; | 82 static const int kPropertyCountOffset = 3; |
| 90 static const int kContainsArrayLiteralOffset = 4; | |
| 91 }; | 83 }; |
| 92 | 84 |
| 93 | 85 |
| 94 class ScriptDataImpl : public ScriptData { | 86 class ScriptDataImpl : public ScriptData { |
| 95 public: | 87 public: |
| 96 explicit ScriptDataImpl(Vector<unsigned> store) | 88 explicit ScriptDataImpl(Vector<unsigned> store) |
| 97 : store_(store), | 89 : store_(store), |
| 98 last_entry_(0) { } | 90 last_entry_(0) { } |
| 99 virtual ~ScriptDataImpl(); | 91 virtual ~ScriptDataImpl(); |
| 100 virtual int Length(); | 92 virtual int Length(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 static const int kTypeSlot = 0; | 185 static const int kTypeSlot = 0; |
| 194 static const int kElementsSlot = 1; | 186 static const int kElementsSlot = 1; |
| 195 | 187 |
| 196 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 188 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 197 }; | 189 }; |
| 198 | 190 |
| 199 | 191 |
| 200 } } // namespace v8::internal | 192 } } // namespace v8::internal |
| 201 | 193 |
| 202 #endif // V8_PARSER_H_ | 194 #endif // V8_PARSER_H_ |
| OLD | NEW |