| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2432 __ ldr(r1, GlobalObjectOperand()); | 2432 __ ldr(r1, GlobalObjectOperand()); |
| 2433 Handle<Code> ic = is_classic_mode() | 2433 Handle<Code> ic = is_classic_mode() |
| 2434 ? isolate()->builtins()->StoreIC_Initialize() | 2434 ? isolate()->builtins()->StoreIC_Initialize() |
| 2435 : isolate()->builtins()->StoreIC_Initialize_Strict(); | 2435 : isolate()->builtins()->StoreIC_Initialize_Strict(); |
| 2436 CallIC(ic, RelocInfo::CODE_TARGET_CONTEXT); | 2436 CallIC(ic, RelocInfo::CODE_TARGET_CONTEXT); |
| 2437 | 2437 |
| 2438 } else if (op == Token::INIT_CONST) { | 2438 } else if (op == Token::INIT_CONST) { |
| 2439 // Const initializers need a write barrier. | 2439 // Const initializers need a write barrier. |
| 2440 ASSERT(!var->IsParameter()); // No const parameters. | 2440 ASSERT(!var->IsParameter()); // No const parameters. |
| 2441 if (var->IsStackLocal()) { | 2441 if (var->IsStackLocal()) { |
| 2442 Label skip; | |
| 2443 __ ldr(r1, StackOperand(var)); | 2442 __ ldr(r1, StackOperand(var)); |
| 2444 __ CompareRoot(r1, Heap::kTheHoleValueRootIndex); | 2443 __ CompareRoot(r1, Heap::kTheHoleValueRootIndex); |
| 2445 __ b(ne, &skip); | 2444 __ str(result_register(), StackOperand(var), eq); |
| 2446 __ str(result_register(), StackOperand(var)); | |
| 2447 __ bind(&skip); | |
| 2448 } else { | 2445 } else { |
| 2449 ASSERT(var->IsContextSlot() || var->IsLookupSlot()); | 2446 ASSERT(var->IsContextSlot() || var->IsLookupSlot()); |
| 2450 // Like var declarations, const declarations are hoisted to function | 2447 // Like var declarations, const declarations are hoisted to function |
| 2451 // scope. However, unlike var initializers, const initializers are | 2448 // scope. However, unlike var initializers, const initializers are |
| 2452 // able to drill a hole to that function context, even from inside a | 2449 // able to drill a hole to that function context, even from inside a |
| 2453 // 'with' context. We thus bypass the normal static scope lookup for | 2450 // 'with' context. We thus bypass the normal static scope lookup for |
| 2454 // var->IsContextSlot(). | 2451 // var->IsContextSlot(). |
| 2455 __ push(r0); | 2452 __ push(r0); |
| 2456 __ mov(r0, Operand(var->name())); | 2453 __ mov(r0, Operand(var->name())); |
| 2457 __ Push(cp, r0); // Context and name. | 2454 __ Push(cp, r0); // Context and name. |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3174 Label* if_true = NULL; | 3171 Label* if_true = NULL; |
| 3175 Label* if_false = NULL; | 3172 Label* if_false = NULL; |
| 3176 Label* fall_through = NULL; | 3173 Label* fall_through = NULL; |
| 3177 context()->PrepareTest(&materialize_true, &materialize_false, | 3174 context()->PrepareTest(&materialize_true, &materialize_false, |
| 3178 &if_true, &if_false, &fall_through); | 3175 &if_true, &if_false, &fall_through); |
| 3179 | 3176 |
| 3180 // Get the frame pointer for the calling frame. | 3177 // Get the frame pointer for the calling frame. |
| 3181 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 3178 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 3182 | 3179 |
| 3183 // Skip the arguments adaptor frame if it exists. | 3180 // Skip the arguments adaptor frame if it exists. |
| 3184 Label check_frame_marker; | |
| 3185 __ ldr(r1, MemOperand(r2, StandardFrameConstants::kContextOffset)); | 3181 __ ldr(r1, MemOperand(r2, StandardFrameConstants::kContextOffset)); |
| 3186 __ cmp(r1, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 3182 __ cmp(r1, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 3187 __ b(ne, &check_frame_marker); | 3183 __ ldr(r2, MemOperand(r2, StandardFrameConstants::kCallerFPOffset), eq); |
| 3188 __ ldr(r2, MemOperand(r2, StandardFrameConstants::kCallerFPOffset)); | |
| 3189 | 3184 |
| 3190 // Check the marker in the calling frame. | 3185 // Check the marker in the calling frame. |
| 3191 __ bind(&check_frame_marker); | |
| 3192 __ ldr(r1, MemOperand(r2, StandardFrameConstants::kMarkerOffset)); | 3186 __ ldr(r1, MemOperand(r2, StandardFrameConstants::kMarkerOffset)); |
| 3193 __ cmp(r1, Operand(Smi::FromInt(StackFrame::CONSTRUCT))); | 3187 __ cmp(r1, Operand(Smi::FromInt(StackFrame::CONSTRUCT))); |
| 3194 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3188 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3195 Split(eq, if_true, if_false, fall_through); | 3189 Split(eq, if_true, if_false, fall_through); |
| 3196 | 3190 |
| 3197 context()->Plug(if_true, if_false); | 3191 context()->Plug(if_true, if_false); |
| 3198 } | 3192 } |
| 3199 | 3193 |
| 3200 | 3194 |
| 3201 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { | 3195 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 3232 __ mov(r1, r0); | 3226 __ mov(r1, r0); |
| 3233 __ mov(r0, Operand(Smi::FromInt(info_->scope()->num_parameters()))); | 3227 __ mov(r0, Operand(Smi::FromInt(info_->scope()->num_parameters()))); |
| 3234 ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT); | 3228 ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT); |
| 3235 __ CallStub(&stub); | 3229 __ CallStub(&stub); |
| 3236 context()->Plug(r0); | 3230 context()->Plug(r0); |
| 3237 } | 3231 } |
| 3238 | 3232 |
| 3239 | 3233 |
| 3240 void FullCodeGenerator::EmitArgumentsLength(CallRuntime* expr) { | 3234 void FullCodeGenerator::EmitArgumentsLength(CallRuntime* expr) { |
| 3241 ASSERT(expr->arguments()->length() == 0); | 3235 ASSERT(expr->arguments()->length() == 0); |
| 3242 Label exit; | 3236 |
| 3243 // Get the number of formal parameters. | 3237 // Get the number of formal parameters. |
| 3244 __ mov(r0, Operand(Smi::FromInt(info_->scope()->num_parameters()))); | 3238 __ mov(r0, Operand(Smi::FromInt(info_->scope()->num_parameters()))); |
| 3245 | 3239 |
| 3246 // Check if the calling frame is an arguments adaptor frame. | 3240 // Check if the calling frame is an arguments adaptor frame. |
| 3247 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 3241 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 3248 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset)); | 3242 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset)); |
| 3249 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 3243 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 3250 __ b(ne, &exit); | |
| 3251 | 3244 |
| 3252 // Arguments adaptor case: Read the arguments length from the | 3245 // Arguments adaptor case: Read the arguments length from the |
| 3253 // adaptor frame. | 3246 // adaptor frame. |
| 3254 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 3247 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset), eq); |
| 3255 | 3248 |
| 3256 __ bind(&exit); | |
| 3257 context()->Plug(r0); | 3249 context()->Plug(r0); |
| 3258 } | 3250 } |
| 3259 | 3251 |
| 3260 | 3252 |
| 3261 void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { | 3253 void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { |
| 3262 ZoneList<Expression*>* args = expr->arguments(); | 3254 ZoneList<Expression*>* args = expr->arguments(); |
| 3263 ASSERT(args->length() == 1); | 3255 ASSERT(args->length() == 1); |
| 3264 Label done, null, function, non_function_constructor; | 3256 Label done, null, function, non_function_constructor; |
| 3265 | 3257 |
| 3266 VisitForAccumulatorValue(args->at(0)); | 3258 VisitForAccumulatorValue(args->at(0)); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3371 void FullCodeGenerator::EmitValueOf(CallRuntime* expr) { | 3363 void FullCodeGenerator::EmitValueOf(CallRuntime* expr) { |
| 3372 ZoneList<Expression*>* args = expr->arguments(); | 3364 ZoneList<Expression*>* args = expr->arguments(); |
| 3373 ASSERT(args->length() == 1); | 3365 ASSERT(args->length() == 1); |
| 3374 VisitForAccumulatorValue(args->at(0)); // Load the object. | 3366 VisitForAccumulatorValue(args->at(0)); // Load the object. |
| 3375 | 3367 |
| 3376 Label done; | 3368 Label done; |
| 3377 // If the object is a smi return the object. | 3369 // If the object is a smi return the object. |
| 3378 __ JumpIfSmi(r0, &done); | 3370 __ JumpIfSmi(r0, &done); |
| 3379 // If the object is not a value type, return the object. | 3371 // If the object is not a value type, return the object. |
| 3380 __ CompareObjectType(r0, r1, r1, JS_VALUE_TYPE); | 3372 __ CompareObjectType(r0, r1, r1, JS_VALUE_TYPE); |
| 3381 __ b(ne, &done); | 3373 __ ldr(r0, FieldMemOperand(r0, JSValue::kValueOffset), eq); |
| 3382 __ ldr(r0, FieldMemOperand(r0, JSValue::kValueOffset)); | |
| 3383 | 3374 |
| 3384 __ bind(&done); | 3375 __ bind(&done); |
| 3385 context()->Plug(r0); | 3376 context()->Plug(r0); |
| 3386 } | 3377 } |
| 3387 | 3378 |
| 3388 | 3379 |
| 3389 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { | 3380 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { |
| 3390 ZoneList<Expression*>* args = expr->arguments(); | 3381 ZoneList<Expression*>* args = expr->arguments(); |
| 3391 ASSERT(args->length() == 2); | 3382 ASSERT(args->length() == 2); |
| 3392 ASSERT_NE(NULL, args->at(1)->AsLiteral()); | 3383 ASSERT_NE(NULL, args->at(1)->AsLiteral()); |
| (...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4913 ASSERT(Memory::uint32_at(interrupt_address_pointer) == | 4904 ASSERT(Memory::uint32_at(interrupt_address_pointer) == |
| 4914 reinterpret_cast<uint32_t>( | 4905 reinterpret_cast<uint32_t>( |
| 4915 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4906 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4916 return OSR_AFTER_STACK_CHECK; | 4907 return OSR_AFTER_STACK_CHECK; |
| 4917 } | 4908 } |
| 4918 | 4909 |
| 4919 | 4910 |
| 4920 } } // namespace v8::internal | 4911 } } // namespace v8::internal |
| 4921 | 4912 |
| 4922 #endif // V8_TARGET_ARCH_ARM | 4913 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |