| 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 4239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4250 | 4250 |
| 4251 __ bind(&slowcase); | 4251 __ bind(&slowcase); |
| 4252 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); | 4252 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); |
| 4253 } | 4253 } |
| 4254 | 4254 |
| 4255 | 4255 |
| 4256 static void GenerateRecordCallTarget(MacroAssembler* masm) { | 4256 static void GenerateRecordCallTarget(MacroAssembler* masm) { |
| 4257 // Cache the called function in a global property cell. Cache states | 4257 // Cache the called function in a global property cell. Cache states |
| 4258 // are uninitialized, monomorphic (indicated by a JSFunction), and | 4258 // are uninitialized, monomorphic (indicated by a JSFunction), and |
| 4259 // megamorphic. | 4259 // megamorphic. |
| 4260 // r0 : number of arguments to the construct function |
| 4260 // r1 : the function to call | 4261 // r1 : the function to call |
| 4261 // r2 : cache cell for call target | 4262 // r2 : cache cell for call target |
| 4262 Label initialize, done, miss, megamorphic, not_array_function; | 4263 Label initialize, done, miss, megamorphic, not_array_function; |
| 4263 | 4264 |
| 4264 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), | 4265 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), |
| 4265 masm->isolate()->heap()->undefined_value()); | 4266 masm->isolate()->heap()->undefined_value()); |
| 4266 ASSERT_EQ(*TypeFeedbackCells::UninitializedSentinel(masm->isolate()), | 4267 ASSERT_EQ(*TypeFeedbackCells::UninitializedSentinel(masm->isolate()), |
| 4267 masm->isolate()->heap()->the_hole_value()); | 4268 masm->isolate()->heap()->the_hole_value()); |
| 4268 | 4269 |
| 4269 // Load the cache state into r3. | 4270 // Load the cache state into r3. |
| 4270 __ ldr(r3, FieldMemOperand(r2, Cell::kValueOffset)); | 4271 __ ldr(r3, FieldMemOperand(r2, Cell::kValueOffset)); |
| 4271 | 4272 |
| 4272 // A monomorphic cache hit or an already megamorphic state: invoke the | 4273 // A monomorphic cache hit or an already megamorphic state: invoke the |
| 4273 // function without changing the state. | 4274 // function without changing the state. |
| 4274 __ cmp(r3, r1); | 4275 __ cmp(r3, r1); |
| 4275 __ b(eq, &done); | 4276 __ b(eq, &done); |
| 4276 | 4277 |
| 4277 // If we came here, we need to see if we are the array function. | 4278 // If we came here, we need to see if we are the array function. |
| 4278 // If we didn't have a matching function, and we didn't find the megamorph | 4279 // If we didn't have a matching function, and we didn't find the megamorph |
| 4279 // sentinel, then we have in the cell either some other function or an | 4280 // sentinel, then we have in the cell either some other function or an |
| 4280 // AllocationSite. Do a map check on the object in ecx. | 4281 // AllocationSite. Do a map check on the object in ecx. |
| 4281 Handle<Map> allocation_site_map( | |
| 4282 masm->isolate()->heap()->allocation_site_map(), | |
| 4283 masm->isolate()); | |
| 4284 __ ldr(r5, FieldMemOperand(r3, 0)); | 4282 __ ldr(r5, FieldMemOperand(r3, 0)); |
| 4285 __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); | 4283 __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); |
| 4286 __ b(ne, &miss); | 4284 __ b(ne, &miss); |
| 4287 | 4285 |
| 4288 // Make sure the function is the Array() function | 4286 // Make sure the function is the Array() function |
| 4289 __ LoadArrayFunction(r3); | 4287 __ LoadArrayFunction(r3); |
| 4290 __ cmp(r1, r3); | 4288 __ cmp(r1, r3); |
| 4291 __ b(ne, &megamorphic); | 4289 __ b(ne, &megamorphic); |
| 4292 __ jmp(&done); | 4290 __ jmp(&done); |
| 4293 | 4291 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4310 // Make sure the function is the Array() function | 4308 // Make sure the function is the Array() function |
| 4311 __ LoadArrayFunction(r3); | 4309 __ LoadArrayFunction(r3); |
| 4312 __ cmp(r1, r3); | 4310 __ cmp(r1, r3); |
| 4313 __ b(ne, ¬_array_function); | 4311 __ b(ne, ¬_array_function); |
| 4314 | 4312 |
| 4315 // The target function is the Array constructor, | 4313 // The target function is the Array constructor, |
| 4316 // Create an AllocationSite if we don't already have it, store it in the cell | 4314 // Create an AllocationSite if we don't already have it, store it in the cell |
| 4317 { | 4315 { |
| 4318 FrameScope scope(masm, StackFrame::INTERNAL); | 4316 FrameScope scope(masm, StackFrame::INTERNAL); |
| 4319 | 4317 |
| 4318 // Arguments register must be smi-tagged to call out. |
| 4320 __ SmiTag(r0); | 4319 __ SmiTag(r0); |
| 4321 __ push(r0); | 4320 __ push(r0); |
| 4322 __ push(r1); | 4321 __ push(r1); |
| 4323 __ push(r2); | 4322 __ push(r2); |
| 4324 | 4323 |
| 4325 CreateAllocationSiteStub create_stub; | 4324 CreateAllocationSiteStub create_stub; |
| 4326 __ CallStub(&create_stub); | 4325 __ CallStub(&create_stub); |
| 4327 | 4326 |
| 4328 __ pop(r2); | 4327 __ pop(r2); |
| 4329 __ pop(r1); | 4328 __ pop(r1); |
| (...skipping 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7062 __ bind(&fast_elements_case); | 7061 __ bind(&fast_elements_case); |
| 7063 GenerateCase(masm, FAST_ELEMENTS); | 7062 GenerateCase(masm, FAST_ELEMENTS); |
| 7064 } | 7063 } |
| 7065 | 7064 |
| 7066 | 7065 |
| 7067 #undef __ | 7066 #undef __ |
| 7068 | 7067 |
| 7069 } } // namespace v8::internal | 7068 } } // namespace v8::internal |
| 7070 | 7069 |
| 7071 #endif // V8_TARGET_ARCH_ARM | 7070 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |