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 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 __ ldr(r1, GlobalObjectOperand()); | 2441 __ ldr(r1, GlobalObjectOperand()); |
2442 Handle<Code> ic = is_classic_mode() | 2442 Handle<Code> ic = is_classic_mode() |
2443 ? isolate()->builtins()->StoreIC_Initialize() | 2443 ? isolate()->builtins()->StoreIC_Initialize() |
2444 : isolate()->builtins()->StoreIC_Initialize_Strict(); | 2444 : isolate()->builtins()->StoreIC_Initialize_Strict(); |
2445 CallIC(ic, RelocInfo::CODE_TARGET_CONTEXT); | 2445 CallIC(ic, RelocInfo::CODE_TARGET_CONTEXT); |
2446 | 2446 |
2447 } else if (op == Token::INIT_CONST) { | 2447 } else if (op == Token::INIT_CONST) { |
2448 // Const initializers need a write barrier. | 2448 // Const initializers need a write barrier. |
2449 ASSERT(!var->IsParameter()); // No const parameters. | 2449 ASSERT(!var->IsParameter()); // No const parameters. |
2450 if (var->IsStackLocal()) { | 2450 if (var->IsStackLocal()) { |
2451 Label skip; | |
2452 __ ldr(r1, StackOperand(var)); | 2451 __ ldr(r1, StackOperand(var)); |
2453 __ CompareRoot(r1, Heap::kTheHoleValueRootIndex); | 2452 __ CompareRoot(r1, Heap::kTheHoleValueRootIndex); |
2454 __ b(ne, &skip); | 2453 __ str(result_register(), StackOperand(var), eq); |
2455 __ str(result_register(), StackOperand(var)); | |
2456 __ bind(&skip); | |
2457 } else { | 2454 } else { |
2458 ASSERT(var->IsContextSlot() || var->IsLookupSlot()); | 2455 ASSERT(var->IsContextSlot() || var->IsLookupSlot()); |
2459 // Like var declarations, const declarations are hoisted to function | 2456 // Like var declarations, const declarations are hoisted to function |
2460 // scope. However, unlike var initializers, const initializers are | 2457 // scope. However, unlike var initializers, const initializers are |
2461 // able to drill a hole to that function context, even from inside a | 2458 // able to drill a hole to that function context, even from inside a |
2462 // 'with' context. We thus bypass the normal static scope lookup for | 2459 // 'with' context. We thus bypass the normal static scope lookup for |
2463 // var->IsContextSlot(). | 2460 // var->IsContextSlot(). |
2464 __ push(r0); | 2461 __ push(r0); |
2465 __ mov(r0, Operand(var->name())); | 2462 __ mov(r0, Operand(var->name())); |
2466 __ Push(cp, r0); // Context and name. | 2463 __ Push(cp, r0); // Context and name. |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3183 Label* if_true = NULL; | 3180 Label* if_true = NULL; |
3184 Label* if_false = NULL; | 3181 Label* if_false = NULL; |
3185 Label* fall_through = NULL; | 3182 Label* fall_through = NULL; |
3186 context()->PrepareTest(&materialize_true, &materialize_false, | 3183 context()->PrepareTest(&materialize_true, &materialize_false, |
3187 &if_true, &if_false, &fall_through); | 3184 &if_true, &if_false, &fall_through); |
3188 | 3185 |
3189 // Get the frame pointer for the calling frame. | 3186 // Get the frame pointer for the calling frame. |
3190 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 3187 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
3191 | 3188 |
3192 // Skip the arguments adaptor frame if it exists. | 3189 // Skip the arguments adaptor frame if it exists. |
3193 Label check_frame_marker; | |
3194 __ ldr(r1, MemOperand(r2, StandardFrameConstants::kContextOffset)); | 3190 __ ldr(r1, MemOperand(r2, StandardFrameConstants::kContextOffset)); |
3195 __ cmp(r1, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 3191 __ cmp(r1, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
3196 __ b(ne, &check_frame_marker); | 3192 __ ldr(r2, MemOperand(r2, StandardFrameConstants::kCallerFPOffset), eq); |
3197 __ ldr(r2, MemOperand(r2, StandardFrameConstants::kCallerFPOffset)); | |
3198 | 3193 |
3199 // Check the marker in the calling frame. | 3194 // Check the marker in the calling frame. |
3200 __ bind(&check_frame_marker); | |
3201 __ ldr(r1, MemOperand(r2, StandardFrameConstants::kMarkerOffset)); | 3195 __ ldr(r1, MemOperand(r2, StandardFrameConstants::kMarkerOffset)); |
3202 __ cmp(r1, Operand(Smi::FromInt(StackFrame::CONSTRUCT))); | 3196 __ cmp(r1, Operand(Smi::FromInt(StackFrame::CONSTRUCT))); |
3203 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3197 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3204 Split(eq, if_true, if_false, fall_through); | 3198 Split(eq, if_true, if_false, fall_through); |
3205 | 3199 |
3206 context()->Plug(if_true, if_false); | 3200 context()->Plug(if_true, if_false); |
3207 } | 3201 } |
3208 | 3202 |
3209 | 3203 |
3210 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { | 3204 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { |
(...skipping 30 matching lines...) Expand all Loading... |
3241 __ mov(r1, r0); | 3235 __ mov(r1, r0); |
3242 __ mov(r0, Operand(Smi::FromInt(info_->scope()->num_parameters()))); | 3236 __ mov(r0, Operand(Smi::FromInt(info_->scope()->num_parameters()))); |
3243 ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT); | 3237 ArgumentsAccessStub stub(ArgumentsAccessStub::READ_ELEMENT); |
3244 __ CallStub(&stub); | 3238 __ CallStub(&stub); |
3245 context()->Plug(r0); | 3239 context()->Plug(r0); |
3246 } | 3240 } |
3247 | 3241 |
3248 | 3242 |
3249 void FullCodeGenerator::EmitArgumentsLength(CallRuntime* expr) { | 3243 void FullCodeGenerator::EmitArgumentsLength(CallRuntime* expr) { |
3250 ASSERT(expr->arguments()->length() == 0); | 3244 ASSERT(expr->arguments()->length() == 0); |
3251 Label exit; | 3245 |
3252 // Get the number of formal parameters. | 3246 // Get the number of formal parameters. |
3253 __ mov(r0, Operand(Smi::FromInt(info_->scope()->num_parameters()))); | 3247 __ mov(r0, Operand(Smi::FromInt(info_->scope()->num_parameters()))); |
3254 | 3248 |
3255 // Check if the calling frame is an arguments adaptor frame. | 3249 // Check if the calling frame is an arguments adaptor frame. |
3256 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 3250 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
3257 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset)); | 3251 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset)); |
3258 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 3252 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
3259 __ b(ne, &exit); | |
3260 | 3253 |
3261 // Arguments adaptor case: Read the arguments length from the | 3254 // Arguments adaptor case: Read the arguments length from the |
3262 // adaptor frame. | 3255 // adaptor frame. |
3263 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 3256 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset), eq); |
3264 | 3257 |
3265 __ bind(&exit); | |
3266 context()->Plug(r0); | 3258 context()->Plug(r0); |
3267 } | 3259 } |
3268 | 3260 |
3269 | 3261 |
3270 void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { | 3262 void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { |
3271 ZoneList<Expression*>* args = expr->arguments(); | 3263 ZoneList<Expression*>* args = expr->arguments(); |
3272 ASSERT(args->length() == 1); | 3264 ASSERT(args->length() == 1); |
3273 Label done, null, function, non_function_constructor; | 3265 Label done, null, function, non_function_constructor; |
3274 | 3266 |
3275 VisitForAccumulatorValue(args->at(0)); | 3267 VisitForAccumulatorValue(args->at(0)); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3380 void FullCodeGenerator::EmitValueOf(CallRuntime* expr) { | 3372 void FullCodeGenerator::EmitValueOf(CallRuntime* expr) { |
3381 ZoneList<Expression*>* args = expr->arguments(); | 3373 ZoneList<Expression*>* args = expr->arguments(); |
3382 ASSERT(args->length() == 1); | 3374 ASSERT(args->length() == 1); |
3383 VisitForAccumulatorValue(args->at(0)); // Load the object. | 3375 VisitForAccumulatorValue(args->at(0)); // Load the object. |
3384 | 3376 |
3385 Label done; | 3377 Label done; |
3386 // If the object is a smi return the object. | 3378 // If the object is a smi return the object. |
3387 __ JumpIfSmi(r0, &done); | 3379 __ JumpIfSmi(r0, &done); |
3388 // If the object is not a value type, return the object. | 3380 // If the object is not a value type, return the object. |
3389 __ CompareObjectType(r0, r1, r1, JS_VALUE_TYPE); | 3381 __ CompareObjectType(r0, r1, r1, JS_VALUE_TYPE); |
3390 __ b(ne, &done); | 3382 __ ldr(r0, FieldMemOperand(r0, JSValue::kValueOffset), eq); |
3391 __ ldr(r0, FieldMemOperand(r0, JSValue::kValueOffset)); | |
3392 | 3383 |
3393 __ bind(&done); | 3384 __ bind(&done); |
3394 context()->Plug(r0); | 3385 context()->Plug(r0); |
3395 } | 3386 } |
3396 | 3387 |
3397 | 3388 |
3398 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { | 3389 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { |
3399 ZoneList<Expression*>* args = expr->arguments(); | 3390 ZoneList<Expression*>* args = expr->arguments(); |
3400 ASSERT(args->length() == 2); | 3391 ASSERT(args->length() == 2); |
3401 ASSERT_NE(NULL, args->at(1)->AsLiteral()); | 3392 ASSERT_NE(NULL, args->at(1)->AsLiteral()); |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4920 ASSERT(Memory::uint32_at(interrupt_address_pointer) == | 4911 ASSERT(Memory::uint32_at(interrupt_address_pointer) == |
4921 reinterpret_cast<uint32_t>( | 4912 reinterpret_cast<uint32_t>( |
4922 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4913 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4923 return OSR_AFTER_STACK_CHECK; | 4914 return OSR_AFTER_STACK_CHECK; |
4924 } | 4915 } |
4925 | 4916 |
4926 | 4917 |
4927 } } // namespace v8::internal | 4918 } } // namespace v8::internal |
4928 | 4919 |
4929 #endif // V8_TARGET_ARCH_ARM | 4920 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |