Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index 6333e87bea1b6c2ed82cd2b4ea153dd0cc917890..bac4e793b279bf4a86353db7024aa92352219e79 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -753,9 +753,9 @@ void FullCodeGenerator::EmitDebugCheckDeclarationContext(Variable* variable) { |
// Check that we're not inside a with or catch context. |
__ movq(rbx, FieldOperand(rsi, HeapObject::kMapOffset)); |
__ CompareRoot(rbx, Heap::kWithContextMapRootIndex); |
- __ Check(not_equal, kDeclarationInWithContext); |
+ __ Check(not_equal, "Declaration in with context."); |
__ CompareRoot(rbx, Heap::kCatchContextMapRootIndex); |
- __ Check(not_equal, kDeclarationInCatchContext); |
+ __ Check(not_equal, "Declaration in catch context."); |
} |
} |
@@ -2192,7 +2192,7 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
__ Push(Smi::FromInt(resume_mode)); |
__ CallRuntime(Runtime::kResumeJSGeneratorObject, 3); |
// Not reached: the runtime call returns elsewhere. |
- __ Abort(kGeneratorFailedToResume); |
+ __ Abort("Generator failed to resume."); |
// Throw error if we attempt to operate on a running generator. |
__ bind(&wrong_state); |
@@ -2456,7 +2456,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
// Check for an uninitialized let binding. |
__ movq(rdx, location); |
__ CompareRoot(rdx, Heap::kTheHoleValueRootIndex); |
- __ Check(equal, kLetBindingReInitialization); |
+ __ Check(equal, "Let binding re-initialization."); |
} |
// Perform the assignment. |
__ movq(location, rax); |
@@ -3398,14 +3398,14 @@ void FullCodeGenerator::EmitSeqStringSetCharCheck(Register string, |
Register index, |
Register value, |
uint32_t encoding_mask) { |
- __ Check(masm()->CheckSmi(index), kNonSmiIndex); |
- __ Check(masm()->CheckSmi(value), kNonSmiValue); |
+ __ Check(masm()->CheckSmi(index), "Non-smi index"); |
+ __ Check(masm()->CheckSmi(value), "Non-smi value"); |
__ SmiCompare(index, FieldOperand(string, String::kLengthOffset)); |
- __ Check(less, kIndexIsTooLarge); |
+ __ Check(less, "Index is too large"); |
__ SmiCompare(index, Smi::FromInt(0)); |
- __ Check(greater_equal, kIndexIsNegative); |
+ __ Check(greater_equal, "Index is negative"); |
__ push(value); |
__ movq(value, FieldOperand(string, HeapObject::kMapOffset)); |
@@ -3413,7 +3413,7 @@ void FullCodeGenerator::EmitSeqStringSetCharCheck(Register string, |
__ andb(value, Immediate(kStringRepresentationMask | kStringEncodingMask)); |
__ cmpq(value, Immediate(encoding_mask)); |
- __ Check(equal, kUnexpectedStringType); |
+ __ Check(equal, "Unexpected string type"); |
__ pop(value); |
} |
@@ -3777,7 +3777,7 @@ void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) { |
Handle<FixedArray> jsfunction_result_caches( |
isolate()->native_context()->jsfunction_result_caches()); |
if (jsfunction_result_caches->length() <= cache_id) { |
- __ Abort(kAttemptToUseUndefinedCache); |
+ __ Abort("Attempt to use undefined cache."); |
__ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
context()->Plug(rax); |
return; |
@@ -3971,7 +3971,7 @@ void FullCodeGenerator::EmitFastAsciiArrayJoin(CallRuntime* expr) { |
// scratch, string_length(int32), elements(FixedArray*). |
if (generate_debug_code_) { |
__ cmpq(index, array_length); |
- __ Assert(below, kNoEmptyArraysHereInEmitFastAsciiArrayJoin); |
+ __ Assert(below, "No empty arrays here in EmitFastAsciiArrayJoin"); |
} |
__ bind(&loop); |
__ movq(string, FieldOperand(elements, |
@@ -4335,12 +4335,35 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
break; |
} |
+ case Token::SUB: |
+ EmitUnaryOperation(expr, "[ UnaryOperation (SUB)"); |
+ break; |
+ |
+ case Token::BIT_NOT: |
+ EmitUnaryOperation(expr, "[ UnaryOperation (BIT_NOT)"); |
+ break; |
+ |
default: |
UNREACHABLE(); |
} |
} |
+void FullCodeGenerator::EmitUnaryOperation(UnaryOperation* expr, |
+ const char* comment) { |
+ // TODO(svenpanne): Allowing format strings in Comment would be nice here... |
+ Comment cmt(masm_, comment); |
+ UnaryOpStub stub(expr->op()); |
+ // UnaryOpStub expects the argument to be in the |
+ // accumulator register rax. |
+ VisitForAccumulatorValue(expr->expression()); |
+ SetSourcePosition(expr->position()); |
+ CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, |
+ expr->UnaryOperationFeedbackId()); |
+ context()->Plug(rax); |
+} |
+ |
+ |
void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
Comment cmnt(masm_, "[ CountOperation"); |
SetSourcePosition(expr->position()); |
@@ -4796,7 +4819,7 @@ void FullCodeGenerator::EnterFinallyBlock() { |
ASSERT(!result_register().is(rdx)); |
ASSERT(!result_register().is(rcx)); |
// Cook return address on top of stack (smi encoded Code* delta) |
- __ PopReturnAddressTo(rdx); |
+ __ pop(rdx); |
__ Move(rcx, masm_->CodeObject()); |
__ subq(rdx, rcx); |
__ Integer32ToSmi(rdx, rdx); |