OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2852 // After shadowing stops, the original labels are unshadowed and the | 2852 // After shadowing stops, the original labels are unshadowed and the |
2853 // LabelShadows represent the formerly shadowing labels. | 2853 // LabelShadows represent the formerly shadowing labels. |
2854 bool has_unlinks = false; | 2854 bool has_unlinks = false; |
2855 for (int i = 0; i < shadows.length(); i++) { | 2855 for (int i = 0; i < shadows.length(); i++) { |
2856 shadows[i]->StopShadowing(); | 2856 shadows[i]->StopShadowing(); |
2857 has_unlinks = has_unlinks || shadows[i]->is_linked(); | 2857 has_unlinks = has_unlinks || shadows[i]->is_linked(); |
2858 } | 2858 } |
2859 function_return_is_shadowed_ = function_return_was_shadowed; | 2859 function_return_is_shadowed_ = function_return_was_shadowed; |
2860 | 2860 |
2861 // Get an external reference to the handler address. | 2861 // Get an external reference to the handler address. |
2862 ExternalReference handler_address(Isolate::k_handler_address); | 2862 ExternalReference handler_address(Isolate::k_handler_address, isolate()); |
2863 | 2863 |
2864 // If we can fall off the end of the try block, unlink from try chain. | 2864 // If we can fall off the end of the try block, unlink from try chain. |
2865 if (has_valid_frame()) { | 2865 if (has_valid_frame()) { |
2866 // The next handler address is on top of the frame. Unlink from | 2866 // The next handler address is on top of the frame. Unlink from |
2867 // the handler list and drop the rest of this handler from the | 2867 // the handler list and drop the rest of this handler from the |
2868 // frame. | 2868 // frame. |
2869 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 2869 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
2870 frame_->EmitPop(r1); // r0 can contain the return value. | 2870 frame_->EmitPop(r1); // r0 can contain the return value. |
2871 __ mov(r3, Operand(handler_address)); | 2871 __ mov(r3, Operand(handler_address)); |
2872 __ str(r1, MemOperand(r3)); | 2872 __ str(r1, MemOperand(r3)); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2968 // After shadowing stops, the original labels are unshadowed and the | 2968 // After shadowing stops, the original labels are unshadowed and the |
2969 // LabelShadows represent the formerly shadowing labels. | 2969 // LabelShadows represent the formerly shadowing labels. |
2970 int nof_unlinks = 0; | 2970 int nof_unlinks = 0; |
2971 for (int i = 0; i < shadows.length(); i++) { | 2971 for (int i = 0; i < shadows.length(); i++) { |
2972 shadows[i]->StopShadowing(); | 2972 shadows[i]->StopShadowing(); |
2973 if (shadows[i]->is_linked()) nof_unlinks++; | 2973 if (shadows[i]->is_linked()) nof_unlinks++; |
2974 } | 2974 } |
2975 function_return_is_shadowed_ = function_return_was_shadowed; | 2975 function_return_is_shadowed_ = function_return_was_shadowed; |
2976 | 2976 |
2977 // Get an external reference to the handler address. | 2977 // Get an external reference to the handler address. |
2978 ExternalReference handler_address(Isolate::k_handler_address); | 2978 ExternalReference handler_address(Isolate::k_handler_address, isolate()); |
2979 | 2979 |
2980 // If we can fall off the end of the try block, unlink from the try | 2980 // If we can fall off the end of the try block, unlink from the try |
2981 // chain and set the state on the frame to FALLING. | 2981 // chain and set the state on the frame to FALLING. |
2982 if (has_valid_frame()) { | 2982 if (has_valid_frame()) { |
2983 // The next handler address is on top of the frame. | 2983 // The next handler address is on top of the frame. |
2984 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 2984 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
2985 frame_->EmitPop(r1); | 2985 frame_->EmitPop(r1); |
2986 __ mov(r3, Operand(handler_address)); | 2986 __ mov(r3, Operand(handler_address)); |
2987 __ str(r1, MemOperand(r3)); | 2987 __ str(r1, MemOperand(r3)); |
2988 frame_->Drop(StackHandlerConstants::kSize / kPointerSize - 1); | 2988 frame_->Drop(StackHandlerConstants::kSize / kPointerSize - 1); |
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5354 __ CallRuntime(Runtime::kNumberAlloc, 0); | 5354 __ CallRuntime(Runtime::kNumberAlloc, 0); |
5355 __ mov(r4, Operand(r0)); | 5355 __ mov(r4, Operand(r0)); |
5356 | 5356 |
5357 __ bind(&heapnumber_allocated); | 5357 __ bind(&heapnumber_allocated); |
5358 | 5358 |
5359 // Convert 32 random bits in r0 to 0.(32 random bits) in a double | 5359 // Convert 32 random bits in r0 to 0.(32 random bits) in a double |
5360 // by computing: | 5360 // by computing: |
5361 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 5361 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
5362 if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) { | 5362 if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) { |
5363 __ PrepareCallCFunction(0, r1); | 5363 __ PrepareCallCFunction(0, r1); |
5364 __ CallCFunction(ExternalReference::random_uint32_function(), 0); | 5364 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 0); |
5365 | 5365 |
5366 CpuFeatures::Scope scope(VFP3); | 5366 CpuFeatures::Scope scope(VFP3); |
5367 // 0x41300000 is the top half of 1.0 x 2^20 as a double. | 5367 // 0x41300000 is the top half of 1.0 x 2^20 as a double. |
5368 // Create this constant using mov/orr to avoid PC relative load. | 5368 // Create this constant using mov/orr to avoid PC relative load. |
5369 __ mov(r1, Operand(0x41000000)); | 5369 __ mov(r1, Operand(0x41000000)); |
5370 __ orr(r1, r1, Operand(0x300000)); | 5370 __ orr(r1, r1, Operand(0x300000)); |
5371 // Move 0x41300000xxxxxxxx (x = random bits) to VFP. | 5371 // Move 0x41300000xxxxxxxx (x = random bits) to VFP. |
5372 __ vmov(d7, r0, r1); | 5372 __ vmov(d7, r0, r1); |
5373 // Move 0x4130000000000000 to VFP. | 5373 // Move 0x4130000000000000 to VFP. |
5374 __ mov(r0, Operand(0, RelocInfo::NONE)); | 5374 __ mov(r0, Operand(0, RelocInfo::NONE)); |
5375 __ vmov(d8, r0, r1); | 5375 __ vmov(d8, r0, r1); |
5376 // Subtract and store the result in the heap number. | 5376 // Subtract and store the result in the heap number. |
5377 __ vsub(d7, d7, d8); | 5377 __ vsub(d7, d7, d8); |
5378 __ sub(r0, r4, Operand(kHeapObjectTag)); | 5378 __ sub(r0, r4, Operand(kHeapObjectTag)); |
5379 __ vstr(d7, r0, HeapNumber::kValueOffset); | 5379 __ vstr(d7, r0, HeapNumber::kValueOffset); |
5380 frame_->EmitPush(r4); | 5380 frame_->EmitPush(r4); |
5381 } else { | 5381 } else { |
5382 __ mov(r0, Operand(r4)); | 5382 __ mov(r0, Operand(r4)); |
5383 __ PrepareCallCFunction(1, r1); | 5383 __ PrepareCallCFunction(1, r1); |
5384 __ CallCFunction( | 5384 __ CallCFunction( |
5385 ExternalReference::fill_heap_number_with_random_function(), 1); | 5385 ExternalReference::fill_heap_number_with_random_function(isolate()), 1); |
5386 frame_->EmitPush(r0); | 5386 frame_->EmitPush(r0); |
5387 } | 5387 } |
5388 } | 5388 } |
5389 | 5389 |
5390 | 5390 |
5391 void CodeGenerator::GenerateStringAdd(ZoneList<Expression*>* args) { | 5391 void CodeGenerator::GenerateStringAdd(ZoneList<Expression*>* args) { |
5392 ASSERT_EQ(2, args->length()); | 5392 ASSERT_EQ(2, args->length()); |
5393 | 5393 |
5394 Load(args->at(0)); | 5394 Load(args->at(0)); |
5395 Load(args->at(1)); | 5395 Load(args->at(1)); |
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7197 deferred->Branch(eq); | 7197 deferred->Branch(eq); |
7198 | 7198 |
7199 // Check that the receiver is a JSArray. | 7199 // Check that the receiver is a JSArray. |
7200 __ CompareObjectType(receiver, scratch1, scratch1, JS_ARRAY_TYPE); | 7200 __ CompareObjectType(receiver, scratch1, scratch1, JS_ARRAY_TYPE); |
7201 deferred->Branch(ne); | 7201 deferred->Branch(ne); |
7202 | 7202 |
7203 // Get the elements array from the receiver. | 7203 // Get the elements array from the receiver. |
7204 __ ldr(scratch1, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 7204 __ ldr(scratch1, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
7205 if (!value_is_harmless && wb_info != LIKELY_SMI) { | 7205 if (!value_is_harmless && wb_info != LIKELY_SMI) { |
7206 Label ok; | 7206 Label ok; |
7207 __ and_(scratch2, scratch1, Operand(ExternalReference::new_space_mask())); | 7207 __ and_(scratch2, |
7208 __ cmp(scratch2, Operand(ExternalReference::new_space_start())); | 7208 scratch1, |
| 7209 Operand(ExternalReference::new_space_mask(isolate()))); |
| 7210 __ cmp(scratch2, Operand(ExternalReference::new_space_start(isolate()))); |
7209 __ tst(value, Operand(kSmiTagMask), ne); | 7211 __ tst(value, Operand(kSmiTagMask), ne); |
7210 deferred->Branch(ne); | 7212 deferred->Branch(ne); |
7211 #ifdef DEBUG | 7213 #ifdef DEBUG |
7212 we_remembered_the_write_barrier = true; | 7214 we_remembered_the_write_barrier = true; |
7213 #endif | 7215 #endif |
7214 } | 7216 } |
7215 // Check that the elements array is not a dictionary. | 7217 // Check that the elements array is not a dictionary. |
7216 __ ldr(scratch2, FieldMemOperand(scratch1, JSObject::kMapOffset)); | 7218 __ ldr(scratch2, FieldMemOperand(scratch1, JSObject::kMapOffset)); |
7217 | 7219 |
7218 // The following instructions are the part of the inlined store keyed | 7220 // The following instructions are the part of the inlined store keyed |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7418 specialized_on_rhs_ ? "_ConstantRhs" : "", | 7420 specialized_on_rhs_ ? "_ConstantRhs" : "", |
7419 BinaryOpIC::GetName(runtime_operands_type_)); | 7421 BinaryOpIC::GetName(runtime_operands_type_)); |
7420 return name_; | 7422 return name_; |
7421 } | 7423 } |
7422 | 7424 |
7423 #undef __ | 7425 #undef __ |
7424 | 7426 |
7425 } } // namespace v8::internal | 7427 } } // namespace v8::internal |
7426 | 7428 |
7427 #endif // V8_TARGET_ARCH_ARM | 7429 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |