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 4406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4417 | 4417 |
4418 __ bind(&slowcase); | 4418 __ bind(&slowcase); |
4419 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); | 4419 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); |
4420 } | 4420 } |
4421 | 4421 |
4422 | 4422 |
4423 static void GenerateRecordCallTarget(MacroAssembler* masm) { | 4423 static void GenerateRecordCallTarget(MacroAssembler* masm) { |
4424 // Cache the called function in a global property cell. Cache states | 4424 // Cache the called function in a global property cell. Cache states |
4425 // are uninitialized, monomorphic (indicated by a JSFunction), and | 4425 // are uninitialized, monomorphic (indicated by a JSFunction), and |
4426 // megamorphic. | 4426 // megamorphic. |
| 4427 // a0 : number of arguments to the construct function |
4427 // a1 : the function to call | 4428 // a1 : the function to call |
4428 // a2 : cache cell for call target | 4429 // a2 : cache cell for call target |
4429 Label initialize, done, miss, megamorphic, not_array_function; | 4430 Label initialize, done, miss, megamorphic, not_array_function; |
4430 | 4431 |
4431 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), | 4432 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), |
4432 masm->isolate()->heap()->undefined_value()); | 4433 masm->isolate()->heap()->undefined_value()); |
4433 ASSERT_EQ(*TypeFeedbackCells::UninitializedSentinel(masm->isolate()), | 4434 ASSERT_EQ(*TypeFeedbackCells::UninitializedSentinel(masm->isolate()), |
4434 masm->isolate()->heap()->the_hole_value()); | 4435 masm->isolate()->heap()->the_hole_value()); |
4435 | 4436 |
4436 // Load the cache state into a3. | 4437 // Load the cache state into a3. |
4437 __ lw(a3, FieldMemOperand(a2, Cell::kValueOffset)); | 4438 __ lw(a3, FieldMemOperand(a2, Cell::kValueOffset)); |
4438 | 4439 |
4439 // A monomorphic cache hit or an already megamorphic state: invoke the | 4440 // A monomorphic cache hit or an already megamorphic state: invoke the |
4440 // function without changing the state. | 4441 // function without changing the state. |
4441 __ Branch(&done, eq, a3, Operand(a1)); | 4442 __ Branch(&done, eq, a3, Operand(a1)); |
4442 | 4443 |
4443 // If we came here, we need to see if we are the array function. | 4444 // If we came here, we need to see if we are the array function. |
4444 // If we didn't have a matching function, and we didn't find the megamorph | 4445 // If we didn't have a matching function, and we didn't find the megamorph |
4445 // sentinel, then we have in the cell either some other function or an | 4446 // sentinel, then we have in the cell either some other function or an |
4446 // AllocationSite. Do a map check on the object in a3. | 4447 // AllocationSite. Do a map check on the object in a3. |
4447 Handle<Map> allocation_site_map( | |
4448 masm->isolate()->heap()->allocation_site_map(), | |
4449 masm->isolate()); | |
4450 __ lw(t1, FieldMemOperand(a3, 0)); | 4448 __ lw(t1, FieldMemOperand(a3, 0)); |
4451 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); | 4449 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); |
4452 __ Branch(&miss, ne, t1, Operand(at)); | 4450 __ Branch(&miss, ne, t1, Operand(at)); |
4453 | 4451 |
4454 // Make sure the function is the Array() function | 4452 // Make sure the function is the Array() function |
4455 __ LoadArrayFunction(a3); | 4453 __ LoadArrayFunction(a3); |
4456 __ Branch(&megamorphic, ne, a1, Operand(a3)); | 4454 __ Branch(&megamorphic, ne, a1, Operand(a3)); |
4457 __ jmp(&done); | 4455 __ jmp(&done); |
4458 | 4456 |
4459 __ bind(&miss); | 4457 __ bind(&miss); |
(...skipping 18 matching lines...) Expand all Loading... |
4478 | 4476 |
4479 // The target function is the Array constructor. | 4477 // The target function is the Array constructor. |
4480 // Create an AllocationSite if we don't already have it, store it in the cell. | 4478 // Create an AllocationSite if we don't already have it, store it in the cell. |
4481 { | 4479 { |
4482 FrameScope scope(masm, StackFrame::INTERNAL); | 4480 FrameScope scope(masm, StackFrame::INTERNAL); |
4483 const RegList kSavedRegs = | 4481 const RegList kSavedRegs = |
4484 1 << 4 | // a0 | 4482 1 << 4 | // a0 |
4485 1 << 5 | // a1 | 4483 1 << 5 | // a1 |
4486 1 << 6; // a2 | 4484 1 << 6; // a2 |
4487 | 4485 |
| 4486 // Arguments register must be smi-tagged to call out. |
4488 __ SmiTag(a0); | 4487 __ SmiTag(a0); |
4489 __ MultiPush(kSavedRegs); | 4488 __ MultiPush(kSavedRegs); |
4490 | 4489 |
4491 CreateAllocationSiteStub create_stub; | 4490 CreateAllocationSiteStub create_stub; |
4492 __ CallStub(&create_stub); | 4491 __ CallStub(&create_stub); |
4493 | 4492 |
4494 __ MultiPop(kSavedRegs); | 4493 __ MultiPop(kSavedRegs); |
4495 __ SmiUntag(a0); | 4494 __ SmiUntag(a0); |
4496 } | 4495 } |
4497 __ Branch(&done); | 4496 __ Branch(&done); |
(...skipping 2783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7281 __ bind(&fast_elements_case); | 7280 __ bind(&fast_elements_case); |
7282 GenerateCase(masm, FAST_ELEMENTS); | 7281 GenerateCase(masm, FAST_ELEMENTS); |
7283 } | 7282 } |
7284 | 7283 |
7285 | 7284 |
7286 #undef __ | 7285 #undef __ |
7287 | 7286 |
7288 } } // namespace v8::internal | 7287 } } // namespace v8::internal |
7289 | 7288 |
7290 #endif // V8_TARGET_ARCH_MIPS | 7289 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |