OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
7 | 7 |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/base/compiler-specific.h" | 9 #include "src/base/compiler-specific.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 // Inserts a entry into an allocated constant pool entry. | 341 // Inserts a entry into an allocated constant pool entry. |
342 void InsertConstantPoolEntryAt(size_t entry, Handle<Object> object); | 342 void InsertConstantPoolEntryAt(size_t entry, Handle<Object> object); |
343 | 343 |
344 void InitializeReturnPosition(FunctionLiteral* literal); | 344 void InitializeReturnPosition(FunctionLiteral* literal); |
345 | 345 |
346 void SetStatementPosition(Statement* stmt) { | 346 void SetStatementPosition(Statement* stmt) { |
347 if (stmt->position() == kNoSourcePosition) return; | 347 if (stmt->position() == kNoSourcePosition) return; |
348 latest_source_info_.MakeStatementPosition(stmt->position()); | 348 latest_source_info_.MakeStatementPosition(stmt->position()); |
349 } | 349 } |
350 | 350 |
351 void SetExpressionPosition(Expression* expr) { | 351 inline void SetExpressionPosition(Expression* expr) { |
352 if (expr->position() == kNoSourcePosition) return; | 352 SetExpressionPosition(expr->position()); |
| 353 } |
| 354 |
| 355 void SetExpressionPosition(int position) { |
| 356 if (position == kNoSourcePosition) return; |
353 if (!latest_source_info_.is_statement()) { | 357 if (!latest_source_info_.is_statement()) { |
354 // Ensure the current expression position is overwritten with the | 358 // Ensure the current expression position is overwritten with the |
355 // latest value. | 359 // latest value. |
356 latest_source_info_.MakeExpressionPosition(expr->position()); | 360 latest_source_info_.MakeExpressionPosition(position); |
357 } | 361 } |
358 } | 362 } |
359 | 363 |
360 void SetExpressionAsStatementPosition(Expression* expr) { | 364 void SetExpressionAsStatementPosition(Expression* expr) { |
361 if (expr->position() == kNoSourcePosition) return; | 365 if (expr->position() == kNoSourcePosition) return; |
362 latest_source_info_.MakeStatementPosition(expr->position()); | 366 latest_source_info_.MakeStatementPosition(expr->position()); |
363 } | 367 } |
364 | 368 |
365 bool RequiresImplicitReturn() const { return !return_seen_in_block_; } | 369 bool RequiresImplicitReturn() const { return !return_seen_in_block_; } |
366 | 370 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 static int const kNoFeedbackSlot = 0; | 453 static int const kNoFeedbackSlot = 0; |
450 | 454 |
451 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); | 455 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); |
452 }; | 456 }; |
453 | 457 |
454 } // namespace interpreter | 458 } // namespace interpreter |
455 } // namespace internal | 459 } // namespace internal |
456 } // namespace v8 | 460 } // namespace v8 |
457 | 461 |
458 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 462 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |