| 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 4322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4333 | 4333 |
| 4334 __ bind(&slowcase); | 4334 __ bind(&slowcase); |
| 4335 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); | 4335 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); |
| 4336 } | 4336 } |
| 4337 | 4337 |
| 4338 | 4338 |
| 4339 static void GenerateRecordCallTarget(MacroAssembler* masm) { | 4339 static void GenerateRecordCallTarget(MacroAssembler* masm) { |
| 4340 // Cache the called function in a global property cell. Cache states | 4340 // Cache the called function in a global property cell. Cache states |
| 4341 // are uninitialized, monomorphic (indicated by a JSFunction), and | 4341 // are uninitialized, monomorphic (indicated by a JSFunction), and |
| 4342 // megamorphic. | 4342 // megamorphic. |
| 4343 // a0 : number of arguments to the construct function |
| 4343 // a1 : the function to call | 4344 // a1 : the function to call |
| 4344 // a2 : cache cell for call target | 4345 // a2 : cache cell for call target |
| 4345 Label initialize, done, miss, megamorphic, not_array_function; | 4346 Label initialize, done, miss, megamorphic, not_array_function; |
| 4346 | 4347 |
| 4347 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), | 4348 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), |
| 4348 masm->isolate()->heap()->undefined_value()); | 4349 masm->isolate()->heap()->undefined_value()); |
| 4349 ASSERT_EQ(*TypeFeedbackCells::UninitializedSentinel(masm->isolate()), | 4350 ASSERT_EQ(*TypeFeedbackCells::UninitializedSentinel(masm->isolate()), |
| 4350 masm->isolate()->heap()->the_hole_value()); | 4351 masm->isolate()->heap()->the_hole_value()); |
| 4351 | 4352 |
| 4352 // Load the cache state into a3. | 4353 // Load the cache state into a3. |
| 4353 __ lw(a3, FieldMemOperand(a2, Cell::kValueOffset)); | 4354 __ lw(a3, FieldMemOperand(a2, Cell::kValueOffset)); |
| 4354 | 4355 |
| 4355 // A monomorphic cache hit or an already megamorphic state: invoke the | 4356 // A monomorphic cache hit or an already megamorphic state: invoke the |
| 4356 // function without changing the state. | 4357 // function without changing the state. |
| 4357 __ Branch(&done, eq, a3, Operand(a1)); | 4358 __ Branch(&done, eq, a3, Operand(a1)); |
| 4358 | 4359 |
| 4359 // If we came here, we need to see if we are the array function. | 4360 // If we came here, we need to see if we are the array function. |
| 4360 // If we didn't have a matching function, and we didn't find the megamorph | 4361 // If we didn't have a matching function, and we didn't find the megamorph |
| 4361 // sentinel, then we have in the cell either some other function or an | 4362 // sentinel, then we have in the cell either some other function or an |
| 4362 // AllocationSite. Do a map check on the object in a3. | 4363 // AllocationSite. Do a map check on the object in a3. |
| 4363 Handle<Map> allocation_site_map( | |
| 4364 masm->isolate()->heap()->allocation_site_map(), | |
| 4365 masm->isolate()); | |
| 4366 __ lw(t1, FieldMemOperand(a3, 0)); | 4364 __ lw(t1, FieldMemOperand(a3, 0)); |
| 4367 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); | 4365 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); |
| 4368 __ Branch(&miss, ne, t1, Operand(at)); | 4366 __ Branch(&miss, ne, t1, Operand(at)); |
| 4369 | 4367 |
| 4370 // Make sure the function is the Array() function | 4368 // Make sure the function is the Array() function |
| 4371 __ LoadArrayFunction(a3); | 4369 __ LoadArrayFunction(a3); |
| 4372 __ Branch(&megamorphic, ne, a1, Operand(a3)); | 4370 __ Branch(&megamorphic, ne, a1, Operand(a3)); |
| 4373 __ jmp(&done); | 4371 __ jmp(&done); |
| 4374 | 4372 |
| 4375 __ bind(&miss); | 4373 __ bind(&miss); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 4394 | 4392 |
| 4395 // The target function is the Array constructor. | 4393 // The target function is the Array constructor. |
| 4396 // Create an AllocationSite if we don't already have it, store it in the cell. | 4394 // Create an AllocationSite if we don't already have it, store it in the cell. |
| 4397 { | 4395 { |
| 4398 FrameScope scope(masm, StackFrame::INTERNAL); | 4396 FrameScope scope(masm, StackFrame::INTERNAL); |
| 4399 const RegList kSavedRegs = | 4397 const RegList kSavedRegs = |
| 4400 1 << 4 | // a0 | 4398 1 << 4 | // a0 |
| 4401 1 << 5 | // a1 | 4399 1 << 5 | // a1 |
| 4402 1 << 6; // a2 | 4400 1 << 6; // a2 |
| 4403 | 4401 |
| 4402 // Arguments register must be smi-tagged to call out. |
| 4404 __ SmiTag(a0); | 4403 __ SmiTag(a0); |
| 4405 __ MultiPush(kSavedRegs); | 4404 __ MultiPush(kSavedRegs); |
| 4406 | 4405 |
| 4407 CreateAllocationSiteStub create_stub; | 4406 CreateAllocationSiteStub create_stub; |
| 4408 __ CallStub(&create_stub); | 4407 __ CallStub(&create_stub); |
| 4409 | 4408 |
| 4410 __ MultiPop(kSavedRegs); | 4409 __ MultiPop(kSavedRegs); |
| 4411 __ SmiUntag(a0); | 4410 __ SmiUntag(a0); |
| 4412 } | 4411 } |
| 4413 __ Branch(&done); | 4412 __ Branch(&done); |
| (...skipping 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7191 __ bind(&fast_elements_case); | 7190 __ bind(&fast_elements_case); |
| 7192 GenerateCase(masm, FAST_ELEMENTS); | 7191 GenerateCase(masm, FAST_ELEMENTS); |
| 7193 } | 7192 } |
| 7194 | 7193 |
| 7195 | 7194 |
| 7196 #undef __ | 7195 #undef __ |
| 7197 | 7196 |
| 7198 } } // namespace v8::internal | 7197 } } // namespace v8::internal |
| 7199 | 7198 |
| 7200 #endif // V8_TARGET_ARCH_MIPS | 7199 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |