OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 pc = rhs.pc; | 474 pc = rhs.pc; |
475 sp = rhs.sp; | 475 sp = rhs.sp; |
476 fp = rhs.fp; | 476 fp = rhs.fp; |
477 state = rhs.state; | 477 state = rhs.state; |
478 DeleteArray(stack.Detach()); | 478 DeleteArray(stack.Detach()); |
479 stack = rhs.stack; | 479 stack = rhs.stack; |
480 return *this; | 480 return *this; |
481 } | 481 } |
482 | 482 |
483 inline void InitStack(int depth) { | 483 inline void InitStack(int depth) { |
484 stack = SmartPointer<Address>(NewArray<Address>(depth + 1)); | 484 if (depth) { |
485 // null-terminate | 485 stack = SmartPointer<Address>(NewArray<Address>(depth + 1)); |
486 stack[depth] = 0; | 486 // null-terminate |
| 487 stack[depth] = 0; |
| 488 } |
487 } | 489 } |
488 }; | 490 }; |
489 | 491 |
490 class Sampler { | 492 class Sampler { |
491 public: | 493 public: |
492 // Initialize sampler. | 494 // Initialize sampler. |
493 explicit Sampler(int interval, bool profiling); | 495 explicit Sampler(int interval, bool profiling); |
494 virtual ~Sampler(); | 496 virtual ~Sampler(); |
495 | 497 |
496 // This method is called for each sampling period with the current | 498 // This method is called for each sampling period with the current |
(...skipping 17 matching lines...) Expand all Loading... |
514 bool active_; | 516 bool active_; |
515 PlatformData* data_; // Platform specific data. | 517 PlatformData* data_; // Platform specific data. |
516 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 518 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
517 }; | 519 }; |
518 | 520 |
519 #endif // ENABLE_LOGGING_AND_PROFILING | 521 #endif // ENABLE_LOGGING_AND_PROFILING |
520 | 522 |
521 } } // namespace v8::internal | 523 } } // namespace v8::internal |
522 | 524 |
523 #endif // V8_PLATFORM_H_ | 525 #endif // V8_PLATFORM_H_ |
OLD | NEW |