diff options
Diffstat (limited to 'chromium/v8/src/arm/full-codegen-arm.cc')
-rw-r--r-- | chromium/v8/src/arm/full-codegen-arm.cc | 81 |
1 files changed, 28 insertions, 53 deletions
diff --git a/chromium/v8/src/arm/full-codegen-arm.cc b/chromium/v8/src/arm/full-codegen-arm.cc index ea7b73f2fe9..b6fb70b5df0 100644 --- a/chromium/v8/src/arm/full-codegen-arm.cc +++ b/chromium/v8/src/arm/full-codegen-arm.cc @@ -296,8 +296,7 @@ void FullCodeGenerator::Generate() { __ cmp(sp, Operand(ip)); __ b(hs, &ok); PredictableCodeSizeScope predictable(masm_, 2 * Assembler::kInstrSize); - StackCheckStub stub; - __ CallStub(&stub); + __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); __ bind(&ok); } @@ -366,8 +365,7 @@ void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, } EmitProfilingCounterDecrement(weight); __ b(pl, &ok); - InterruptStub stub; - __ CallStub(&stub); + __ Call(isolate()->builtins()->InterruptCheck(), RelocInfo::CODE_TARGET); // Record a mapping of this PC offset to the OSR id. This is used to find // the AST id from the unoptimized code in order to use it as a key into @@ -416,8 +414,8 @@ void FullCodeGenerator::EmitReturnSequence() { __ push(r2); __ CallRuntime(Runtime::kOptimizeFunctionOnNextCall, 1); } else { - InterruptStub stub; - __ CallStub(&stub); + __ Call(isolate()->builtins()->InterruptCheck(), + RelocInfo::CODE_TARGET); } __ pop(r0); EmitProfilingCounterReset(); @@ -786,9 +784,9 @@ void FullCodeGenerator::EmitDebugCheckDeclarationContext(Variable* variable) { // Check that we're not inside a with or catch context. __ ldr(r1, FieldMemOperand(cp, HeapObject::kMapOffset)); __ CompareRoot(r1, Heap::kWithContextMapRootIndex); - __ Check(ne, "Declaration in with context."); + __ Check(ne, kDeclarationInWithContext); __ CompareRoot(r1, Heap::kCatchContextMapRootIndex); - __ Check(ne, "Declaration in catch context."); + __ Check(ne, kDeclarationInCatchContext); } } @@ -1330,8 +1328,7 @@ void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, scope()->is_function_scope() && info->num_literals() == 0) { FastNewClosureStub stub(info->language_mode(), info->is_generator()); - __ mov(r0, Operand(info)); - __ push(r0); + __ mov(r2, Operand(info)); __ CallStub(&stub); } else { __ mov(r0, Operand(info)); @@ -2512,7 +2509,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, // Check for an uninitialized let binding. __ ldr(r2, location); __ CompareRoot(r2, Heap::kTheHoleValueRootIndex); - __ Check(eq, "Let binding re-initialization."); + __ Check(eq, kLetBindingReInitialization); } // Perform the assignment. __ str(r0, location); @@ -3010,7 +3007,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( VisitForAccumulatorValue(args->at(0)); - Label materialize_true, materialize_false; + Label materialize_true, materialize_false, skip_lookup; Label* if_true = NULL; Label* if_false = NULL; Label* fall_through = NULL; @@ -3022,7 +3019,7 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); __ ldrb(ip, FieldMemOperand(r1, Map::kBitField2Offset)); __ tst(ip, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); - __ b(ne, if_true); + __ b(ne, &skip_lookup); // Check for fast case object. Generate false result for slow case object. __ ldr(r2, FieldMemOperand(r0, JSObject::kPropertiesOffset)); @@ -3068,6 +3065,14 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( __ b(ne, &loop); __ bind(&done); + + // Set the bit in the map to indicate that there is no local valueOf field. + __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); + __ orr(r2, r2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); + __ strb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); + + __ bind(&skip_lookup); + // If a valueOf property is not found on the object check that its // prototype is the un-modified String prototype. If not result is false. __ ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); @@ -3077,16 +3082,9 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( __ ldr(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset)); __ ldr(r3, ContextOperand(r3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); __ cmp(r2, r3); - __ b(ne, if_false); - - // Set the bit in the map to indicate that it has been checked safe for - // default valueOf and set true result. - __ ldrb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); - __ orr(r2, r2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); - __ strb(r2, FieldMemOperand(r1, Map::kBitField2Offset)); - __ jmp(if_true); - PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); + Split(eq, if_true, if_false, fall_through); + context()->Plug(if_true, if_false); } @@ -3320,7 +3318,7 @@ void FullCodeGenerator::EmitLog(CallRuntime* expr) { // 2 (array): Arguments to the format string. ZoneList<Expression*>* args = expr->arguments(); ASSERT_EQ(args->length(), 3); - if (CodeGenerator::ShouldGenerateLog(args->at(0))) { + if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { VisitForStackValue(args->at(1)); VisitForStackValue(args->at(2)); __ CallRuntime(Runtime::kLog, 2); @@ -3473,23 +3471,23 @@ void FullCodeGenerator::EmitSeqStringSetCharCheck(Register string, Register value, uint32_t encoding_mask) { __ SmiTst(index); - __ Check(eq, "Non-smi index"); + __ Check(eq, kNonSmiIndex); __ SmiTst(value); - __ Check(eq, "Non-smi value"); + __ Check(eq, kNonSmiValue); __ ldr(ip, FieldMemOperand(string, String::kLengthOffset)); __ cmp(index, ip); - __ Check(lt, "Index is too large"); + __ Check(lt, kIndexIsTooLarge); __ cmp(index, Operand(Smi::FromInt(0))); - __ Check(ge, "Index is negative"); + __ Check(ge, kIndexIsNegative); __ ldr(ip, FieldMemOperand(string, HeapObject::kMapOffset)); __ ldrb(ip, FieldMemOperand(ip, Map::kInstanceTypeOffset)); __ and_(ip, ip, Operand(kStringRepresentationMask | kStringEncodingMask)); __ cmp(ip, Operand(encoding_mask)); - __ Check(eq, "Unexpected string type"); + __ Check(eq, kUnexpectedStringType); } @@ -3849,7 +3847,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("Attempt to use undefined cache."); + __ Abort(kAttemptToUseUndefinedCache); __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); context()->Plug(r0); return; @@ -4030,7 +4028,7 @@ void FullCodeGenerator::EmitFastAsciiArrayJoin(CallRuntime* expr) { // elements_end: Array end. if (generate_debug_code_) { __ cmp(array_length, Operand::Zero()); - __ Assert(gt, "No empty arrays here in EmitFastAsciiArrayJoin"); + __ Assert(gt, kNoEmptyArraysHereInEmitFastAsciiArrayJoin); } __ bind(&loop); __ ldr(string, MemOperand(element, kPointerSize, PostIndex)); @@ -4349,35 +4347,12 @@ 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 r0. - VisitForAccumulatorValue(expr->expression()); - SetSourcePosition(expr->position()); - CallIC(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, - expr->UnaryOperationFeedbackId()); - context()->Plug(r0); -} - - void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { Comment cmnt(masm_, "[ CountOperation"); SetSourcePosition(expr->position()); |