OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 5440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5451 | 5451 |
5452 | 5452 |
5453 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 5453 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
5454 DCHECK(ToRegister(instr->context()).is(rsi)); | 5454 DCHECK(ToRegister(instr->context()).is(rsi)); |
5455 Label materialized; | 5455 Label materialized; |
5456 // Registers will be used as follows: | 5456 // Registers will be used as follows: |
5457 // rcx = literals array. | 5457 // rcx = literals array. |
5458 // rbx = regexp literal. | 5458 // rbx = regexp literal. |
5459 // rax = regexp literal clone. | 5459 // rax = regexp literal clone. |
5460 int literal_offset = | 5460 int literal_offset = |
5461 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); | 5461 LiteralsArray::OffsetOfLiteralAt(instr->hydrogen()->literal_index()); |
5462 __ Move(rcx, instr->hydrogen()->literals()); | 5462 __ Move(rcx, instr->hydrogen()->literals()); |
5463 __ movp(rbx, FieldOperand(rcx, literal_offset)); | 5463 __ movp(rbx, FieldOperand(rcx, literal_offset)); |
5464 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | 5464 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); |
5465 __ j(not_equal, &materialized, Label::kNear); | 5465 __ j(not_equal, &materialized, Label::kNear); |
5466 | 5466 |
5467 // Create regexp literal using runtime function | 5467 // Create regexp literal using runtime function |
5468 // Result will be in rax. | 5468 // Result will be in rax. |
5469 __ Push(rcx); | 5469 __ Push(rcx); |
5470 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); | 5470 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); |
5471 __ Push(instr->hydrogen()->pattern()); | 5471 __ Push(instr->hydrogen()->pattern()); |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5914 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5914 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5915 } | 5915 } |
5916 | 5916 |
5917 | 5917 |
5918 #undef __ | 5918 #undef __ |
5919 | 5919 |
5920 } // namespace internal | 5920 } // namespace internal |
5921 } // namespace v8 | 5921 } // namespace v8 |
5922 | 5922 |
5923 #endif // V8_TARGET_ARCH_X64 | 5923 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |