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 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2413 | 2413 |
2414 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 2414 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
2415 LParameter* result = new(zone()) LParameter; | 2415 LParameter* result = new(zone()) LParameter; |
2416 if (instr->kind() == HParameter::STACK_PARAMETER) { | 2416 if (instr->kind() == HParameter::STACK_PARAMETER) { |
2417 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 2417 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
2418 return DefineAsSpilled(result, spill_index); | 2418 return DefineAsSpilled(result, spill_index); |
2419 } else { | 2419 } else { |
2420 ASSERT(info()->IsStub()); | 2420 ASSERT(info()->IsStub()); |
2421 CodeStubInterfaceDescriptor* descriptor = | 2421 CodeStubInterfaceDescriptor* descriptor = |
2422 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); | 2422 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); |
2423 Register reg = descriptor->register_params_[instr->index()]; | 2423 Register reg; |
| 2424 if (static_cast<int>(instr->index()) == descriptor->register_param_count_) { |
| 2425 reg = *(descriptor->stack_parameter_count_); |
| 2426 } else { |
| 2427 reg = descriptor->register_params_[instr->index()]; |
| 2428 } |
2424 return DefineFixed(result, reg); | 2429 return DefineFixed(result, reg); |
2425 } | 2430 } |
2426 } | 2431 } |
2427 | 2432 |
2428 | 2433 |
2429 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2434 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
2430 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. | 2435 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. |
2431 if (spill_index > LUnallocated::kMaxFixedIndex) { | 2436 if (spill_index > LUnallocated::kMaxFixedIndex) { |
2432 Abort("Too many spill slots needed for OSR"); | 2437 Abort("Too many spill slots needed for OSR"); |
2433 spill_index = 0; | 2438 spill_index = 0; |
(...skipping 12 matching lines...) Expand all Loading... |
2446 // There are no real uses of the arguments object. | 2451 // There are no real uses of the arguments object. |
2447 // arguments.length and element access are supported directly on | 2452 // arguments.length and element access are supported directly on |
2448 // stack arguments, and any real arguments object use causes a bailout. | 2453 // stack arguments, and any real arguments object use causes a bailout. |
2449 // So this value is never used. | 2454 // So this value is never used. |
2450 return NULL; | 2455 return NULL; |
2451 } | 2456 } |
2452 | 2457 |
2453 | 2458 |
2454 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { | 2459 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { |
2455 LOperand* args = UseRegister(instr->arguments()); | 2460 LOperand* args = UseRegister(instr->arguments()); |
2456 LOperand* length = UseTempRegister(instr->length()); | 2461 LOperand* length; |
2457 LOperand* index = UseRegister(instr->index()); | 2462 LOperand* index; |
| 2463 if (instr->length()->IsConstant() && instr->index()->IsConstant()) { |
| 2464 length = UseRegisterOrConstant(instr->length()); |
| 2465 index = UseOrConstant(instr->index()); |
| 2466 } else { |
| 2467 length = UseTempRegister(instr->length()); |
| 2468 index = Use(instr->index()); |
| 2469 } |
2458 return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); | 2470 return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); |
2459 } | 2471 } |
2460 | 2472 |
2461 | 2473 |
2462 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { | 2474 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { |
2463 LOperand* object = UseFixed(instr->value(), r0); | 2475 LOperand* object = UseFixed(instr->value(), r0); |
2464 LToFastProperties* result = new(zone()) LToFastProperties(object); | 2476 LToFastProperties* result = new(zone()) LToFastProperties(object); |
2465 return MarkAsCall(DefineFixed(result, r0), instr); | 2477 return MarkAsCall(DefineFixed(result, r0), instr); |
2466 } | 2478 } |
2467 | 2479 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 | 2606 |
2595 | 2607 |
2596 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2608 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2597 LOperand* object = UseRegister(instr->object()); | 2609 LOperand* object = UseRegister(instr->object()); |
2598 LOperand* index = UseRegister(instr->index()); | 2610 LOperand* index = UseRegister(instr->index()); |
2599 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2611 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2600 } | 2612 } |
2601 | 2613 |
2602 | 2614 |
2603 } } // namespace v8::internal | 2615 } } // namespace v8::internal |
OLD | NEW |