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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 macro_assembler_->PushBacktrack(&fail); | 1084 macro_assembler_->PushBacktrack(&fail); |
1085 Trace new_trace; | 1085 Trace new_trace; |
1086 start->Emit(this, &new_trace); | 1086 start->Emit(this, &new_trace); |
1087 macro_assembler_->Bind(&fail); | 1087 macro_assembler_->Bind(&fail); |
1088 macro_assembler_->Fail(); | 1088 macro_assembler_->Fail(); |
1089 while (!work_list.is_empty()) { | 1089 while (!work_list.is_empty()) { |
1090 RegExpNode* node = work_list.RemoveLast(); | 1090 RegExpNode* node = work_list.RemoveLast(); |
1091 node->set_on_work_list(false); | 1091 node->set_on_work_list(false); |
1092 if (!node->label()->is_bound()) node->Emit(this, &new_trace); | 1092 if (!node->label()->is_bound()) node->Emit(this, &new_trace); |
1093 } | 1093 } |
1094 if (reg_exp_too_big_) return IrregexpRegExpTooBig(isolate_); | 1094 if (reg_exp_too_big_) { |
| 1095 macro_assembler_->AbortedCodeGeneration(); |
| 1096 return IrregexpRegExpTooBig(isolate_); |
| 1097 } |
1095 | 1098 |
1096 Handle<HeapObject> code = macro_assembler_->GetCode(pattern); | 1099 Handle<HeapObject> code = macro_assembler_->GetCode(pattern); |
1097 heap->IncreaseTotalRegexpCodeGenerated(code->Size()); | 1100 heap->IncreaseTotalRegexpCodeGenerated(code->Size()); |
1098 work_list_ = NULL; | 1101 work_list_ = NULL; |
1099 #ifdef ENABLE_DISASSEMBLER | 1102 #ifdef ENABLE_DISASSEMBLER |
1100 if (FLAG_print_code) { | 1103 if (FLAG_print_code) { |
1101 CodeTracer::Scope trace_scope(heap->isolate()->GetCodeTracer()); | 1104 CodeTracer::Scope trace_scope(heap->isolate()->GetCodeTracer()); |
1102 OFStream os(trace_scope.file()); | 1105 OFStream os(trace_scope.file()); |
1103 Handle<Code>::cast(code)->Disassemble(pattern->ToCString().get(), os); | 1106 Handle<Code>::cast(code)->Disassemble(pattern->ToCString().get(), os); |
1104 } | 1107 } |
(...skipping 5047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6152 Heap* heap = pattern->GetHeap(); | 6155 Heap* heap = pattern->GetHeap(); |
6153 bool too_much = pattern->length() > RegExpImpl::kRegExpTooLargeToOptimize; | 6156 bool too_much = pattern->length() > RegExpImpl::kRegExpTooLargeToOptimize; |
6154 if (heap->total_regexp_code_generated() > RegExpImpl::kRegExpCompiledLimit && | 6157 if (heap->total_regexp_code_generated() > RegExpImpl::kRegExpCompiledLimit && |
6155 heap->isolate()->memory_allocator()->SizeExecutable() > | 6158 heap->isolate()->memory_allocator()->SizeExecutable() > |
6156 RegExpImpl::kRegExpExecutableMemoryLimit) { | 6159 RegExpImpl::kRegExpExecutableMemoryLimit) { |
6157 too_much = true; | 6160 too_much = true; |
6158 } | 6161 } |
6159 return too_much; | 6162 return too_much; |
6160 } | 6163 } |
6161 }} // namespace v8::internal | 6164 }} // namespace v8::internal |
OLD | NEW |