Remove support for branch hints from the IA32 and X64 assembler.

They were not on by default and should not be needed on modern
platforms.
Review URL: http://codereview.chromium.org/7001025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 03c00ee6
...@@ -147,7 +147,6 @@ DEFINE_bool(optimize_closures, true, "optimize closures") ...@@ -147,7 +147,6 @@ DEFINE_bool(optimize_closures, true, "optimize closures")
DEFINE_bool(debug_code, false, DEFINE_bool(debug_code, false,
"generate extra code (assertions) for debugging") "generate extra code (assertions) for debugging")
DEFINE_bool(code_comments, false, "emit comments in code disassembly") DEFINE_bool(code_comments, false, "emit comments in code disassembly")
DEFINE_bool(emit_branch_hints, false, "emit branch hints")
DEFINE_bool(peephole_optimization, true, DEFINE_bool(peephole_optimization, true,
"perform peephole optimizations in assembly code") "perform peephole optimizations in assembly code")
DEFINE_bool(print_peephole_optimization, false, DEFINE_bool(print_peephole_optimization, false,
......
...@@ -1423,10 +1423,9 @@ void Assembler::jmp(Handle<Code> code, RelocInfo::Mode rmode) { ...@@ -1423,10 +1423,9 @@ void Assembler::jmp(Handle<Code> code, RelocInfo::Mode rmode) {
} }
void Assembler::j(Condition cc, Label* L, Hint hint, Label::Distance distance) { void Assembler::j(Condition cc, Label* L, Label::Distance distance) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
ASSERT(0 <= cc && cc < 16); ASSERT(0 <= cc && cc < 16);
if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
if (L->is_bound()) { if (L->is_bound()) {
const int short_size = 2; const int short_size = 2;
const int long_size = 6; const int long_size = 6;
...@@ -1456,10 +1455,9 @@ void Assembler::j(Condition cc, Label* L, Hint hint, Label::Distance distance) { ...@@ -1456,10 +1455,9 @@ void Assembler::j(Condition cc, Label* L, Hint hint, Label::Distance distance) {
} }
void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint) { void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
ASSERT((0 <= cc) && (cc < 16)); ASSERT((0 <= cc) && (cc < 16));
if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
// 0000 1111 1000 tttn #32-bit disp. // 0000 1111 1000 tttn #32-bit disp.
EMIT(0x0F); EMIT(0x0F);
EMIT(0x80 | cc); EMIT(0x80 | cc);
...@@ -1467,9 +1465,8 @@ void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint) { ...@@ -1467,9 +1465,8 @@ void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint) {
} }
void Assembler::j(Condition cc, Handle<Code> code, Hint hint) { void Assembler::j(Condition cc, Handle<Code> code) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint);
// 0000 1111 1000 tttn #32-bit disp // 0000 1111 1000 tttn #32-bit disp
EMIT(0x0F); EMIT(0x0F);
EMIT(0x80 | cc); EMIT(0x80 | cc);
......
...@@ -249,23 +249,6 @@ inline Condition ReverseCondition(Condition cc) { ...@@ -249,23 +249,6 @@ inline Condition ReverseCondition(Condition cc) {
} }
enum Hint {
no_hint = 0,
not_taken = 0x2e,
taken = 0x3e
};
// The result of negating a hint is as if the corresponding condition
// were negated by NegateCondition. That is, no_hint is mapped to
// itself and not_taken and taken are mapped to each other.
inline Hint NegateHint(Hint hint) {
return (hint == no_hint)
? no_hint
: ((hint == not_taken) ? taken : not_taken);
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Machine instruction Immediates // Machine instruction Immediates
...@@ -863,13 +846,9 @@ class Assembler : public AssemblerBase { ...@@ -863,13 +846,9 @@ class Assembler : public AssemblerBase {
// Conditional jumps // Conditional jumps
void j(Condition cc, void j(Condition cc,
Label* L, Label* L,
Hint hint,
Label::Distance distance = Label::kFar); Label::Distance distance = Label::kFar);
void j(Condition cc, Label* L, Label::Distance distance = Label::kFar) { void j(Condition cc, byte* entry, RelocInfo::Mode rmode);
j(cc, L, no_hint, distance); void j(Condition cc, Handle<Code> code);
}
void j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint = no_hint);
void j(Condition cc, Handle<Code> code, Hint hint = no_hint);
// Floating-point operations // Floating-point operations
void fld(int i); void fld(int i);
......
...@@ -356,12 +356,12 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, ...@@ -356,12 +356,12 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// If the result is a smi, it is *not* an object in the ECMA sense. // If the result is a smi, it is *not* an object in the ECMA sense.
__ test(eax, Immediate(kSmiTagMask)); __ test(eax, Immediate(kSmiTagMask));
__ j(zero, &use_receiver, not_taken); __ j(zero, &use_receiver);
// If the type of the result (stored in its map) is less than // If the type of the result (stored in its map) is less than
// FIRST_JS_OBJECT_TYPE, it is not an object in the ECMA sense. // FIRST_JS_OBJECT_TYPE, it is not an object in the ECMA sense.
__ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, ecx); __ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, ecx);
__ j(above_equal, &exit, not_taken); __ j(above_equal, &exit);
// Throw away the result of the constructor invocation and use the // Throw away the result of the constructor invocation and use the
// on-stack receiver as the result. // on-stack receiver as the result.
...@@ -568,7 +568,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) { ...@@ -568,7 +568,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
// 1. Make sure we have at least one argument. // 1. Make sure we have at least one argument.
{ Label done; { Label done;
__ test(eax, Operand(eax)); __ test(eax, Operand(eax));
__ j(not_zero, &done, taken); __ j(not_zero, &done);
__ pop(ebx); __ pop(ebx);
__ push(Immediate(factory->undefined_value())); __ push(Immediate(factory->undefined_value()));
__ push(ebx); __ push(ebx);
...@@ -582,9 +582,9 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) { ...@@ -582,9 +582,9 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
// 1 ~ return address. // 1 ~ return address.
__ mov(edi, Operand(esp, eax, times_4, 1 * kPointerSize)); __ mov(edi, Operand(esp, eax, times_4, 1 * kPointerSize));
__ test(edi, Immediate(kSmiTagMask)); __ test(edi, Immediate(kSmiTagMask));
__ j(zero, &non_function, not_taken); __ j(zero, &non_function);
__ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx);
__ j(not_equal, &non_function, not_taken); __ j(not_equal, &non_function);
// 3a. Patch the first argument if necessary when calling a function. // 3a. Patch the first argument if necessary when calling a function.
...@@ -684,7 +684,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) { ...@@ -684,7 +684,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
// 5a. Call non-function via tail call to CALL_NON_FUNCTION builtin. // 5a. Call non-function via tail call to CALL_NON_FUNCTION builtin.
{ Label function; { Label function;
__ test(edi, Operand(edi)); __ test(edi, Operand(edi));
__ j(not_zero, &function, taken); __ j(not_zero, &function);
__ Set(ebx, Immediate(0)); __ Set(ebx, Immediate(0));
__ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION); __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION);
__ jmp(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), __ jmp(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
...@@ -733,7 +733,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { ...@@ -733,7 +733,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
__ shl(edx, kPointerSizeLog2 - kSmiTagSize); __ shl(edx, kPointerSizeLog2 - kSmiTagSize);
// Check if the arguments will overflow the stack. // Check if the arguments will overflow the stack.
__ cmp(ecx, Operand(edx)); __ cmp(ecx, Operand(edx));
__ j(greater, &okay, taken); // Signed comparison. __ j(greater, &okay); // Signed comparison.
// Out of stack space. // Out of stack space.
__ push(Operand(ebp, 4 * kPointerSize)); // push this __ push(Operand(ebp, 4 * kPointerSize)); // push this
...@@ -1589,7 +1589,7 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { ...@@ -1589,7 +1589,7 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
ExternalReference stack_limit = ExternalReference stack_limit =
ExternalReference::address_of_stack_limit(masm->isolate()); ExternalReference::address_of_stack_limit(masm->isolate());
__ cmp(esp, Operand::StaticVariable(stack_limit)); __ cmp(esp, Operand::StaticVariable(stack_limit));
__ j(above_equal, &ok, taken, Label::kNear); __ j(above_equal, &ok, Label::kNear);
StackCheckStub stub; StackCheckStub stub;
__ TailCallStub(&stub); __ TailCallStub(&stub);
__ Abort("Unreachable code: returned from tail call."); __ Abort("Unreachable code: returned from tail call.");
......
This diff is collapsed.
...@@ -245,7 +245,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) { ...@@ -245,7 +245,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
ExternalReference stack_limit = ExternalReference stack_limit =
ExternalReference::address_of_stack_limit(isolate()); ExternalReference::address_of_stack_limit(isolate());
__ cmp(esp, Operand::StaticVariable(stack_limit)); __ cmp(esp, Operand::StaticVariable(stack_limit));
__ j(above_equal, &ok, taken, Label::kNear); __ j(above_equal, &ok, Label::kNear);
StackCheckStub stub; StackCheckStub stub;
__ CallStub(&stub); __ CallStub(&stub);
__ bind(&ok); __ bind(&ok);
...@@ -278,7 +278,7 @@ void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt) { ...@@ -278,7 +278,7 @@ void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt) {
ExternalReference stack_limit = ExternalReference stack_limit =
ExternalReference::address_of_stack_limit(isolate()); ExternalReference::address_of_stack_limit(isolate());
__ cmp(esp, Operand::StaticVariable(stack_limit)); __ cmp(esp, Operand::StaticVariable(stack_limit));
__ j(above_equal, &ok, taken, Label::kNear); __ j(above_equal, &ok, Label::kNear);
StackCheckStub stub; StackCheckStub stub;
__ CallStub(&stub); __ CallStub(&stub);
// Record a mapping of this PC offset to the OSR id. This is used to find // Record a mapping of this PC offset to the OSR id. This is used to find
...@@ -1725,7 +1725,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -1725,7 +1725,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ imul(eax, Operand(ecx)); __ imul(eax, Operand(ecx));
__ j(overflow, &stub_call); __ j(overflow, &stub_call);
__ test(eax, Operand(eax)); __ test(eax, Operand(eax));
__ j(not_zero, &done, taken, Label::kNear); __ j(not_zero, &done, Label::kNear);
__ mov(ebx, edx); __ mov(ebx, edx);
__ or_(ebx, Operand(ecx)); __ or_(ebx, Operand(ecx));
__ j(negative, &stub_call); __ j(negative, &stub_call);
......
This diff is collapsed.
...@@ -572,7 +572,7 @@ void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { ...@@ -572,7 +572,7 @@ void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) {
__ jmp(entry, RelocInfo::RUNTIME_ENTRY); __ jmp(entry, RelocInfo::RUNTIME_ENTRY);
__ bind(&done); __ bind(&done);
} else { } else {
__ j(cc, entry, RelocInfo::RUNTIME_ENTRY, not_taken); __ j(cc, entry, RelocInfo::RUNTIME_ENTRY);
} }
} }
} }
...@@ -1482,7 +1482,7 @@ void LCodeGen::DoCmpID(LCmpID* instr) { ...@@ -1482,7 +1482,7 @@ void LCodeGen::DoCmpID(LCmpID* instr) {
// Don't base result on EFLAGS when a NaN is involved. Instead // Don't base result on EFLAGS when a NaN is involved. Instead
// jump to the unordered case, which produces a false value. // jump to the unordered case, which produces a false value.
__ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right));
__ j(parity_even, &unordered, not_taken, Label::kNear); __ j(parity_even, &unordered, Label::kNear);
} else { } else {
EmitCmpI(left, right); EmitCmpI(left, right);
} }
...@@ -2031,7 +2031,7 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { ...@@ -2031,7 +2031,7 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) {
// A Smi is not an instance of anything. // A Smi is not an instance of anything.
__ test(object, Immediate(kSmiTagMask)); __ test(object, Immediate(kSmiTagMask));
__ j(zero, &false_result, not_taken); __ j(zero, &false_result);
// This is the inlined call site instanceof cache. The two occurences of the // This is the inlined call site instanceof cache. The two occurences of the
// hole value will be patched to the last map/result pair generated by the // hole value will be patched to the last map/result pair generated by the
...@@ -2041,7 +2041,7 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { ...@@ -2041,7 +2041,7 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) {
__ mov(map, FieldOperand(object, HeapObject::kMapOffset)); __ mov(map, FieldOperand(object, HeapObject::kMapOffset));
__ bind(deferred->map_check()); // Label for calculating code patching. __ bind(deferred->map_check()); // Label for calculating code patching.
__ cmp(map, factory()->the_hole_value()); // Patched to cached map. __ cmp(map, factory()->the_hole_value()); // Patched to cached map.
__ j(not_equal, &cache_miss, not_taken, Label::kNear); __ j(not_equal, &cache_miss, Label::kNear);
__ mov(eax, factory()->the_hole_value()); // Patched to either true or false. __ mov(eax, factory()->the_hole_value()); // Patched to either true or false.
__ jmp(&done); __ jmp(&done);
...@@ -3622,7 +3622,7 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, ...@@ -3622,7 +3622,7 @@ void LCodeGen::EmitNumberUntagD(Register input_reg,
// Smi check. // Smi check.
__ test(input_reg, Immediate(kSmiTagMask)); __ test(input_reg, Immediate(kSmiTagMask));
__ j(zero, &load_smi, not_taken, Label::kNear); __ j(zero, &load_smi, Label::kNear);
// Heap number map check. // Heap number map check.
__ cmp(FieldOperand(input_reg, HeapObject::kMapOffset), __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
......
...@@ -513,7 +513,7 @@ void MacroAssembler::Throw(Register value) { ...@@ -513,7 +513,7 @@ void MacroAssembler::Throw(Register value) {
Set(esi, Immediate(0)); // Tentatively set context pointer to NULL. Set(esi, Immediate(0)); // Tentatively set context pointer to NULL.
Label skip; Label skip;
cmp(ebp, 0); cmp(ebp, 0);
j(equal, &skip, not_taken, Label::kNear); j(equal, &skip, Label::kNear);
mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
bind(&skip); bind(&skip);
...@@ -614,7 +614,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg, ...@@ -614,7 +614,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
// Check if both contexts are the same. // Check if both contexts are the same.
cmp(scratch, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset)); cmp(scratch, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset));
j(equal, &same_contexts, taken); j(equal, &same_contexts);
// Compare security tokens, save holder_reg on the stack so we can use it // Compare security tokens, save holder_reg on the stack so we can use it
// as a temporary register. // as a temporary register.
...@@ -644,7 +644,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg, ...@@ -644,7 +644,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg,
mov(scratch, FieldOperand(scratch, token_offset)); mov(scratch, FieldOperand(scratch, token_offset));
cmp(scratch, FieldOperand(holder_reg, token_offset)); cmp(scratch, FieldOperand(holder_reg, token_offset));
pop(holder_reg); pop(holder_reg);
j(not_equal, miss, not_taken); j(not_equal, miss);
bind(&same_contexts); bind(&same_contexts);
} }
...@@ -732,9 +732,9 @@ void MacroAssembler::AllocateInNewSpace(int object_size, ...@@ -732,9 +732,9 @@ void MacroAssembler::AllocateInNewSpace(int object_size,
mov(top_reg, result); mov(top_reg, result);
} }
add(Operand(top_reg), Immediate(object_size)); add(Operand(top_reg), Immediate(object_size));
j(carry, gc_required, not_taken); j(carry, gc_required);
cmp(top_reg, Operand::StaticVariable(new_space_allocation_limit)); cmp(top_reg, Operand::StaticVariable(new_space_allocation_limit));
j(above, gc_required, not_taken); j(above, gc_required);
// Update allocation top. // Update allocation top.
UpdateAllocationTopHelper(top_reg, scratch); UpdateAllocationTopHelper(top_reg, scratch);
...@@ -831,9 +831,9 @@ void MacroAssembler::AllocateInNewSpace(Register object_size, ...@@ -831,9 +831,9 @@ void MacroAssembler::AllocateInNewSpace(Register object_size,
mov(result_end, object_size); mov(result_end, object_size);
} }
add(result_end, Operand(result)); add(result_end, Operand(result));
j(carry, gc_required, not_taken); j(carry, gc_required);
cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); cmp(result_end, Operand::StaticVariable(new_space_allocation_limit));
j(above, gc_required, not_taken); j(above, gc_required);
// Tag result if requested. // Tag result if requested.
if ((flags & TAG_OBJECT) != 0) { if ((flags & TAG_OBJECT) != 0) {
...@@ -1062,9 +1062,9 @@ void MacroAssembler::NegativeZeroTest(Register result, ...@@ -1062,9 +1062,9 @@ void MacroAssembler::NegativeZeroTest(Register result,
Label* then_label) { Label* then_label) {
Label ok; Label ok;
test(result, Operand(result)); test(result, Operand(result));
j(not_zero, &ok, taken); j(not_zero, &ok);
test(op, Operand(op)); test(op, Operand(op));
j(sign, then_label, not_taken); j(sign, then_label);
bind(&ok); bind(&ok);
} }
...@@ -1076,10 +1076,10 @@ void MacroAssembler::NegativeZeroTest(Register result, ...@@ -1076,10 +1076,10 @@ void MacroAssembler::NegativeZeroTest(Register result,
Label* then_label) { Label* then_label) {
Label ok; Label ok;
test(result, Operand(result)); test(result, Operand(result));
j(not_zero, &ok, taken); j(not_zero, &ok);
mov(scratch, Operand(op1)); mov(scratch, Operand(op1));
or_(scratch, Operand(op2)); or_(scratch, Operand(op2));
j(sign, then_label, not_taken); j(sign, then_label);
bind(&ok); bind(&ok);
} }
...@@ -1090,17 +1090,17 @@ void MacroAssembler::TryGetFunctionPrototype(Register function, ...@@ -1090,17 +1090,17 @@ void MacroAssembler::TryGetFunctionPrototype(Register function,
Label* miss) { Label* miss) {
// Check that the receiver isn't a smi. // Check that the receiver isn't a smi.
test(function, Immediate(kSmiTagMask)); test(function, Immediate(kSmiTagMask));
j(zero, miss, not_taken); j(zero, miss);
// Check that the function really is a function. // Check that the function really is a function.
CmpObjectType(function, JS_FUNCTION_TYPE, result); CmpObjectType(function, JS_FUNCTION_TYPE, result);
j(not_equal, miss, not_taken); j(not_equal, miss);
// Make sure that the function has an instance prototype. // Make sure that the function has an instance prototype.
Label non_instance; Label non_instance;
movzx_b(scratch, FieldOperand(result, Map::kBitFieldOffset)); movzx_b(scratch, FieldOperand(result, Map::kBitFieldOffset));
test(scratch, Immediate(1 << Map::kHasNonInstancePrototype)); test(scratch, Immediate(1 << Map::kHasNonInstancePrototype));
j(not_zero, &non_instance, not_taken); j(not_zero, &non_instance);
// Get the prototype or initial map from the function. // Get the prototype or initial map from the function.
mov(result, mov(result,
...@@ -1110,7 +1110,7 @@ void MacroAssembler::TryGetFunctionPrototype(Register function, ...@@ -1110,7 +1110,7 @@ void MacroAssembler::TryGetFunctionPrototype(Register function,
// simply miss the cache instead. This will allow us to allocate a // simply miss the cache instead. This will allow us to allocate a
// prototype object on-demand in the runtime system. // prototype object on-demand in the runtime system.
cmp(Operand(result), Immediate(isolate()->factory()->the_hole_value())); cmp(Operand(result), Immediate(isolate()->factory()->the_hole_value()));
j(equal, miss, not_taken); j(equal, miss);
// If the function does not have an initial map, we're done. // If the function does not have an initial map, we're done.
Label done; Label done;
...@@ -1391,7 +1391,7 @@ MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function, ...@@ -1391,7 +1391,7 @@ MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function,
// Check if the result handle holds 0. // Check if the result handle holds 0.
test(eax, Operand(eax)); test(eax, Operand(eax));
j(zero, &empty_handle, not_taken); j(zero, &empty_handle);
// It was non-zero. Dereference to get the result value. // It was non-zero. Dereference to get the result value.
mov(eax, Operand(eax, 0)); mov(eax, Operand(eax, 0));
bind(&prologue); bind(&prologue);
...@@ -1401,7 +1401,7 @@ MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function, ...@@ -1401,7 +1401,7 @@ MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function,
sub(Operand::StaticVariable(level_address), Immediate(1)); sub(Operand::StaticVariable(level_address), Immediate(1));
Assert(above_equal, "Invalid HandleScope level"); Assert(above_equal, "Invalid HandleScope level");
cmp(edi, Operand::StaticVariable(limit_address)); cmp(edi, Operand::StaticVariable(limit_address));
j(not_equal, &delete_allocated_handles, not_taken); j(not_equal, &delete_allocated_handles);
bind(&leave_exit_frame); bind(&leave_exit_frame);
// Check if the function scheduled an exception. // Check if the function scheduled an exception.
...@@ -1409,7 +1409,7 @@ MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function, ...@@ -1409,7 +1409,7 @@ MaybeObject* MacroAssembler::TryCallApiFunctionAndReturn(ApiFunction* function,
ExternalReference::scheduled_exception_address(isolate()); ExternalReference::scheduled_exception_address(isolate());
cmp(Operand::StaticVariable(scheduled_exception_address), cmp(Operand::StaticVariable(scheduled_exception_address),
Immediate(isolate()->factory()->the_hole_value())); Immediate(isolate()->factory()->the_hole_value()));
j(not_equal, &promote_scheduled_exception, not_taken); j(not_equal, &promote_scheduled_exception);
LeaveApiExitFrame(); LeaveApiExitFrame();
ret(stack_space * kPointerSize); ret(stack_space * kPointerSize);
bind(&promote_scheduled_exception); bind(&promote_scheduled_exception);
...@@ -1849,7 +1849,7 @@ void MacroAssembler::AssertFastElements(Register elements) { ...@@ -1849,7 +1849,7 @@ void MacroAssembler::AssertFastElements(Register elements) {
void MacroAssembler::Check(Condition cc, const char* msg) { void MacroAssembler::Check(Condition cc, const char* msg) {
Label L; Label L;
j(cc, &L, taken); j(cc, &L);
Abort(msg); Abort(msg);
// will not return here // will not return here
bind(&L); bind(&L);
......
...@@ -265,12 +265,12 @@ class MacroAssembler: public Assembler { ...@@ -265,12 +265,12 @@ class MacroAssembler: public Assembler {
// Jump the register contains a smi. // Jump the register contains a smi.
inline void JumpIfSmi(Register value, Label* smi_label) { inline void JumpIfSmi(Register value, Label* smi_label) {
test(value, Immediate(kSmiTagMask)); test(value, Immediate(kSmiTagMask));
j(zero, smi_label, not_taken); j(zero, smi_label);
} }
// Jump if register contain a non-smi. // Jump if register contain a non-smi.
inline void JumpIfNotSmi(Register value, Label* not_smi_label) { inline void JumpIfNotSmi(Register value, Label* not_smi_label) {
test(value, Immediate(kSmiTagMask)); test(value, Immediate(kSmiTagMask));
j(not_zero, not_smi_label, not_taken); j(not_zero, not_smi_label);
} }
// Assumes input is a heap object. // Assumes input is a heap object.
......
...@@ -305,7 +305,7 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase( ...@@ -305,7 +305,7 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase(
// The length of a capture should not be negative. This can only happen // The length of a capture should not be negative. This can only happen
// if the end of the capture is unrecorded, or at a point earlier than // if the end of the capture is unrecorded, or at a point earlier than
// the start of the capture. // the start of the capture.
BranchOrBacktrack(less, on_no_match, not_taken); BranchOrBacktrack(less, on_no_match);
// If length is zero, either the capture is empty or it is completely // If length is zero, either the capture is empty or it is completely
// uncaptured. In either case succeed immediately. // uncaptured. In either case succeed immediately.
...@@ -348,7 +348,7 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase( ...@@ -348,7 +348,7 @@ void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase(
__ add(Operand(edi), Immediate(1)); __ add(Operand(edi), Immediate(1));
// Compare to end of match, and loop if not done. // Compare to end of match, and loop if not done.
__ cmp(edi, Operand(ebx)); __ cmp(edi, Operand(ebx));
__ j(below, &loop, taken); __ j(below, &loop);
__ jmp(&success); __ jmp(&success);
__ bind(&fail); __ bind(&fail);
...@@ -687,11 +687,11 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) { ...@@ -687,11 +687,11 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
__ mov(ecx, esp); __ mov(ecx, esp);
__ sub(ecx, Operand::StaticVariable(stack_limit)); __ sub(ecx, Operand::StaticVariable(stack_limit));
// Handle it if the stack pointer is already below the stack limit. // Handle it if the stack pointer is already below the stack limit.
__ j(below_equal, &stack_limit_hit, not_taken); __ j(below_equal, &stack_limit_hit);
// Check if there is room for the variable number of registers above // Check if there is room for the variable number of registers above
// the stack limit. // the stack limit.
__ cmp(ecx, num_registers_ * kPointerSize); __ cmp(ecx, num_registers_ * kPointerSize);
__ j(above_equal, &stack_ok, taken); __ j(above_equal, &stack_ok);
// Exit with OutOfMemory exception. There is not enough space on the stack // Exit with OutOfMemory exception. There is not enough space on the stack
// for our working registers. // for our working registers.
__ mov(eax, EXCEPTION); __ mov(eax, EXCEPTION);
...@@ -1142,8 +1142,7 @@ void RegExpMacroAssemblerIA32::CheckPosition(int cp_offset, ...@@ -1142,8 +1142,7 @@ void RegExpMacroAssemblerIA32::CheckPosition(int cp_offset,
void RegExpMacroAssemblerIA32::BranchOrBacktrack(Condition condition, void RegExpMacroAssemblerIA32::BranchOrBacktrack(Condition condition,
Label* to, Label* to) {
Hint hint) {
if (condition < 0) { // No condition if (condition < 0) { // No condition
if (to == NULL) { if (to == NULL) {
Backtrack(); Backtrack();
...@@ -1153,10 +1152,10 @@ void RegExpMacroAssemblerIA32::BranchOrBacktrack(Condition condition, ...@@ -1153,10 +1152,10 @@ void RegExpMacroAssemblerIA32::BranchOrBacktrack(Condition condition,
return; return;
} }
if (to == NULL) { if (to == NULL) {
__ j(condition, &backtrack_label_, hint); __ j(condition, &backtrack_label_);
return; return;
} }
__ j(condition, to, hint); __ j(condition, to);
} }
...@@ -1209,7 +1208,7 @@ void RegExpMacroAssemblerIA32::CheckPreemption() { ...@@ -1209,7 +1208,7 @@ void RegExpMacroAssemblerIA32::CheckPreemption() {
ExternalReference stack_limit = ExternalReference stack_limit =
ExternalReference::address_of_stack_limit(masm_->isolate()); ExternalReference::address_of_stack_limit(masm_->isolate());
__ cmp(esp, Operand::StaticVariable(stack_limit)); __ cmp(esp, Operand::StaticVariable(stack_limit));
__ j(above, &no_preempt, taken); __ j(above, &no_preempt);
SafeCall(&check_preempt_label_); SafeCall(&check_preempt_label_);
......
...@@ -168,7 +168,7 @@ class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler { ...@@ -168,7 +168,7 @@ class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler {
// Equivalent to a conditional branch to the label, unless the label // Equivalent to a conditional branch to the label, unless the label
// is NULL, in which case it is a conditional Backtrack. // is NULL, in which case it is a conditional Backtrack.
void BranchOrBacktrack(Condition condition, Label* to, Hint hint = no_hint); void BranchOrBacktrack(Condition condition, Label* to);
// Call and return internally in the generated code in a way that // Call and return internally in the generated code in a way that
// is GC-safe (i.e., doesn't leave absolute code addresses on the stack) // is GC-safe (i.e., doesn't leave absolute code addresses on the stack)
......
This diff is collapsed.
...@@ -1215,7 +1215,7 @@ void Assembler::int3() { ...@@ -1215,7 +1215,7 @@ void Assembler::int3() {
} }
void Assembler::j(Condition cc, Label* L, Hint hint, Label::Distance distance) { void Assembler::j(Condition cc, Label* L, Label::Distance distance) {
if (cc == always) { if (cc == always) {
jmp(L); jmp(L);
return; return;
...@@ -1224,7 +1224,6 @@ void Assembler::j(Condition cc, Label* L, Hint hint, Label::Distance distance) { ...@@ -1224,7 +1224,6 @@ void Assembler::j(Condition cc, Label* L, Hint hint, Label::Distance distance) {
} }
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
ASSERT(is_uint4(cc)); ASSERT(is_uint4(cc));
if (FLAG_emit_branch_hints && hint != no_hint) emit(hint);
if (L->is_bound()) { if (L->is_bound()) {
const int short_size = 2; const int short_size = 2;
const int long_size = 6; const int long_size = 6;
......
...@@ -327,22 +327,6 @@ inline Condition ReverseCondition(Condition cc) { ...@@ -327,22 +327,6 @@ inline Condition ReverseCondition(Condition cc) {
} }
enum Hint {
no_hint = 0,
not_taken = 0x2e,
taken = 0x3e
};
// The result of negating a hint is as if the corresponding condition
// were negated by NegateCondition. That is, no_hint is mapped to
// itself and not_taken and taken are mapped to each other.
inline Hint NegateHint(Hint hint) {
return (hint == no_hint)
? no_hint
: ((hint == not_taken) ? taken : not_taken);
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Machine instruction Immediates // Machine instruction Immediates
...@@ -1214,11 +1198,7 @@ class Assembler : public AssemblerBase { ...@@ -1214,11 +1198,7 @@ class Assembler : public AssemblerBase {
// Conditional jumps // Conditional jumps
void j(Condition cc, void j(Condition cc,
Label* L, Label* L,
Hint hint,
Label::Distance distance = Label::kFar); Label::Distance distance = Label::kFar);
void j(Condition cc, Label* L, Label::Distance distance = Label::kFar) {
j(cc, L, no_hint, distance);
}
void j(Condition cc, Handle<Code> target, RelocInfo::Mode rmode); void j(Condition cc, Handle<Code> target, RelocInfo::Mode rmode);
// Floating-point operations // Floating-point operations
......
...@@ -4859,9 +4859,9 @@ void ICCompareStub::GenerateObjects(MacroAssembler* masm) { ...@@ -4859,9 +4859,9 @@ void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
__ j(either_smi, &miss, Label::kNear); __ j(either_smi, &miss, Label::kNear);
__ CmpObjectType(rax, JS_OBJECT_TYPE, rcx); __ CmpObjectType(rax, JS_OBJECT_TYPE, rcx);
__ j(not_equal, &miss, not_taken, Label::kNear); __ j(not_equal, &miss, Label::kNear);
__ CmpObjectType(rdx, JS_OBJECT_TYPE, rcx); __ CmpObjectType(rdx, JS_OBJECT_TYPE, rcx);
__ j(not_equal, &miss, not_taken, Label::kNear); __ j(not_equal, &miss, Label::kNear);
ASSERT(GetCondition() == equal); ASSERT(GetCondition() == equal);
__ subq(rax, rdx); __ subq(rax, rdx);
......
...@@ -102,7 +102,7 @@ TEST(AssemblerIa321) { ...@@ -102,7 +102,7 @@ TEST(AssemblerIa321) {
__ bind(&C); __ bind(&C);
__ test(edx, Operand(edx)); __ test(edx, Operand(edx));
__ j(not_zero, &L, taken); __ j(not_zero, &L);
__ ret(0); __ ret(0);
CodeDesc desc; CodeDesc desc;
...@@ -140,7 +140,7 @@ TEST(AssemblerIa322) { ...@@ -140,7 +140,7 @@ TEST(AssemblerIa322) {
__ bind(&C); __ bind(&C);
__ test(edx, Operand(edx)); __ test(edx, Operand(edx));
__ j(not_zero, &L, taken); __ j(not_zero, &L);
__ ret(0); __ ret(0);
// some relocated stuff here, not executed // some relocated stuff here, not executed
...@@ -351,10 +351,10 @@ TEST(AssemblerIa329) { ...@@ -351,10 +351,10 @@ TEST(AssemblerIa329) {
__ fld_d(Operand(esp, 3 * kPointerSize)); __ fld_d(Operand(esp, 3 * kPointerSize));
__ fld_d(Operand(esp, 1 * kPointerSize)); __ fld_d(Operand(esp, 1 * kPointerSize));
__ FCmp(); __ FCmp();
__ j(parity_even, &nan_l, taken); __ j(parity_even, &nan_l);
__ j(equal, &equal_l, taken); __ j(equal, &equal_l);
__ j(below, &less_l, taken); __ j(below, &less_l);
__ j(above, &greater_l, taken); __ j(above, &greater_l);
__ mov(eax, kUndefined); __ mov(eax, kUndefined);
__ ret(0); __ ret(0);
......
...@@ -330,11 +330,6 @@ TEST(DisasmIa320) { ...@@ -330,11 +330,6 @@ TEST(DisasmIa320) {
__ j(less_equal, &Ljcc); __ j(less_equal, &Ljcc);
__ j(greater, &Ljcc); __ j(greater, &Ljcc);
// checking hints
__ j(zero, &Ljcc, taken);
__ j(zero, &Ljcc, not_taken);
// __ mov(Operand::StaticVariable(Isolate::handler_address()), eax);
// 0xD9 instructions // 0xD9 instructions
__ nop(); __ nop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment