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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { | 1408 void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { |
1409 Comment cmnt(masm_, "[ RegExpLiteral"); | 1409 Comment cmnt(masm_, "[ RegExpLiteral"); |
1410 Label materialized; | 1410 Label materialized; |
1411 // Registers will be used as follows: | 1411 // Registers will be used as follows: |
1412 // edi = JS function. | 1412 // edi = JS function. |
1413 // ecx = literals array. | 1413 // ecx = literals array. |
1414 // ebx = regexp literal. | 1414 // ebx = regexp literal. |
1415 // eax = regexp literal clone. | 1415 // eax = regexp literal clone. |
1416 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1416 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1417 __ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset)); | 1417 __ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset)); |
1418 int literal_offset = | 1418 int literal_offset = LiteralsArray::OffsetOfLiteralAt(expr->literal_index()); |
1419 FixedArray::kHeaderSize + expr->literal_index() * kPointerSize; | |
1420 __ mov(ebx, FieldOperand(ecx, literal_offset)); | 1419 __ mov(ebx, FieldOperand(ecx, literal_offset)); |
1421 __ cmp(ebx, isolate()->factory()->undefined_value()); | 1420 __ cmp(ebx, isolate()->factory()->undefined_value()); |
1422 __ j(not_equal, &materialized, Label::kNear); | 1421 __ j(not_equal, &materialized, Label::kNear); |
1423 | 1422 |
1424 // Create regexp literal using runtime function | 1423 // Create regexp literal using runtime function |
1425 // Result will be in eax. | 1424 // Result will be in eax. |
1426 __ push(ecx); | 1425 __ push(ecx); |
1427 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | 1426 __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
1428 __ push(Immediate(expr->pattern())); | 1427 __ push(Immediate(expr->pattern())); |
1429 __ push(Immediate(expr->flags())); | 1428 __ push(Immediate(expr->flags())); |
(...skipping 3704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5134 Assembler::target_address_at(call_target_address, | 5133 Assembler::target_address_at(call_target_address, |
5135 unoptimized_code)); | 5134 unoptimized_code)); |
5136 return OSR_AFTER_STACK_CHECK; | 5135 return OSR_AFTER_STACK_CHECK; |
5137 } | 5136 } |
5138 | 5137 |
5139 | 5138 |
5140 } // namespace internal | 5139 } // namespace internal |
5141 } // namespace v8 | 5140 } // namespace v8 |
5142 | 5141 |
5143 #endif // V8_TARGET_ARCH_X87 | 5142 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |