OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 436 |
437 // Support for tracking C++ memory allocation. Insert TRACK_MEMORY("Fisk") | 437 // Support for tracking C++ memory allocation. Insert TRACK_MEMORY("Fisk") |
438 // inside a C++ class and new and delete will be overloaded so logging is | 438 // inside a C++ class and new and delete will be overloaded so logging is |
439 // performed. | 439 // performed. |
440 // This file (globals.h) is included before log.h, so we use direct calls to | 440 // This file (globals.h) is included before log.h, so we use direct calls to |
441 // the Logger rather than the LOG macro. | 441 // the Logger rather than the LOG macro. |
442 #ifdef DEBUG | 442 #ifdef DEBUG |
443 #define TRACK_MEMORY(name) \ | 443 #define TRACK_MEMORY(name) \ |
444 void* operator new(size_t size) { \ | 444 void* operator new(size_t size) { \ |
445 void* result = ::operator new(size); \ | 445 void* result = ::operator new(size); \ |
446 Logger::NewEvent(name, result, size); \ | 446 Logger::NewEventStatic(name, result, size); \ |
447 return result; \ | 447 return result; \ |
448 } \ | 448 } \ |
449 void operator delete(void* object) { \ | 449 void operator delete(void* object) { \ |
450 Logger::DeleteEvent(name, object); \ | 450 Logger::DeleteEventStatic(name, object); \ |
451 ::operator delete(object); \ | 451 ::operator delete(object); \ |
452 } | 452 } |
453 #else | 453 #else |
454 #define TRACK_MEMORY(name) | 454 #define TRACK_MEMORY(name) |
455 #endif | 455 #endif |
456 | 456 |
457 | 457 |
458 // Feature flags bit positions. They are mostly based on the CPUID spec. | 458 // Feature flags bit positions. They are mostly based on the CPUID spec. |
459 // (We assign CPUID itself to one of the currently reserved bits -- | 459 // (We assign CPUID itself to one of the currently reserved bits -- |
460 // feel free to change this if needed.) | 460 // feel free to change this if needed.) |
(...skipping 14 matching lines...) Expand all Loading... |
475 kStrictMode, | 475 kStrictMode, |
476 // This value is never used, but is needed to prevent GCC 4.5 from failing | 476 // This value is never used, but is needed to prevent GCC 4.5 from failing |
477 // to compile when we assert that a flag is either kNonStrictMode or | 477 // to compile when we assert that a flag is either kNonStrictMode or |
478 // kStrictMode. | 478 // kStrictMode. |
479 kInvalidStrictFlag | 479 kInvalidStrictFlag |
480 }; | 480 }; |
481 | 481 |
482 } } // namespace v8::internal | 482 } } // namespace v8::internal |
483 | 483 |
484 #endif // V8_V8GLOBALS_H_ | 484 #endif // V8_V8GLOBALS_H_ |
OLD | NEW |