| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/regexp_assembler_ir.h" | 5 #include "vm/regexp_assembler_ir.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 desc.name, | 581 desc.name, |
| 582 desc.token_kind, | 582 desc.token_kind, |
| 583 arguments, | 583 arguments, |
| 584 Object::null_array(), | 584 Object::null_array(), |
| 585 desc.checked_argument_count, | 585 desc.checked_argument_count, |
| 586 ic_data_array_); | 586 ic_data_array_); |
| 587 } | 587 } |
| 588 | 588 |
| 589 | 589 |
| 590 LoadLocalInstr* IRRegExpMacroAssembler::LoadLocal(LocalVariable* local) const { | 590 LoadLocalInstr* IRRegExpMacroAssembler::LoadLocal(LocalVariable* local) const { |
| 591 return new(Z) LoadLocalInstr(*local); | 591 return new(Z) LoadLocalInstr(*local, Scanner::kNoSourcePos); |
| 592 } | 592 } |
| 593 | 593 |
| 594 | 594 |
| 595 void IRRegExpMacroAssembler::StoreLocal(LocalVariable* local, | 595 void IRRegExpMacroAssembler::StoreLocal(LocalVariable* local, |
| 596 Value* value) { | 596 Value* value) { |
| 597 Do(new(Z) StoreLocalInstr(*local, value)); | 597 Do(new(Z) StoreLocalInstr(*local, value, Scanner::kNoSourcePos)); |
| 598 } | 598 } |
| 599 | 599 |
| 600 | 600 |
| 601 void IRRegExpMacroAssembler::set_current_instruction(Instruction* instruction) { | 601 void IRRegExpMacroAssembler::set_current_instruction(Instruction* instruction) { |
| 602 current_instruction_ = instruction; | 602 current_instruction_ = instruction; |
| 603 } | 603 } |
| 604 | 604 |
| 605 | 605 |
| 606 Value* IRRegExpMacroAssembler::Bind(Definition* definition) { | 606 Value* IRRegExpMacroAssembler::Bind(Definition* definition) { |
| 607 AppendInstruction(definition); | 607 AppendInstruction(definition); |
| 608 definition->set_temp_index(temp_id_.Alloc()); | 608 definition->set_temp_index(temp_id_.Alloc()); |
| 609 | 609 |
| 610 return new(Z) Value(definition); | 610 return new(Z) Value(definition); |
| 611 } | 611 } |
| 612 | 612 |
| 613 | 613 |
| 614 void IRRegExpMacroAssembler::Do(Definition* definition) { | 614 void IRRegExpMacroAssembler::Do(Definition* definition) { |
| 615 AppendInstruction(definition); | 615 AppendInstruction(definition); |
| 616 } | 616 } |
| 617 | 617 |
| 618 | 618 |
| 619 Value* IRRegExpMacroAssembler::BindLoadLocal(const LocalVariable& local) { | 619 Value* IRRegExpMacroAssembler::BindLoadLocal(const LocalVariable& local) { |
| 620 if (local.IsConst()) { | 620 if (local.IsConst()) { |
| 621 return Bind(new(Z) ConstantInstr(*local.ConstValue())); | 621 return Bind(new(Z) ConstantInstr(*local.ConstValue())); |
| 622 } | 622 } |
| 623 ASSERT(!local.is_captured()); | 623 ASSERT(!local.is_captured()); |
| 624 return Bind(new(Z) LoadLocalInstr(local)); | 624 return Bind(new(Z) LoadLocalInstr(local, Scanner::kNoSourcePos)); |
| 625 } | 625 } |
| 626 | 626 |
| 627 | 627 |
| 628 // In some cases, the V8 irregexp engine generates unreachable code by emitting | 628 // In some cases, the V8 irregexp engine generates unreachable code by emitting |
| 629 // a jmp not followed by a bind. We cannot do the same, since it is impossible | 629 // a jmp not followed by a bind. We cannot do the same, since it is impossible |
| 630 // to append to a block following a jmp. In such cases, assume that we are doing | 630 // to append to a block following a jmp. In such cases, assume that we are doing |
| 631 // the correct thing, but output a warning when tracing. | 631 // the correct thing, but output a warning when tracing. |
| 632 #define HANDLE_DEAD_CODE_EMISSION() \ | 632 #define HANDLE_DEAD_CODE_EMISSION() \ |
| 633 if (current_instruction_ == NULL) { \ | 633 if (current_instruction_ == NULL) { \ |
| 634 if (FLAG_trace_irregexp) { \ | 634 if (FLAG_trace_irregexp) { \ |
| (...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1924 index_val, | 1924 index_val, |
| 1925 characters, | 1925 characters, |
| 1926 specialization_cid_, | 1926 specialization_cid_, |
| 1927 Scanner::kNoSourcePos)); | 1927 Scanner::kNoSourcePos)); |
| 1928 } | 1928 } |
| 1929 | 1929 |
| 1930 | 1930 |
| 1931 #undef __ | 1931 #undef __ |
| 1932 | 1932 |
| 1933 } // namespace dart | 1933 } // namespace dart |
| OLD | NEW |