LIBRARY_FLAGS = {
'all': {
'CPPPATH': [join(root_dir, 'src')],
- 'regexp:native': {
- 'CPPDEFINES': ['V8_NATIVE_REGEXP']
+ 'regexp:interpreted': {
+ 'CPPDEFINES': ['V8_INTERPRETED_REGEXP']
},
'mode:debug': {
'CPPDEFINES': ['V8_ENABLE_CHECKS']
namespace v8 {
namespace internal {
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
/*
* This assembler uses the following register assignment convention
* - r5 : Pointer to current code object (Code*) including heap object tag.
#undef __
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
}} // namespace v8::internal
namespace internal {
-#ifndef V8_NATIVE_REGEXP
+#ifdef V8_INTERPRETED_REGEXP
class RegExpMacroAssemblerARM: public RegExpMacroAssembler {
public:
RegExpMacroAssemblerARM();
virtual ~RegExpMacroAssemblerARM();
};
-#else
+#else // V8_INTERPRETED_REGEXP
class RegExpMacroAssemblerARM: public NativeRegExpMacroAssembler {
public:
RegExpMacroAssemblerARM(Mode mode, int registers_to_save);
const char* GetName() { return "RegExpCEntryStub"; }
};
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
}} // namespace v8::internal
} } // namespace assembler::arm
-#endif // !defined(__arm__)
+#endif // __arm__
#include "regexp-macro-assembler.h"
#include "platform.h"
// Include native regexp-macro-assembler.
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
#if V8_TARGET_ARCH_IA32
#include "ia32/regexp-macro-assembler-ia32.h"
#elif V8_TARGET_ARCH_X64
#else // Unknown architecture.
#error "Unknown architecture."
#endif // Target architecture.
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
namespace v8 {
namespace internal {
}
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
ExternalReference ExternalReference::re_check_stack_guard_state() {
Address function;
return ExternalReference(RegExpStack::memory_size_address());
}
-#endif
+#endif // V8_INTERPRETED_REGEXP
static double add_two_doubles(double x, double y) {
static ExternalReference debug_step_in_fp_address();
#endif
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
// C functions called from RegExp generated code.
// Function NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16()
#include "scopeinfo.h"
#include "snapshot.h"
#include "v8threads.h"
-#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
+#if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP
#include "regexp-macro-assembler.h"
#include "arm/regexp-macro-assembler-arm.h"
#endif
}
-#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
+#if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP
void Heap::CreateRegExpCEntryStub() {
RegExpCEntryStub stub;
set_re_c_entry_code(*stub.GetCode());
Heap::CreateCEntryStub();
Heap::CreateJSEntryStub();
Heap::CreateJSConstructEntryStub();
-#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
+#if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP
Heap::CreateRegExpCEntryStub();
#endif
}
V(Script, empty_script, EmptyScript) \
V(Smi, real_stack_limit, RealStackLimit) \
-#if V8_TARGET_ARCH_ARM && V8_NATIVE_REGEXP
+#if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP
#define STRONG_ROOT_LIST(V) \
UNCONDITIONAL_STRONG_ROOT_LIST(V) \
V(Code, re_c_entry_code, RegExpCEntryCode)
// Just jump directly to runtime if native RegExp is not selected at compile
// time or if regexp entry in generated code is turned off runtime switch or
// at compilation.
-#ifndef V8_NATIVE_REGEXP
+#ifdef V8_INTERPRETED_REGEXP
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
-#else // V8_NATIVE_REGEXP
+#else // V8_INTERPRETED_REGEXP
if (!FLAG_regexp_entry_native) {
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
return;
// Do the runtime call to execute the regexp.
__ bind(&runtime);
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
}
namespace v8 {
namespace internal {
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
/*
* This assembler uses the following register assignment convention
* - edx : current character. Must be loaded using LoadCurrentCharacter
#undef __
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
}} // namespace v8::internal
namespace v8 {
namespace internal {
-#ifndef V8_NATIVE_REGEXP
+#ifdef V8_INTERPRETED_REGEXP
class RegExpMacroAssemblerIA32: public RegExpMacroAssembler {
public:
RegExpMacroAssemblerIA32() { }
virtual ~RegExpMacroAssemblerIA32() { }
};
-#else
+#else // V8_INTERPRETED_REGEXP
class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler {
public:
RegExpMacroAssemblerIA32(Mode mode, int registers_to_save);
Label check_preempt_label_;
Label stack_overflow_label_;
};
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
}} // namespace v8::internal
#include "regexp-macro-assembler-irregexp.h"
#include "regexp-stack.h"
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
#if V8_TARGET_ARCH_IA32
#include "ia32/regexp-macro-assembler-ia32.h"
#elif V8_TARGET_ARCH_X64
// returns false.
bool RegExpImpl::EnsureCompiledIrregexp(Handle<JSRegExp> re, bool is_ascii) {
Object* compiled_code = re->DataAt(JSRegExp::code_index(is_ascii));
-#ifdef V8_NATIVE_REGEXP
- if (compiled_code->IsCode()) return true;
-#else // ! V8_NATIVE_REGEXP (RegExp interpreter code)
+#ifdef V8_INTERPRETED_REGEXP
if (compiled_code->IsByteArray()) return true;
+#else // V8_INTERPRETED_REGEXP (RegExp native code)
+ if (compiled_code->IsCode()) return true;
#endif
return CompileIrregexp(re, is_ascii);
}
if (!EnsureCompiledIrregexp(regexp, is_ascii)) {
return -1;
}
-#ifdef V8_NATIVE_REGEXP
+#ifdef V8_INTERPRETED_REGEXP
+ // Byte-code regexp needs space allocated for all its registers.
+ return IrregexpNumberOfRegisters(FixedArray::cast(regexp->data()));
+#else // V8_INTERPRETED_REGEXP
// Native regexp only needs room to output captures. Registers are handled
// internally.
return (IrregexpNumberOfCaptures(FixedArray::cast(regexp->data())) + 1) * 2;
-#else // !V8_NATIVE_REGEXP
- // Byte-code regexp needs space allocated for all its registers.
- return IrregexpNumberOfRegisters(FixedArray::cast(regexp->data()));
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
}
ASSERT(index <= subject->length());
ASSERT(subject->IsFlat());
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
ASSERT(output.length() >=
(IrregexpNumberOfCaptures(*irregexp) + 1) * 2);
do {
} while (true);
UNREACHABLE();
return RE_EXCEPTION;
-#else // ndef V8_NATIVE_REGEXP
+#else // V8_INTERPRETED_REGEXP
ASSERT(output.length() >= IrregexpNumberOfRegisters(*irregexp));
bool is_ascii = subject->IsAsciiRepresentation();
return RE_SUCCESS;
}
return RE_FAILURE;
-#endif // ndef V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
}
ASSERT_EQ(jsregexp->TypeTag(), JSRegExp::IRREGEXP);
// Prepare space for the return values.
-#ifndef V8_NATIVE_REGEXP
+#ifdef V8_INTERPRETED_REGEXP
#ifdef DEBUG
if (FLAG_trace_regexp_bytecodes) {
String* pattern = jsregexp->Pattern();
NodeInfo info = *node->info();
// Create the correct assembler for the architecture.
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
// Native regexp implementation.
NativeRegExpMacroAssembler::Mode mode =
RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2);
#endif
-#else // ! V8_NATIVE_REGEXP
+#else // V8_INTERPRETED_REGEXP
// Interpreted regexp implementation.
EmbeddedVector<byte, 1024> codes;
RegExpMacroAssemblerIrregexp macro_assembler(codes);
-#endif
+#endif // V8_INTERPRETED_REGEXP
return compiler.Assemble(¯o_assembler,
node,
public:
// Whether V8 is compiled with native regexp support or not.
static bool UsesNativeRegExp() {
-#ifdef V8_NATIVE_REGEXP
- return true;
-#else
+#ifdef V8_INTERPRETED_REGEXP
return false;
+#else
+ return true;
#endif
}
sim_->set_pc(sim_->get_pc() + Instruction::kInstructionSize);
Debug();
}
-#endif // def GENERATED_CODE_COVERAGE
+#endif // GENERATED_CODE_COVERAGE
int32_t Debugger::GetRegisterValue(int regnum) {
} } // namespace assembler::mips
-#endif // !defined(__mips)
+#endif // __mips
namespace v8 {
namespace internal {
-#ifndef V8_NATIVE_REGEXP
+#ifdef V8_INTERPRETED_REGEXP
void RegExpMacroAssemblerIrregexp::Emit(uint32_t byte,
uint32_t twenty_four_bits) {
pc_ += 4;
}
-#endif // ! V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
} } // namespace v8::internal
namespace v8 {
namespace internal {
-#ifndef V8_NATIVE_REGEXP
+#ifdef V8_INTERPRETED_REGEXP
RegExpMacroAssemblerIrregexp::RegExpMacroAssemblerIrregexp(Vector<byte> buffer)
: buffer_(buffer),
}
}
-#endif // !V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
} } // namespace v8::internal
namespace v8 {
namespace internal {
-#ifndef V8_NATIVE_REGEXP
+#ifdef V8_INTERPRETED_REGEXP
class RegExpMacroAssemblerIrregexp: public RegExpMacroAssembler {
public:
DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMacroAssemblerIrregexp);
};
-#endif // !V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
} } // namespace v8::internal
}
-#ifdef V8_NATIVE_REGEXP // Avoid unused code, e.g., on ARM.
+#ifndef V8_INTERPRETED_REGEXP // Avoid unused code, e.g., on ARM.
NativeRegExpMacroAssembler::NativeRegExpMacroAssembler() {
}
return new_stack_base - stack_content_size;
}
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
+
} } // namespace v8::internal
};
-#ifdef V8_NATIVE_REGEXP // Avoid compiling unused code.
+#ifndef V8_INTERPRETED_REGEXP // Avoid compiling unused code.
class NativeRegExpMacroAssembler: public RegExpMacroAssembler {
public:
int* output);
};
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
} } // namespace v8::internal
UNCLASSIFIED,
21,
"compile_array_push");
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
Add(ExternalReference::re_case_insensitive_compare_uc16().address(),
UNCLASSIFIED,
22,
UNCLASSIFIED,
25,
"NativeRegExpMacroAssembler::word_character_map");
-#endif
+#endif // V8_INTERPRETED_REGEXP
// Keyed lookup cache.
Add(ExternalReference::keyed_lookup_cache_keys().address(),
UNCLASSIFIED,
__ movq(rbx, Operand(kScratchRegister, EntryFrameConstants::kArgvOffset));
// Load the function pointer into rdi.
__ movq(rdi, rdx);
-#else // !defined(_WIN64)
+#else // _WIN64
// GCC parameters in:
// rdi : entry (ignored)
// rsi : function
// Just jump directly to runtime if native RegExp is not selected at compile
// time or if regexp entry in generated code is turned off runtime switch or
// at compilation.
-#ifndef V8_NATIVE_REGEXP
+#ifdef V8_INTERPRETED_REGEXP
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
-#else // V8_NATIVE_REGEXP
+#else // V8_INTERPRETED_REGEXP
if (!FLAG_regexp_entry_native) {
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
return;
// Do the runtime call to execute the regexp.
__ bind(&runtime);
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
}
// passed in register.
#ifdef _WIN64
__ movq(rcx, rax);
-#else // ! defined(_WIN64)
+#else // _WIN64
__ movq(rdi, rax);
#endif
__ movq(kScratchRegister,
__ lea(rdx, Operand(rsp, 4 * kPointerSize));
}
-#else // ! defined(_WIN64)
+#else // _WIN64
// GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9.
__ movq(rdi, r14); // argc.
__ movq(rsi, r15); // argv.
namespace v8 {
namespace internal {
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
/*
* This assembler uses the following register assignment convention
#undef __
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
}} // namespace v8::internal
namespace v8 {
namespace internal {
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler {
public:
Label stack_overflow_label_;
};
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
}} // namespace v8::internal
}
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
// Debug event handler which gets the function on the top frame and schedules a
// break a number of times.
static void DebugEventDebugBreak(
CHECK_EQ(1, break_point_hit_count);
CHECK_EQ("f", last_function_hit);
}
-#endif // V8_NATIVE_REGEXP
+#endif // V8_INTERPRETED_REGEXP
// Common part of EvalContextData and NestedBreakEventContextData tests.
#include "jsregexp.h"
#include "regexp-macro-assembler.h"
#include "regexp-macro-assembler-irregexp.h"
-#ifdef V8_NATIVE_REGEXP
+#ifdef V8_INTERPRETED_REGEXP
+#include "interpreter-irregexp.h"
+#else // V8_INTERPRETED_REGEXP
#ifdef V8_TARGET_ARCH_ARM
#include "arm/macro-assembler-arm.h"
#include "arm/regexp-macro-assembler-arm.h"
#include "ia32/macro-assembler-ia32.h"
#include "ia32/regexp-macro-assembler-ia32.h"
#endif
-#else
-#include "interpreter-irregexp.h"
-#endif
+#endif // V8_INTERPRETED_REGEXP
using namespace v8::internal;
// Tests of interpreter.
-#ifdef V8_NATIVE_REGEXP
+#ifndef V8_INTERPRETED_REGEXP
#if V8_TARGET_ARCH_IA32
typedef RegExpMacroAssemblerIA32 ArchRegExpMacroAssembler;
Top::clear_pending_exception();
}
-#else // ! V8_REGEX_NATIVE
+#else // V8_INTERPRETED_REGEXP
TEST(MacroAssembler) {
V8::Initialize(NULL);
CHECK_EQ(42, captures[0]);
}
-#endif // ! V8_REGEXP_NATIVE
+#endif // V8_INTERPRETED_REGEXP
TEST(AddInverseToTable) {
'gcc_version%': 'unknown',
'target_arch%': 'ia32',
'v8_use_snapshot%': 'true',
- 'v8_regexp%': 'native',
},
'target_defaults': {
'defines': [
['target_arch=="ia32"', {
'defines': [
'V8_TARGET_ARCH_IA32',
- 'V8_NATIVE_REGEXP',
],
}],
['target_arch=="x64"', {
'defines': [
'V8_TARGET_ARCH_X64',
- 'V8_NATIVE_REGEXP',
],
}],
],
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
V8_TARGET_ARCH_IA32,
- V8_NATIVE_REGEXP,
DEBUG,
V8_ENABLE_CHECKS,
ENABLE_DEBUGGER_SUPPORT,
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
V8_TARGET_ARCH_IA32,
- V8_NATIVE_REGEXP,
NDEBUG,
ENABLE_DEBUGGER_SUPPORT,
);
"$(GCC_PREPROCESSOR_DEFINITIONS)",
ENABLE_DISASSEMBLER,
V8_TARGET_ARCH_IA32,
- V8_NATIVE_REGEXP,
ENABLE_LOGGING_AND_PROFILING,
ENABLE_DEBUGGER_SUPPORT,
);
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
V8_TARGET_ARCH_IA32,
- V8_NATIVE_REGEXP,
NDEBUG,
ENABLE_DEBUGGER_SUPPORT,
);
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="_USE_32BIT_TIME_T;V8_TARGET_ARCH_ARM;V8_NATIVE_REGEXP"
+ PreprocessorDefinitions="_USE_32BIT_TIME_T;V8_TARGET_ARCH_ARM"
DisableSpecificWarnings="4996"
/>
</VisualStudioPropertySheet>
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="_USE_32BIT_TIME_T;V8_TARGET_ARCH_IA32;V8_NATIVE_REGEXP"
+ PreprocessorDefinitions="_USE_32BIT_TIME_T;V8_TARGET_ARCH_IA32"
/>
<Tool
Name="VCLinkerTool"
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="V8_TARGET_ARCH_X64;V8_NATIVE_REGEXP"
+ PreprocessorDefinitions="V8_TARGET_ARCH_X64"
/>
<Tool
Name="VCLinkerTool"