2008-11-27 13:54:31 +00:00
|
|
|
// Copyright 2008 the V8 project authors. All rights reserved.
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are
|
|
|
|
// met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above
|
|
|
|
// copyright notice, this list of conditions and the following
|
|
|
|
// disclaimer in the documentation and/or other materials provided
|
|
|
|
// with the distribution.
|
|
|
|
// * Neither the name of Google Inc. nor the names of its
|
|
|
|
// contributors may be used to endorse or promote products derived
|
|
|
|
// from this software without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
#include "v8.h"
|
|
|
|
#include "ast.h"
|
|
|
|
#include "regexp-macro-assembler.h"
|
|
|
|
#include "regexp-macro-assembler-tracer.h"
|
|
|
|
|
2009-05-25 10:05:56 +00:00
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
2008-11-27 13:54:31 +00:00
|
|
|
|
|
|
|
RegExpMacroAssemblerTracer::RegExpMacroAssemblerTracer(
|
|
|
|
RegExpMacroAssembler* assembler) :
|
|
|
|
assembler_(assembler) {
|
|
|
|
unsigned int type = assembler->Implementation();
|
|
|
|
ASSERT(type < 3);
|
|
|
|
const char* impl_names[3] = {"IA32", "ARM", "Bytecode"};
|
|
|
|
PrintF("RegExpMacroAssembler%s();\n", impl_names[type]);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
RegExpMacroAssemblerTracer::~RegExpMacroAssemblerTracer() {
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::Bind(Label* label) {
|
|
|
|
PrintF("label[%08x]: (Bind)\n", label, label);
|
|
|
|
assembler_->Bind(label);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::EmitOrLink(Label* label) {
|
|
|
|
PrintF(" EmitOrLink(label[%08x]);\n", label);
|
|
|
|
assembler_->EmitOrLink(label);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::AdvanceCurrentPosition(int by) {
|
|
|
|
PrintF(" AdvanceCurrentPosition(by=%d);\n", by);
|
|
|
|
assembler_->AdvanceCurrentPosition(by);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-12-08 09:22:12 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckGreedyLoop(Label* label) {
|
|
|
|
PrintF(" CheckGreedyLoop(label[%08x]);\n\n", label);
|
|
|
|
assembler_->CheckGreedyLoop(label);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::PopCurrentPosition() {
|
|
|
|
PrintF(" PopCurrentPosition();\n");
|
|
|
|
assembler_->PopCurrentPosition();
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::PushCurrentPosition() {
|
|
|
|
PrintF(" PushCurrentPosition();\n");
|
|
|
|
assembler_->PushCurrentPosition();
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::Backtrack() {
|
|
|
|
PrintF(" Backtrack();\n");
|
|
|
|
assembler_->Backtrack();
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::GoTo(Label* label) {
|
|
|
|
PrintF(" GoTo(label[%08x]);\n\n", label);
|
|
|
|
assembler_->GoTo(label);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::PushBacktrack(Label* label) {
|
2009-01-12 13:05:23 +00:00
|
|
|
PrintF(" PushBacktrack(label[%08x]);\n",
|
|
|
|
label);
|
2008-11-27 13:54:31 +00:00
|
|
|
assembler_->PushBacktrack(label);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::Succeed() {
|
|
|
|
PrintF(" Succeed();\n");
|
|
|
|
assembler_->Succeed();
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::Fail() {
|
|
|
|
PrintF(" Fail();\n");
|
|
|
|
assembler_->Fail();
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::PopRegister(int register_index) {
|
|
|
|
PrintF(" PopRegister(register=%d);\n", register_index);
|
|
|
|
assembler_->PopRegister(register_index);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2009-01-12 13:05:23 +00:00
|
|
|
void RegExpMacroAssemblerTracer::PushRegister(
|
|
|
|
int register_index,
|
|
|
|
StackCheckFlag check_stack_limit) {
|
|
|
|
PrintF(" PushRegister(register=%d, %s);\n",
|
|
|
|
register_index,
|
|
|
|
check_stack_limit ? "check stack limit" : "");
|
|
|
|
assembler_->PushRegister(register_index, check_stack_limit);
|
2008-11-27 13:54:31 +00:00
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::AdvanceRegister(int reg, int by) {
|
|
|
|
PrintF(" AdvanceRegister(register=%d, by=%d);\n", reg, by);
|
|
|
|
assembler_->AdvanceRegister(reg, by);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::SetRegister(int register_index, int to) {
|
|
|
|
PrintF(" SetRegister(register=%d, to=%d);\n", register_index, to);
|
|
|
|
assembler_->SetRegister(register_index, to);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-12-08 09:22:12 +00:00
|
|
|
void RegExpMacroAssemblerTracer::WriteCurrentPositionToRegister(int reg,
|
|
|
|
int cp_offset) {
|
|
|
|
PrintF(" WriteCurrentPositionToRegister(register=%d,cp_offset=%d);\n",
|
|
|
|
reg,
|
|
|
|
cp_offset);
|
|
|
|
assembler_->WriteCurrentPositionToRegister(reg, cp_offset);
|
2008-11-27 13:54:31 +00:00
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2009-01-26 14:38:17 +00:00
|
|
|
void RegExpMacroAssemblerTracer::ClearRegisters(int reg_from, int reg_to) {
|
|
|
|
PrintF(" ClearRegister(from=%d, to=%d);\n", reg_from, reg_to);
|
|
|
|
assembler_->ClearRegisters(reg_from, reg_to);
|
2009-01-14 11:32:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::ReadCurrentPositionFromRegister(int reg) {
|
|
|
|
PrintF(" ReadCurrentPositionFromRegister(register=%d);\n", reg);
|
|
|
|
assembler_->ReadCurrentPositionFromRegister(reg);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::WriteStackPointerToRegister(int reg) {
|
|
|
|
PrintF(" WriteStackPointerToRegister(register=%d);\n", reg);
|
|
|
|
assembler_->WriteStackPointerToRegister(reg);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::ReadStackPointerFromRegister(int reg) {
|
|
|
|
PrintF(" ReadStackPointerFromRegister(register=%d);\n", reg);
|
|
|
|
assembler_->ReadStackPointerFromRegister(reg);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::LoadCurrentCharacter(int cp_offset,
|
2008-12-19 12:02:34 +00:00
|
|
|
Label* on_end_of_input,
|
|
|
|
bool check_bounds,
|
|
|
|
int characters) {
|
|
|
|
const char* check_msg = check_bounds ? "" : " (unchecked)";
|
|
|
|
PrintF(" LoadCurrentCharacter(cp_offset=%d, label[%08x]%s (%d chars));\n",
|
2008-12-08 09:22:12 +00:00
|
|
|
cp_offset,
|
2008-12-19 12:02:34 +00:00
|
|
|
on_end_of_input,
|
|
|
|
check_msg,
|
|
|
|
characters);
|
|
|
|
assembler_->LoadCurrentCharacter(cp_offset,
|
|
|
|
on_end_of_input,
|
|
|
|
check_bounds,
|
|
|
|
characters);
|
2008-12-08 09:22:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckCharacterLT(uc16 limit, Label* on_less) {
|
|
|
|
PrintF(" CheckCharacterLT(c='u%04x', label[%08x]);\n", limit, on_less);
|
|
|
|
assembler_->CheckCharacterLT(limit, on_less);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckCharacterGT(uc16 limit,
|
|
|
|
Label* on_greater) {
|
|
|
|
PrintF(" CheckCharacterGT(c='u%04x', label[%08x]);\n", limit, on_greater);
|
|
|
|
assembler_->CheckCharacterGT(limit, on_greater);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-12-19 12:02:34 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckCharacter(uint32_t c, Label* on_equal) {
|
2008-11-27 13:54:31 +00:00
|
|
|
PrintF(" CheckCharacter(c='u%04x', label[%08x]);\n", c, on_equal);
|
|
|
|
assembler_->CheckCharacter(c, on_equal);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2009-01-19 18:56:47 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckAtStart(Label* on_at_start) {
|
|
|
|
PrintF(" CheckAtStart(label[%08x]);\n", on_at_start);
|
|
|
|
assembler_->CheckAtStart(on_at_start);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckNotAtStart(Label* on_not_at_start) {
|
|
|
|
PrintF(" CheckNotAtStart(label[%08x]);\n", on_not_at_start);
|
2008-12-01 09:57:14 +00:00
|
|
|
assembler_->CheckNotAtStart(on_not_at_start);
|
2008-11-28 12:11:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-12-19 12:02:34 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckNotCharacter(uint32_t c,
|
2008-11-27 13:54:31 +00:00
|
|
|
Label* on_not_equal) {
|
|
|
|
PrintF(" CheckNotCharacter(c='u%04x', label[%08x]);\n", c, on_not_equal);
|
|
|
|
assembler_->CheckNotCharacter(c, on_not_equal);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-12-19 12:02:34 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckCharacterAfterAnd(
|
|
|
|
uint32_t c,
|
|
|
|
uint32_t mask,
|
|
|
|
Label* on_equal) {
|
|
|
|
PrintF(" CheckCharacterAfterAnd(c='u%04x', mask=0x%04x, label[%08x]);\n",
|
|
|
|
c,
|
|
|
|
mask,
|
|
|
|
on_equal);
|
|
|
|
assembler_->CheckCharacterAfterAnd(c, mask, on_equal);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void RegExpMacroAssemblerTracer::CheckNotCharacterAfterAnd(
|
|
|
|
uint32_t c,
|
|
|
|
uint32_t mask,
|
|
|
|
Label* on_not_equal) {
|
|
|
|
PrintF(" CheckNotCharacterAfterAnd(c='u%04x', mask=0x%04x, label[%08x]);\n",
|
|
|
|
c,
|
|
|
|
mask,
|
|
|
|
on_not_equal);
|
|
|
|
assembler_->CheckNotCharacterAfterAnd(c, mask, on_not_equal);
|
2008-11-27 13:54:31 +00:00
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-12-19 12:02:34 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckNotCharacterAfterMinusAnd(
|
2008-11-27 13:54:31 +00:00
|
|
|
uc16 c,
|
2008-12-19 12:02:34 +00:00
|
|
|
uc16 minus,
|
2008-11-27 13:54:31 +00:00
|
|
|
uc16 mask,
|
|
|
|
Label* on_not_equal) {
|
2008-12-19 12:02:34 +00:00
|
|
|
PrintF(" CheckNotCharacterAfterMinusAnd(c='u%04x', minus=%04x, mask=0x%04x, "
|
|
|
|
"label[%08x]);\n",
|
|
|
|
c,
|
|
|
|
minus,
|
|
|
|
mask,
|
|
|
|
on_not_equal);
|
|
|
|
assembler_->CheckNotCharacterAfterMinusAnd(c, minus, mask, on_not_equal);
|
2008-11-27 13:54:31 +00:00
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckNotBackReference(int start_reg,
|
|
|
|
Label* on_no_match) {
|
|
|
|
PrintF(" CheckNotBackReference(register=%d, label[%08x]);\n", start_reg,
|
|
|
|
on_no_match);
|
|
|
|
assembler_->CheckNotBackReference(start_reg, on_no_match);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckNotBackReferenceIgnoreCase(
|
|
|
|
int start_reg,
|
|
|
|
Label* on_no_match) {
|
|
|
|
PrintF(" CheckNotBackReferenceIgnoreCase(register=%d, label[%08x]);\n",
|
|
|
|
start_reg, on_no_match);
|
|
|
|
assembler_->CheckNotBackReferenceIgnoreCase(start_reg, on_no_match);
|
|
|
|
}
|
|
|
|
|
2008-11-28 08:53:53 +00:00
|
|
|
|
|
|
|
void RegExpMacroAssemblerTracer::CheckNotRegistersEqual(int reg1,
|
|
|
|
int reg2,
|
|
|
|
Label* on_not_equal) {
|
|
|
|
PrintF(" CheckNotRegistersEqual(reg1=%d, reg2=%d, label[%08x]);\n",
|
|
|
|
reg1,
|
|
|
|
reg2,
|
|
|
|
on_not_equal);
|
|
|
|
assembler_->CheckNotRegistersEqual(reg1, reg2, on_not_equal);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckCharacters(Vector<const uc16> str,
|
|
|
|
int cp_offset,
|
2008-12-08 09:22:12 +00:00
|
|
|
Label* on_failure,
|
|
|
|
bool check_end_of_string) {
|
|
|
|
PrintF(" %s(str=\"",
|
|
|
|
check_end_of_string ? "CheckCharacters" : "CheckCharactersUnchecked");
|
2008-11-27 13:54:31 +00:00
|
|
|
for (int i = 0; i < str.length(); i++) {
|
|
|
|
PrintF("u%04x", str[i]);
|
|
|
|
}
|
|
|
|
PrintF("\", cp_offset=%d, label[%08x])\n", cp_offset, on_failure);
|
2008-12-08 09:22:12 +00:00
|
|
|
assembler_->CheckCharacters(str, cp_offset, on_failure, check_end_of_string);
|
2008-11-27 13:54:31 +00:00
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::CheckBitmap(uc16 start, Label* bitmap,
|
|
|
|
Label* on_zero) {
|
2009-01-02 12:23:17 +00:00
|
|
|
PrintF(" CheckBitmap(start=u%04x, <bitmap>, label[%08x]);\n", start, on_zero);
|
2008-11-27 13:54:31 +00:00
|
|
|
assembler_->CheckBitmap(start, bitmap, on_zero);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2009-01-02 12:23:17 +00:00
|
|
|
bool RegExpMacroAssemblerTracer::CheckSpecialCharacterClass(
|
|
|
|
uc16 type,
|
|
|
|
int cp_offset,
|
|
|
|
bool check_offset,
|
|
|
|
Label* on_no_match) {
|
|
|
|
bool supported = assembler_->CheckSpecialCharacterClass(type,
|
|
|
|
cp_offset,
|
|
|
|
check_offset,
|
|
|
|
on_no_match);
|
|
|
|
PrintF(" CheckSpecialCharacterClass(type='%c', offset=%d, "
|
|
|
|
"check_offset=%s, label[%08x]): %s;\n",
|
|
|
|
type,
|
|
|
|
cp_offset,
|
|
|
|
check_offset ? "true" : "false",
|
|
|
|
on_no_match,
|
|
|
|
supported ? "true" : "false");
|
|
|
|
return supported;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::DispatchHalfNibbleMap(
|
|
|
|
uc16 start,
|
|
|
|
Label* half_nibble_map,
|
|
|
|
const Vector<Label*>& destinations) {
|
2009-01-02 12:23:17 +00:00
|
|
|
PrintF(" DispatchHalfNibbleMap(start=u%04x, <half_nibble_map>, [", start);
|
2008-11-27 13:54:31 +00:00
|
|
|
for (int i = 0; i < destinations.length(); i++) {
|
|
|
|
if (i > 0)
|
|
|
|
PrintF(", ");
|
|
|
|
PrintF("label[%08x]", destinations[i]);
|
|
|
|
}
|
|
|
|
PrintF(");\n");
|
|
|
|
assembler_->DispatchHalfNibbleMap(start, half_nibble_map, destinations);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::DispatchByteMap(
|
|
|
|
uc16 start,
|
|
|
|
Label* byte_map,
|
|
|
|
const Vector<Label*>& destinations) {
|
2009-01-02 12:23:17 +00:00
|
|
|
PrintF(" DispatchByteMap(start=u%04x, <byte_map>, [", start);
|
2008-11-27 13:54:31 +00:00
|
|
|
for (int i = 0; i < destinations.length(); i++) {
|
|
|
|
if (i > 0)
|
|
|
|
PrintF(", ");
|
|
|
|
PrintF("label[%08x]", destinations[i]);
|
|
|
|
}
|
|
|
|
PrintF(");\n");
|
|
|
|
assembler_->DispatchByteMap(start, byte_map, destinations);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::DispatchHighByteMap(
|
|
|
|
byte start,
|
|
|
|
Label* byte_map,
|
|
|
|
const Vector<Label*>& destinations) {
|
2009-01-02 12:23:17 +00:00
|
|
|
PrintF(" DispatchHighByteMap(start=u%04x, <byte_map>, [", start);
|
2008-11-27 13:54:31 +00:00
|
|
|
for (int i = 0; i < destinations.length(); i++) {
|
|
|
|
if (i > 0)
|
|
|
|
PrintF(", ");
|
|
|
|
PrintF("label[%08x]", destinations[i]);
|
|
|
|
}
|
|
|
|
PrintF(");\n");
|
|
|
|
assembler_->DispatchHighByteMap(start, byte_map, destinations);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::IfRegisterLT(int register_index,
|
|
|
|
int comparand, Label* if_lt) {
|
|
|
|
PrintF(" IfRegisterLT(register=%d, number=%d, label[%08x]);\n",
|
|
|
|
register_index, comparand, if_lt);
|
|
|
|
assembler_->IfRegisterLT(register_index, comparand, if_lt);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2009-01-08 12:40:47 +00:00
|
|
|
void RegExpMacroAssemblerTracer::IfRegisterEqPos(int register_index,
|
|
|
|
Label* if_eq) {
|
|
|
|
PrintF(" IfRegisterEqPos(register=%d, label[%08x]);\n",
|
|
|
|
register_index, if_eq);
|
|
|
|
assembler_->IfRegisterEqPos(register_index, if_eq);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
void RegExpMacroAssemblerTracer::IfRegisterGE(int register_index,
|
|
|
|
int comparand, Label* if_ge) {
|
|
|
|
PrintF(" IfRegisterGE(register=%d, number=%d, label[%08x]);\n",
|
|
|
|
register_index, comparand, if_ge);
|
|
|
|
assembler_->IfRegisterGE(register_index, comparand, if_ge);
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-11-27 13:54:31 +00:00
|
|
|
RegExpMacroAssembler::IrregexpImplementation
|
|
|
|
RegExpMacroAssemblerTracer::Implementation() {
|
|
|
|
return assembler_->Implementation();
|
|
|
|
}
|
|
|
|
|
2008-11-28 12:11:36 +00:00
|
|
|
|
2008-12-08 09:22:12 +00:00
|
|
|
Handle<Object> RegExpMacroAssemblerTracer::GetCode(Handle<String> source) {
|
|
|
|
PrintF(" GetCode(%s);\n", *(source->ToCString()));
|
|
|
|
return assembler_->GetCode(source);
|
2008-11-27 13:54:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}} // namespace v8::internal
|