OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/ast.h" | 7 #include "src/ast.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/compilation-cache.h" | 9 #include "src/compilation-cache.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 macro_assembler_->Bind(&fail); | 1097 macro_assembler_->Bind(&fail); |
1098 macro_assembler_->Fail(); | 1098 macro_assembler_->Fail(); |
1099 while (!work_list.is_empty()) { | 1099 while (!work_list.is_empty()) { |
1100 work_list.RemoveLast()->Emit(this, &new_trace); | 1100 work_list.RemoveLast()->Emit(this, &new_trace); |
1101 } | 1101 } |
1102 if (reg_exp_too_big_) return IrregexpRegExpTooBig(zone_->isolate()); | 1102 if (reg_exp_too_big_) return IrregexpRegExpTooBig(zone_->isolate()); |
1103 | 1103 |
1104 Handle<HeapObject> code = macro_assembler_->GetCode(pattern); | 1104 Handle<HeapObject> code = macro_assembler_->GetCode(pattern); |
1105 heap->IncreaseTotalRegexpCodeGenerated(code->Size()); | 1105 heap->IncreaseTotalRegexpCodeGenerated(code->Size()); |
1106 work_list_ = NULL; | 1106 work_list_ = NULL; |
1107 #ifdef DEBUG | 1107 #ifdef ENABLE_DISASSEMBLER |
1108 if (FLAG_print_code) { | 1108 if (FLAG_print_code) { |
1109 CodeTracer::Scope trace_scope(heap->isolate()->GetCodeTracer()); | 1109 CodeTracer::Scope trace_scope(heap->isolate()->GetCodeTracer()); |
1110 OFStream os(trace_scope.file()); | 1110 OFStream os(trace_scope.file()); |
1111 Handle<Code>::cast(code)->Disassemble(pattern->ToCString().get(), os); | 1111 Handle<Code>::cast(code)->Disassemble(pattern->ToCString().get(), os); |
1112 } | 1112 } |
| 1113 #endif |
| 1114 #ifdef DEBUG |
1113 if (FLAG_trace_regexp_assembler) { | 1115 if (FLAG_trace_regexp_assembler) { |
1114 delete macro_assembler_; | 1116 delete macro_assembler_; |
1115 } | 1117 } |
1116 #endif | 1118 #endif |
1117 return RegExpEngine::CompilationResult(*code, next_register_); | 1119 return RegExpEngine::CompilationResult(*code, next_register_); |
1118 } | 1120 } |
1119 | 1121 |
1120 | 1122 |
1121 bool Trace::DeferredAction::Mentions(int that) { | 1123 bool Trace::DeferredAction::Mentions(int that) { |
1122 if (action_type() == ActionNode::CLEAR_CAPTURES) { | 1124 if (action_type() == ActionNode::CLEAR_CAPTURES) { |
(...skipping 5014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6137 } | 6139 } |
6138 | 6140 |
6139 return compiler.Assemble(¯o_assembler, | 6141 return compiler.Assemble(¯o_assembler, |
6140 node, | 6142 node, |
6141 data->capture_count, | 6143 data->capture_count, |
6142 pattern); | 6144 pattern); |
6143 } | 6145 } |
6144 | 6146 |
6145 | 6147 |
6146 }} // namespace v8::internal | 6148 }} // namespace v8::internal |
OLD | NEW |