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/optimizing-compile-dispatcher.h" | 5 #include "src/optimizing-compile-dispatcher.h" |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
10 #include "src/full-codegen.h" | 10 #include "src/full-codegen.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Remove stack check that guards OSR entry on original code. | 26 // Remove stack check that guards OSR entry on original code. |
27 Handle<Code> code = info->unoptimized_code(); | 27 Handle<Code> code = info->unoptimized_code(); |
28 uint32_t offset = code->TranslateAstIdToPcOffset(info->osr_ast_id()); | 28 uint32_t offset = code->TranslateAstIdToPcOffset(info->osr_ast_id()); |
29 BackEdgeTable::RemoveStackCheck(code, offset); | 29 BackEdgeTable::RemoveStackCheck(code, offset); |
30 } | 30 } |
31 } else { | 31 } else { |
32 Handle<JSFunction> function = info->closure(); | 32 Handle<JSFunction> function = info->closure(); |
33 function->ReplaceCode(function->shared()->code()); | 33 function->ReplaceCode(function->shared()->code()); |
34 } | 34 } |
35 } | 35 } |
| 36 // TODO(bmeurer): Improve resource management for OptimizedCompileJob. |
| 37 job->~OptimizedCompileJob(); |
36 delete info; | 38 delete info; |
37 } | 39 } |
38 | 40 |
39 } // namespace | 41 } // namespace |
40 | 42 |
41 | 43 |
42 class OptimizingCompileDispatcher::CompileTask : public v8::Task { | 44 class OptimizingCompileDispatcher::CompileTask : public v8::Task { |
43 public: | 45 public: |
44 explicit CompileTask(Isolate* isolate) : isolate_(isolate) { | 46 explicit CompileTask(Isolate* isolate) : isolate_(isolate) { |
45 OptimizingCompileDispatcher* dispatcher = | 47 OptimizingCompileDispatcher* dispatcher = |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 info->closure()->PrintName(); | 353 info->closure()->PrintName(); |
352 PrintF(", AST id %d]\n", info->osr_ast_id().ToInt()); | 354 PrintF(", AST id %d]\n", info->osr_ast_id().ToInt()); |
353 } | 355 } |
354 DisposeOptimizedCompileJob(stale, false); | 356 DisposeOptimizedCompileJob(stale, false); |
355 } | 357 } |
356 osr_buffer_[osr_buffer_cursor_] = job; | 358 osr_buffer_[osr_buffer_cursor_] = job; |
357 osr_buffer_cursor_ = (osr_buffer_cursor_ + 1) % osr_buffer_capacity_; | 359 osr_buffer_cursor_ = (osr_buffer_cursor_ + 1) % osr_buffer_capacity_; |
358 } | 360 } |
359 } // namespace internal | 361 } // namespace internal |
360 } // namespace v8 | 362 } // namespace v8 |
OLD | NEW |