Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: src/base/logging.cc

Issue 358363002: Move platform abstraction to base library (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/base/logging.cc
diff --git a/src/checks.cc b/src/base/logging.cc
similarity index 60%
copy from src/checks.cc
copy to src/base/logging.cc
index 23c9305f8cda3259049d32e6b5fb595167b1046e..4f62ac48ddee08649dbf074f193d845af73d3c40 100644
--- a/src/checks.cc
+++ b/src/base/logging.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "src/checks.h"
+#include "src/base/logging.h"
#if V8_LIBC_GLIBC || V8_OS_BSD
# include <cxxabi.h>
@@ -11,14 +11,12 @@
# include <backtrace.h>
#endif // V8_LIBC_GLIBC || V8_OS_BSD
#include <stdio.h>
+#include <stdlib.h>
-#include "src/platform.h"
-#include "src/v8.h"
+#include "src/base/platform/platform.h"
namespace v8 {
-namespace internal {
-
-intptr_t HeapObjectTagMask() { return kHeapObjectTagMask; }
+namespace base {
// Attempts to dump a backtrace (if supported).
void DumpBacktrace() {
@@ -70,50 +68,21 @@ void DumpBacktrace() {
#endif // V8_LIBC_GLIBC || V8_OS_BSD
}
-} } // namespace v8::internal
+} } // namespace v8::base
// Contains protection against recursive calls (faults while handling faults).
extern "C" void V8_Fatal(const char* file, int line, const char* format, ...) {
fflush(stdout);
fflush(stderr);
- i::OS::PrintError("\n\n#\n# Fatal error in %s, line %d\n# ", file, line);
+ v8::base::OS::PrintError("\n\n#\n# Fatal error in %s, line %d\n# ", file,
+ line);
va_list arguments;
va_start(arguments, format);
- i::OS::VPrintError(format, arguments);
+ v8::base::OS::VPrintError(format, arguments);
va_end(arguments);
- i::OS::PrintError("\n#\n");
- v8::internal::DumpBacktrace();
+ v8::base::OS::PrintError("\n#\n");
+ v8::base::DumpBacktrace();
fflush(stderr);
- i::OS::Abort();
-}
-
-
-void CheckEqualsHelper(const char* file,
- int line,
- const char* expected_source,
- v8::Handle<v8::Value> expected,
- const char* value_source,
- v8::Handle<v8::Value> value) {
- if (!expected->Equals(value)) {
- v8::String::Utf8Value value_str(value);
- v8::String::Utf8Value expected_str(expected);
- V8_Fatal(file, line,
- "CHECK_EQ(%s, %s) failed\n# Expected: %s\n# Found: %s",
- expected_source, value_source, *expected_str, *value_str);
- }
-}
-
-
-void CheckNonEqualsHelper(const char* file,
- int line,
- const char* unexpected_source,
- v8::Handle<v8::Value> unexpected,
- const char* value_source,
- v8::Handle<v8::Value> value) {
- if (unexpected->Equals(value)) {
- v8::String::Utf8Value value_str(value);
- V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %s",
- unexpected_source, value_source, *value_str);
- }
+ v8::base::OS::Abort();
}

Powered by Google App Engine
This is Rietveld 408576698