From 7e06a74acdae439d022b860d4589225bb67fcfc9 Mon Sep 17 00:00:00 2001 From: "rmcilroy@chromium.org" Date: Wed, 12 Feb 2014 13:27:13 +0000 Subject: [PATCH] Clean up some A64 specific code in common code that was introduced by A64 merge - Remove arch specific check macros - Remove duplicate code in code-stubs.h - Remove flag check in bootstrap.cc which was introduced for A64 bringup - Remove A64 specific test message expectations R=rodolph.perfetta@arm.com, ulan@chromium.org Review URL: https://codereview.chromium.org/134333011 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@19325 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/a64/simulator-a64.cc | 6 +-- src/a64/simulator-a64.h | 4 +- src/bootstrapper.cc | 6 +-- src/checks.h | 78 +++++++------------------------------ src/code-stubs.h | 8 +--- test/message/message.status | 19 --------- 6 files changed, 23 insertions(+), 98 deletions(-) diff --git a/src/a64/simulator-a64.cc b/src/a64/simulator-a64.cc index e0625bc6140d..c89830996456 100644 --- a/src/a64/simulator-a64.cc +++ b/src/a64/simulator-a64.cc @@ -1451,7 +1451,7 @@ uint8_t* Simulator::LoadStoreAddress(unsigned addr_reg, // When the base register is SP the stack pointer is required to be // quadword aligned prior to the address calculation and write-backs. // Misalignment will cause a stack alignment fault. - ALIGNMENT_EXCEPTION(); + FATAL("ALIGNMENT EXCEPTION"); } if ((addrmode == Offset) || (addrmode == PreIndex)) { @@ -1480,7 +1480,7 @@ void Simulator::CheckMemoryAccess(uint8_t* address, uint8_t* stack) { fprintf(stream_, " access was here: 0x%16p\n", address); fprintf(stream_, " stack limit is here: 0x%16p\n", stack_limit_); fprintf(stream_, "\n"); - ABORT(); + FATAL("ACCESS BELOW STACK POINTER"); } } @@ -3209,7 +3209,7 @@ void Simulator::VisitException(Instruction* instr) { bool stack_alignment_exception = ((sp() & 0xf) != 0); if (stack_alignment_exception) { TraceSim(" with unaligned stack 0x%016" PRIx64 ".\n", sp()); - ALIGNMENT_EXCEPTION(); + FATAL("ALIGNMENT EXCEPTION"); } switch (redirection->type()) { diff --git a/src/a64/simulator-a64.h b/src/a64/simulator-a64.h index 6279677ca856..b1f0b826d1df 100644 --- a/src/a64/simulator-a64.h +++ b/src/a64/simulator-a64.h @@ -254,7 +254,9 @@ class Simulator : public DecoderVisitor { } explicit CallArgument(float argument) { - TODO_UNIMPLEMENTED("CallArgument(float) is untested."); + // TODO(all): CallArgument(float) is untested, remove this check once + // tested. + UNIMPLEMENTED(); // Make the D register a NaN to try to trap errors if the callee expects a // double. If it expects a float, the callee should ignore the top word. ASSERT(sizeof(kFP64SignallingNaN) == sizeof(bits_)); diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index 8587b8469173..672e830bb4e0 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -2637,10 +2637,8 @@ Genesis::Genesis(Isolate* isolate, MakeFunctionInstancePrototypeWritable(); - if (!FLAG_disable_native_files) { - if (!ConfigureGlobalObjects(global_template)) return; - isolate->counters()->contexts_created_from_scratch()->Increment(); - } + if (!ConfigureGlobalObjects(global_template)) return; + isolate->counters()->contexts_created_from_scratch()->Increment(); } // Initialize experimental globals and install experimental natives. diff --git a/src/checks.h b/src/checks.h index 3829b4ac39b8..57f18526186c 100644 --- a/src/checks.h +++ b/src/checks.h @@ -34,8 +34,6 @@ extern "C" void V8_Fatal(const char* file, int line, const char* format, ...); -// Define custom A64 preprocessor helpers to facilitate development. -#ifndef V8_TARGET_ARCH_A64 // The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during // development, but they should not be relied on in the final product. @@ -54,69 +52,21 @@ extern "C" void V8_Fatal(const char* file, int line, const char* format, ...); #define UNREACHABLE() ((void) 0) #endif +// Simulator specific helpers. +#if defined(USE_SIMULATOR) && defined(V8_TARGET_ARCH_A64) + // TODO(all): If possible automatically prepend an indicator like + // UNIMPLEMENTED or LOCATION. + #define ASM_UNIMPLEMENTED(message) \ + __ Debug(message, __LINE__, NO_PARAM) + #define ASM_UNIMPLEMENTED_BREAK(message) \ + __ Debug(message, __LINE__, \ + FLAG_ignore_asm_unimplemented_break ? NO_PARAM : BREAK) + #define ASM_LOCATION(message) \ + __ Debug("LOCATION: " message, __LINE__, NO_PARAM) #else - - #ifdef DEBUG - #define FATAL(msg) \ - V8_Fatal(__FILE__, __LINE__, "%s", (msg)) - #define UNREACHABLE() \ - V8_Fatal(__FILE__, __LINE__, "unreachable code") - #else - #define FATAL(msg) \ - V8_Fatal("", 0, "%s", (msg)) - #define UNREACHABLE() ((void) 0) - #endif - - #define ABORT() printf("in %s, line %i, %s", __FILE__, __LINE__, __func__); \ - abort() - - #define ALIGNMENT_EXCEPTION() printf("ALIGNMENT EXCEPTION\t"); ABORT() - - // Helpers for unimplemented sections. - #define UNIMPLEMENTED() \ - do { \ - printf("UNIMPLEMENTED: %s, line %d, %s\n", \ - __FILE__, __LINE__, __func__); \ - V8_Fatal(__FILE__, __LINE__, "unimplemented code"); \ - } while (0) - #define UNIMPLEMENTED_M(message) \ - do { \ - printf("UNIMPLEMENTED: %s, line %d, %s : %s\n", \ - __FILE__, __LINE__, __func__, message); \ - V8_Fatal(__FILE__, __LINE__, "unimplemented code"); \ - } while (0) - // Like UNIMPLEMENTED, but does not abort. - #define TODO_UNIMPLEMENTED(message) \ - do { \ - static const unsigned int kLimit = 1; \ - static unsigned int printed = 0; \ - if (printed < UINT_MAX) { \ - printed++; \ - } \ - if (printed <= kLimit) { \ - printf("UNIMPLEMENTED: %s, line %d, %s: %s\n", \ - __FILE__, __LINE__, __func__, message); \ - } \ - } while (0) - - // Simulator specific helpers. - #ifdef USE_SIMULATOR - // Helpers for unimplemented sections. - // TODO(all): If possible automatically prepend an indicator like - // UNIMPLEMENTED or LOCATION. - #define ASM_UNIMPLEMENTED(message) \ - __ Debug(message, __LINE__, NO_PARAM) - #define ASM_UNIMPLEMENTED_BREAK(message) \ - __ Debug(message, __LINE__, \ - FLAG_ignore_asm_unimplemented_break ? NO_PARAM : BREAK) - #define ASM_LOCATION(message) \ - __ Debug("LOCATION: " message, __LINE__, NO_PARAM) - #else - #define ASM_UNIMPLEMENTED(message) - #define ASM_UNIMPLEMENTED_BREAK(message) - #define ASM_LOCATION(message) - #endif - + #define ASM_UNIMPLEMENTED(message) + #define ASM_UNIMPLEMENTED_BREAK(message) + #define ASM_LOCATION(message) #endif diff --git a/src/code-stubs.h b/src/code-stubs.h index 0a90dbbe13eb..d568e34b798b 100644 --- a/src/code-stubs.h +++ b/src/code-stubs.h @@ -101,13 +101,7 @@ namespace internal { V(KeyedLoadField) // List of code stubs only used on ARM platforms. -#if V8_TARGET_ARCH_ARM -#define CODE_STUB_LIST_ARM(V) \ - V(GetProperty) \ - V(SetProperty) \ - V(InvokeBuiltin) \ - V(DirectCEntry) -#elif V8_TARGET_ARCH_A64 +#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_A64) #define CODE_STUB_LIST_ARM(V) \ V(GetProperty) \ V(SetProperty) \ diff --git a/test/message/message.status b/test/message/message.status index 9eb2d512f48d..00f6e34720e2 100644 --- a/test/message/message.status +++ b/test/message/message.status @@ -31,23 +31,4 @@ [ALWAYS, { 'bugs/*': [FAIL], }], # ALWAYS - -['arch == a64', { - # Message tests won't pass until all UNIMPLEMENTED messages are removed. - 'regress/regress-75': [SKIP], - 'regress/regress-73': [SKIP], - 'regress/regress-1527': [SKIP], - 'try-finally-throw-in-try': [SKIP], - 'try-finally-throw-in-finally': [SKIP], - 'try-finally-return-in-finally': [SKIP], - 'try-catch-finally-throw-in-finally': [SKIP], - 'try-catch-finally-throw-in-catch-and-finally': [SKIP], - 'try-catch-finally-throw-in-catch': [SKIP], - 'try-catch-finally-return-in-finally': [SKIP], - 'try-catch-finally-no-message': [SKIP], - 'simple-throw': [SKIP], - 'replacement-marker-as-argument': [SKIP], - 'overwritten-builtins': [SKIP], - 'try-finally-throw-in-try-and-finally': [SKIP], -}], # 'arch == a64' ]