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 #ifndef V8_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
7 | 7 |
8 #include "include/v8-debug.h" | 8 #include "include/v8-debug.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 public: | 1433 public: |
1434 explicit CodeTracer(int isolate_id) | 1434 explicit CodeTracer(int isolate_id) |
1435 : file_(NULL), | 1435 : file_(NULL), |
1436 scope_depth_(0) { | 1436 scope_depth_(0) { |
1437 if (!ShouldRedirect()) { | 1437 if (!ShouldRedirect()) { |
1438 file_ = stdout; | 1438 file_ = stdout; |
1439 return; | 1439 return; |
1440 } | 1440 } |
1441 | 1441 |
1442 if (FLAG_redirect_code_traces_to == NULL) { | 1442 if (FLAG_redirect_code_traces_to == NULL) { |
1443 OS::SNPrintF(filename_, | 1443 SNPrintF(filename_, |
1444 "code-%d-%d.asm", | 1444 "code-%d-%d.asm", |
1445 OS::GetCurrentProcessId(), | 1445 OS::GetCurrentProcessId(), |
1446 isolate_id); | 1446 isolate_id); |
1447 } else { | 1447 } else { |
1448 OS::StrNCpy(filename_, FLAG_redirect_code_traces_to, filename_.length()); | 1448 StrNCpy(filename_, FLAG_redirect_code_traces_to, filename_.length()); |
1449 } | 1449 } |
1450 | 1450 |
1451 WriteChars(filename_.start(), "", 0, false); | 1451 WriteChars(filename_.start(), "", 0, false); |
1452 } | 1452 } |
1453 | 1453 |
1454 class Scope { | 1454 class Scope { |
1455 public: | 1455 public: |
1456 explicit Scope(CodeTracer* tracer) : tracer_(tracer) { tracer->OpenFile(); } | 1456 explicit Scope(CodeTracer* tracer) : tracer_(tracer) { tracer->OpenFile(); } |
1457 ~Scope() { tracer_->CloseFile(); } | 1457 ~Scope() { tracer_->CloseFile(); } |
1458 | 1458 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 } | 1493 } |
1494 | 1494 |
1495 EmbeddedVector<char, 128> filename_; | 1495 EmbeddedVector<char, 128> filename_; |
1496 FILE* file_; | 1496 FILE* file_; |
1497 int scope_depth_; | 1497 int scope_depth_; |
1498 }; | 1498 }; |
1499 | 1499 |
1500 } } // namespace v8::internal | 1500 } } // namespace v8::internal |
1501 | 1501 |
1502 #endif // V8_ISOLATE_H_ | 1502 #endif // V8_ISOLATE_H_ |
OLD | NEW |