| 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1446 void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { | 1446 void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { |
| 1447 Comment cmnt(masm_, "[ RegExpLiteral"); | 1447 Comment cmnt(masm_, "[ RegExpLiteral"); |
| 1448 Label materialized; | 1448 Label materialized; |
| 1449 // Registers will be used as follows: | 1449 // Registers will be used as follows: |
| 1450 // rdi = JS function. | 1450 // rdi = JS function. |
| 1451 // rcx = literals array. | 1451 // rcx = literals array. |
| 1452 // rbx = regexp literal. | 1452 // rbx = regexp literal. |
| 1453 // rax = regexp literal clone. | 1453 // rax = regexp literal clone. |
| 1454 __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1454 __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1455 __ movp(rcx, FieldOperand(rdi, JSFunction::kLiteralsOffset)); | 1455 __ movp(rcx, FieldOperand(rdi, JSFunction::kLiteralsOffset)); |
| 1456 int literal_offset = | 1456 int literal_offset = LiteralsArray::OffsetOfLiteralAt(expr->literal_index()); |
| 1457 FixedArray::kHeaderSize + expr->literal_index() * kPointerSize; | |
| 1458 __ movp(rbx, FieldOperand(rcx, literal_offset)); | 1457 __ movp(rbx, FieldOperand(rcx, literal_offset)); |
| 1459 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | 1458 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); |
| 1460 __ j(not_equal, &materialized, Label::kNear); | 1459 __ j(not_equal, &materialized, Label::kNear); |
| 1461 | 1460 |
| 1462 // Create regexp literal using runtime function | 1461 // Create regexp literal using runtime function |
| 1463 // Result will be in rax. | 1462 // Result will be in rax. |
| 1464 __ Push(rcx); | 1463 __ Push(rcx); |
| 1465 __ Push(Smi::FromInt(expr->literal_index())); | 1464 __ Push(Smi::FromInt(expr->literal_index())); |
| 1466 __ Push(expr->pattern()); | 1465 __ Push(expr->pattern()); |
| 1467 __ Push(expr->flags()); | 1466 __ Push(expr->flags()); |
| (...skipping 3691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5159 Assembler::target_address_at(call_target_address, | 5158 Assembler::target_address_at(call_target_address, |
| 5160 unoptimized_code)); | 5159 unoptimized_code)); |
| 5161 return OSR_AFTER_STACK_CHECK; | 5160 return OSR_AFTER_STACK_CHECK; |
| 5162 } | 5161 } |
| 5163 | 5162 |
| 5164 | 5163 |
| 5165 } // namespace internal | 5164 } // namespace internal |
| 5166 } // namespace v8 | 5165 } // namespace v8 |
| 5167 | 5166 |
| 5168 #endif // V8_TARGET_ARCH_X64 | 5167 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |