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 4612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4623 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 4623 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
4624 ASSERT(ToRegister(instr->InputAt(0)).is(rax)); | 4624 ASSERT(ToRegister(instr->InputAt(0)).is(rax)); |
4625 __ push(rax); | 4625 __ push(rax); |
4626 CallRuntime(Runtime::kToFastProperties, 1, instr); | 4626 CallRuntime(Runtime::kToFastProperties, 1, instr); |
4627 } | 4627 } |
4628 | 4628 |
4629 | 4629 |
4630 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 4630 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
4631 Label materialized; | 4631 Label materialized; |
4632 // Registers will be used as follows: | 4632 // Registers will be used as follows: |
4633 // rdi = JS function. | |
4634 // rcx = literals array. | 4633 // rcx = literals array. |
4635 // rbx = regexp literal. | 4634 // rbx = regexp literal. |
4636 // rax = regexp literal clone. | 4635 // rax = regexp literal clone. |
4637 __ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 4636 int literal_offset = |
4638 __ movq(rcx, FieldOperand(rdi, JSFunction::kLiteralsOffset)); | 4637 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); |
4639 int literal_offset = FixedArray::kHeaderSize + | 4638 __ LoadHeapObject(rcx, instr->hydrogen()->literals()); |
4640 instr->hydrogen()->literal_index() * kPointerSize; | |
4641 __ movq(rbx, FieldOperand(rcx, literal_offset)); | 4639 __ movq(rbx, FieldOperand(rcx, literal_offset)); |
4642 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | 4640 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); |
4643 __ j(not_equal, &materialized, Label::kNear); | 4641 __ j(not_equal, &materialized, Label::kNear); |
4644 | 4642 |
4645 // Create regexp literal using runtime function | 4643 // Create regexp literal using runtime function |
4646 // Result will be in rax. | 4644 // Result will be in rax. |
4647 __ push(rcx); | 4645 __ push(rcx); |
4648 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); | 4646 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); |
4649 __ Push(instr->hydrogen()->pattern()); | 4647 __ Push(instr->hydrogen()->pattern()); |
4650 __ Push(instr->hydrogen()->flags()); | 4648 __ Push(instr->hydrogen()->flags()); |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5048 FixedArray::kHeaderSize - kPointerSize)); | 5046 FixedArray::kHeaderSize - kPointerSize)); |
5049 __ bind(&done); | 5047 __ bind(&done); |
5050 } | 5048 } |
5051 | 5049 |
5052 | 5050 |
5053 #undef __ | 5051 #undef __ |
5054 | 5052 |
5055 } } // namespace v8::internal | 5053 } } // namespace v8::internal |
5056 | 5054 |
5057 #endif // V8_TARGET_ARCH_X64 | 5055 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |