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 #include "src/interpreter/bytecode-array-builder.h" | 5 #include "src/interpreter/bytecode-array-builder.h" |
6 #include "src/compiler.h" | 6 #include "src/compiler.h" |
7 #include "src/interpreter/interpreter-intrinsics.h" | 7 #include "src/interpreter/interpreter-intrinsics.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 return *this; | 1068 return *this; |
1069 } | 1069 } |
1070 | 1070 |
1071 size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) { | 1071 size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) { |
1072 return constant_array_builder()->Insert(object); | 1072 return constant_array_builder()->Insert(object); |
1073 } | 1073 } |
1074 | 1074 |
1075 void BytecodeArrayBuilder::SetReturnPosition() { | 1075 void BytecodeArrayBuilder::SetReturnPosition() { |
1076 if (return_position_ == RelocInfo::kNoPosition) return; | 1076 if (return_position_ == RelocInfo::kNoPosition) return; |
1077 if (exit_seen_in_block_) return; | 1077 if (exit_seen_in_block_) return; |
1078 source_position_table_builder_.AddStatementPosition( | 1078 source_position_table_builder_.AddStatementPosition(bytecodes_.size(), |
1079 bytecodes_.size(), return_position_, | 1079 return_position_); |
1080 SourcePositionTableBuilder::OVERWRITE_DUPLICATE); | |
1081 } | 1080 } |
1082 | 1081 |
1083 void BytecodeArrayBuilder::SetStatementPosition(Statement* stmt) { | 1082 void BytecodeArrayBuilder::SetStatementPosition(Statement* stmt) { |
1084 if (stmt->position() == RelocInfo::kNoPosition) return; | 1083 if (stmt->position() == RelocInfo::kNoPosition) return; |
1085 if (exit_seen_in_block_) return; | 1084 if (exit_seen_in_block_) return; |
1086 source_position_table_builder_.AddStatementPosition(bytecodes_.size(), | 1085 source_position_table_builder_.AddStatementPosition(bytecodes_.size(), |
1087 stmt->position()); | 1086 stmt->position()); |
1088 } | 1087 } |
1089 | 1088 |
1090 void BytecodeArrayBuilder::SetExpressionPosition(Expression* expr) { | 1089 void BytecodeArrayBuilder::SetExpressionPosition(Expression* expr) { |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1485 } | 1484 } |
1486 | 1485 |
1487 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { | 1486 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { |
1488 DCHECK_LE(value, kMaxUInt32); | 1487 DCHECK_LE(value, kMaxUInt32); |
1489 return static_cast<uint32_t>(value); | 1488 return static_cast<uint32_t>(value); |
1490 } | 1489 } |
1491 | 1490 |
1492 } // namespace interpreter | 1491 } // namespace interpreter |
1493 } // namespace internal | 1492 } // namespace internal |
1494 } // namespace v8 | 1493 } // namespace v8 |
OLD | NEW |