OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 5262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5273 | 5273 |
5274 | 5274 |
5275 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 5275 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
5276 DCHECK(ToRegister(instr->context()).is(esi)); | 5276 DCHECK(ToRegister(instr->context()).is(esi)); |
5277 Label materialized; | 5277 Label materialized; |
5278 // Registers will be used as follows: | 5278 // Registers will be used as follows: |
5279 // ecx = literals array. | 5279 // ecx = literals array. |
5280 // ebx = regexp literal. | 5280 // ebx = regexp literal. |
5281 // eax = regexp literal clone. | 5281 // eax = regexp literal clone. |
5282 // esi = context. | 5282 // esi = context. |
5283 int literal_offset = | 5283 int literal_offset = LiteralsArray::OffsetOfElementAt( |
5284 FixedArray::OffsetOfElementAt(instr->hydrogen()->literal_index()); | 5284 instr->hydrogen()->literal_index() + LiteralsArray::kFirstLiteralIndex); |
Igor Sheludko
2015/09/28 15:16:46
Shouldn't " + LiteralsArray::kFirstLiteralIndex" b
| |
5285 __ LoadHeapObject(ecx, instr->hydrogen()->literals()); | 5285 __ LoadHeapObject(ecx, instr->hydrogen()->literals()); |
5286 __ mov(ebx, FieldOperand(ecx, literal_offset)); | 5286 __ mov(ebx, FieldOperand(ecx, literal_offset)); |
5287 __ cmp(ebx, factory()->undefined_value()); | 5287 __ cmp(ebx, factory()->undefined_value()); |
5288 __ j(not_equal, &materialized, Label::kNear); | 5288 __ j(not_equal, &materialized, Label::kNear); |
5289 | 5289 |
5290 // Create regexp literal using runtime function | 5290 // Create regexp literal using runtime function |
5291 // Result will be in eax. | 5291 // Result will be in eax. |
5292 __ push(ecx); | 5292 __ push(ecx); |
5293 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); | 5293 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); |
5294 __ push(Immediate(instr->hydrogen()->pattern())); | 5294 __ push(Immediate(instr->hydrogen()->pattern())); |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5723 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5723 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5724 } | 5724 } |
5725 | 5725 |
5726 | 5726 |
5727 #undef __ | 5727 #undef __ |
5728 | 5728 |
5729 } // namespace internal | 5729 } // namespace internal |
5730 } // namespace v8 | 5730 } // namespace v8 |
5731 | 5731 |
5732 #endif // V8_TARGET_ARCH_IA32 | 5732 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |