OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 17 matching lines...) Expand all Loading... |
28 #ifndef V8_COMPILER_H_ | 28 #ifndef V8_COMPILER_H_ |
29 #define V8_COMPILER_H_ | 29 #define V8_COMPILER_H_ |
30 | 30 |
31 #include "allocation.h" | 31 #include "allocation.h" |
32 #include "ast.h" | 32 #include "ast.h" |
33 #include "zone.h" | 33 #include "zone.h" |
34 | 34 |
35 namespace v8 { | 35 namespace v8 { |
36 namespace internal { | 36 namespace internal { |
37 | 37 |
38 static const int kPrologueOffsetNotSet = -1; | |
39 | |
40 class ScriptDataImpl; | 38 class ScriptDataImpl; |
41 class HydrogenCodeStub; | 39 class HydrogenCodeStub; |
42 | 40 |
43 // ParseRestriction is used to restrict the set of valid statements in a | 41 // ParseRestriction is used to restrict the set of valid statements in a |
44 // unit of compilation. Restriction violations cause a syntax error. | 42 // unit of compilation. Restriction violations cause a syntax error. |
45 enum ParseRestriction { | 43 enum ParseRestriction { |
46 NO_PARSE_RESTRICTION, // All expressions are allowed. | 44 NO_PARSE_RESTRICTION, // All expressions are allowed. |
47 ONLY_SINGLE_FUNCTION_LITERAL // Only a single FunctionLiteral expression. | 45 ONLY_SINGLE_FUNCTION_LITERAL // Only a single FunctionLiteral expression. |
48 }; | 46 }; |
49 | 47 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 SaveHandle(&closure_); | 260 SaveHandle(&closure_); |
263 SaveHandle(&shared_info_); | 261 SaveHandle(&shared_info_); |
264 SaveHandle(&context_); | 262 SaveHandle(&context_); |
265 SaveHandle(&script_); | 263 SaveHandle(&script_); |
266 } | 264 } |
267 | 265 |
268 BailoutReason bailout_reason() const { return bailout_reason_; } | 266 BailoutReason bailout_reason() const { return bailout_reason_; } |
269 void set_bailout_reason(BailoutReason reason) { bailout_reason_ = reason; } | 267 void set_bailout_reason(BailoutReason reason) { bailout_reason_ = reason; } |
270 | 268 |
271 int prologue_offset() const { | 269 int prologue_offset() const { |
272 ASSERT_NE(kPrologueOffsetNotSet, prologue_offset_); | 270 ASSERT_NE(Code::kPrologueOffsetNotSet, prologue_offset_); |
273 return prologue_offset_; | 271 return prologue_offset_; |
274 } | 272 } |
275 | 273 |
276 void set_prologue_offset(int prologue_offset) { | 274 void set_prologue_offset(int prologue_offset) { |
277 ASSERT_EQ(kPrologueOffsetNotSet, prologue_offset_); | 275 ASSERT_EQ(Code::kPrologueOffsetNotSet, prologue_offset_); |
278 prologue_offset_ = prologue_offset; | 276 prologue_offset_ = prologue_offset; |
279 } | 277 } |
280 | 278 |
281 // Adds offset range [from, to) where fp register does not point | 279 // Adds offset range [from, to) where fp register does not point |
282 // to the current frame base. Used in CPU profiler to detect stack | 280 // to the current frame base. Used in CPU profiler to detect stack |
283 // samples where top frame is not set up. | 281 // samples where top frame is not set up. |
284 inline void AddNoFrameRange(int from, int to) { | 282 inline void AddNoFrameRange(int from, int to) { |
285 if (no_frame_ranges_) no_frame_ranges_->Add(OffsetRange(from, to)); | 283 if (no_frame_ranges_) no_frame_ranges_->Add(OffsetRange(from, to)); |
286 } | 284 } |
287 | 285 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 unsigned info_zone_start_allocation_size_; | 664 unsigned info_zone_start_allocation_size_; |
667 ElapsedTimer timer_; | 665 ElapsedTimer timer_; |
668 | 666 |
669 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 667 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
670 }; | 668 }; |
671 | 669 |
672 | 670 |
673 } } // namespace v8::internal | 671 } } // namespace v8::internal |
674 | 672 |
675 #endif // V8_COMPILER_H_ | 673 #endif // V8_COMPILER_H_ |
OLD | NEW |