diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-10-01 14:18:59 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-10-01 14:19:11 -0700 |
commit | c9627e0a0d191583e266836b8ce279e6dc527a40 (patch) | |
tree | f830b00031cc1d5eed1988d76e0a4647ca0be3a8 /deps/v8/src/regexp-macro-assembler-tracer.cc | |
parent | 5829716649a543f2c7e43859e5c0e32491b61198 (diff) | |
download | node-new-c9627e0a0d191583e266836b8ce279e6dc527a40.tar.gz |
Upgrade V8 to 2.4.7
Diffstat (limited to 'deps/v8/src/regexp-macro-assembler-tracer.cc')
-rw-r--r-- | deps/v8/src/regexp-macro-assembler-tracer.cc | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/deps/v8/src/regexp-macro-assembler-tracer.cc b/deps/v8/src/regexp-macro-assembler-tracer.cc index c08602eb1c..41c674b2a4 100644 --- a/deps/v8/src/regexp-macro-assembler-tracer.cc +++ b/deps/v8/src/regexp-macro-assembler-tracer.cc @@ -47,8 +47,15 @@ RegExpMacroAssemblerTracer::~RegExpMacroAssemblerTracer() { } +// This is used for printing out debugging information. It makes an integer +// that is closely related to the address of an object. +static int LabelToInt(Label* label) { + return static_cast<int>(reinterpret_cast<intptr_t>(label)); +} + + void RegExpMacroAssemblerTracer::Bind(Label* label) { - PrintF("label[%08x]: (Bind)\n", label, label); + PrintF("label[%08x]: (Bind)\n", LabelToInt(label)); assembler_->Bind(label); } @@ -60,7 +67,7 @@ void RegExpMacroAssemblerTracer::AdvanceCurrentPosition(int by) { void RegExpMacroAssemblerTracer::CheckGreedyLoop(Label* label) { - PrintF(" CheckGreedyLoop(label[%08x]);\n\n", label); + PrintF(" CheckGreedyLoop(label[%08x]);\n\n", LabelToInt(label)); assembler_->CheckGreedyLoop(label); } @@ -84,14 +91,13 @@ void RegExpMacroAssemblerTracer::Backtrack() { void RegExpMacroAssemblerTracer::GoTo(Label* label) { - PrintF(" GoTo(label[%08x]);\n\n", label); + PrintF(" GoTo(label[%08x]);\n\n", LabelToInt(label)); assembler_->GoTo(label); } void RegExpMacroAssemblerTracer::PushBacktrack(Label* label) { - PrintF(" PushBacktrack(label[%08x]);\n", - label); + PrintF(" PushBacktrack(label[%08x]);\n", LabelToInt(label)); assembler_->PushBacktrack(label); } @@ -176,7 +182,7 @@ void RegExpMacroAssemblerTracer::LoadCurrentCharacter(int cp_offset, const char* check_msg = check_bounds ? "" : " (unchecked)"; PrintF(" LoadCurrentCharacter(cp_offset=%d, label[%08x]%s (%d chars));\n", cp_offset, - on_end_of_input, + LabelToInt(on_end_of_input), check_msg, characters); assembler_->LoadCurrentCharacter(cp_offset, @@ -187,39 +193,43 @@ void RegExpMacroAssemblerTracer::LoadCurrentCharacter(int cp_offset, void RegExpMacroAssemblerTracer::CheckCharacterLT(uc16 limit, Label* on_less) { - PrintF(" CheckCharacterLT(c='u%04x', label[%08x]);\n", limit, on_less); + PrintF(" CheckCharacterLT(c='u%04x', label[%08x]);\n", + limit, LabelToInt(on_less)); assembler_->CheckCharacterLT(limit, on_less); } void RegExpMacroAssemblerTracer::CheckCharacterGT(uc16 limit, Label* on_greater) { - PrintF(" CheckCharacterGT(c='u%04x', label[%08x]);\n", limit, on_greater); + PrintF(" CheckCharacterGT(c='u%04x', label[%08x]);\n", + limit, LabelToInt(on_greater)); assembler_->CheckCharacterGT(limit, on_greater); } void RegExpMacroAssemblerTracer::CheckCharacter(uint32_t c, Label* on_equal) { - PrintF(" CheckCharacter(c='u%04x', label[%08x]);\n", c, on_equal); + PrintF(" CheckCharacter(c='u%04x', label[%08x]);\n", + c, LabelToInt(on_equal)); assembler_->CheckCharacter(c, on_equal); } void RegExpMacroAssemblerTracer::CheckAtStart(Label* on_at_start) { - PrintF(" CheckAtStart(label[%08x]);\n", on_at_start); + PrintF(" CheckAtStart(label[%08x]);\n", LabelToInt(on_at_start)); assembler_->CheckAtStart(on_at_start); } void RegExpMacroAssemblerTracer::CheckNotAtStart(Label* on_not_at_start) { - PrintF(" CheckNotAtStart(label[%08x]);\n", on_not_at_start); + PrintF(" CheckNotAtStart(label[%08x]);\n", LabelToInt(on_not_at_start)); assembler_->CheckNotAtStart(on_not_at_start); } void RegExpMacroAssemblerTracer::CheckNotCharacter(uint32_t c, Label* on_not_equal) { - PrintF(" CheckNotCharacter(c='u%04x', label[%08x]);\n", c, on_not_equal); + PrintF(" CheckNotCharacter(c='u%04x', label[%08x]);\n", + c, LabelToInt(on_not_equal)); assembler_->CheckNotCharacter(c, on_not_equal); } @@ -231,7 +241,7 @@ void RegExpMacroAssemblerTracer::CheckCharacterAfterAnd( PrintF(" CheckCharacterAfterAnd(c='u%04x', mask=0x%04x, label[%08x]);\n", c, mask, - on_equal); + LabelToInt(on_equal)); assembler_->CheckCharacterAfterAnd(c, mask, on_equal); } @@ -243,7 +253,7 @@ void RegExpMacroAssemblerTracer::CheckNotCharacterAfterAnd( PrintF(" CheckNotCharacterAfterAnd(c='u%04x', mask=0x%04x, label[%08x]);\n", c, mask, - on_not_equal); + LabelToInt(on_not_equal)); assembler_->CheckNotCharacterAfterAnd(c, mask, on_not_equal); } @@ -258,7 +268,7 @@ void RegExpMacroAssemblerTracer::CheckNotCharacterAfterMinusAnd( c, minus, mask, - on_not_equal); + LabelToInt(on_not_equal)); assembler_->CheckNotCharacterAfterMinusAnd(c, minus, mask, on_not_equal); } @@ -266,7 +276,7 @@ void RegExpMacroAssemblerTracer::CheckNotCharacterAfterMinusAnd( void RegExpMacroAssemblerTracer::CheckNotBackReference(int start_reg, Label* on_no_match) { PrintF(" CheckNotBackReference(register=%d, label[%08x]);\n", start_reg, - on_no_match); + LabelToInt(on_no_match)); assembler_->CheckNotBackReference(start_reg, on_no_match); } @@ -275,7 +285,7 @@ void RegExpMacroAssemblerTracer::CheckNotBackReferenceIgnoreCase( int start_reg, Label* on_no_match) { PrintF(" CheckNotBackReferenceIgnoreCase(register=%d, label[%08x]);\n", - start_reg, on_no_match); + start_reg, LabelToInt(on_no_match)); assembler_->CheckNotBackReferenceIgnoreCase(start_reg, on_no_match); } @@ -286,7 +296,7 @@ void RegExpMacroAssemblerTracer::CheckNotRegistersEqual(int reg1, PrintF(" CheckNotRegistersEqual(reg1=%d, reg2=%d, label[%08x]);\n", reg1, reg2, - on_not_equal); + LabelToInt(on_not_equal)); assembler_->CheckNotRegistersEqual(reg1, reg2, on_not_equal); } @@ -300,7 +310,8 @@ void RegExpMacroAssemblerTracer::CheckCharacters(Vector<const uc16> str, for (int i = 0; i < str.length(); i++) { PrintF("u%04x", str[i]); } - PrintF("\", cp_offset=%d, label[%08x])\n", cp_offset, on_failure); + PrintF("\", cp_offset=%d, label[%08x])\n", + cp_offset, LabelToInt(on_failure)); assembler_->CheckCharacters(str, cp_offset, on_failure, check_end_of_string); } @@ -312,7 +323,7 @@ bool RegExpMacroAssemblerTracer::CheckSpecialCharacterClass( on_no_match); PrintF(" CheckSpecialCharacterClass(type='%c', label[%08x]): %s;\n", type, - on_no_match, + LabelToInt(on_no_match), supported ? "true" : "false"); return supported; } @@ -321,7 +332,7 @@ bool RegExpMacroAssemblerTracer::CheckSpecialCharacterClass( 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); + register_index, comparand, LabelToInt(if_lt)); assembler_->IfRegisterLT(register_index, comparand, if_lt); } @@ -329,7 +340,7 @@ void RegExpMacroAssemblerTracer::IfRegisterLT(int register_index, void RegExpMacroAssemblerTracer::IfRegisterEqPos(int register_index, Label* if_eq) { PrintF(" IfRegisterEqPos(register=%d, label[%08x]);\n", - register_index, if_eq); + register_index, LabelToInt(if_eq)); assembler_->IfRegisterEqPos(register_index, if_eq); } @@ -337,7 +348,7 @@ void RegExpMacroAssemblerTracer::IfRegisterEqPos(int register_index, 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); + register_index, comparand, LabelToInt(if_ge)); assembler_->IfRegisterGE(register_index, comparand, if_ge); } |