Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 2244673002: [regexp][liveedit] Fix inconsistent JSArrays (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/s390/code-stubs-s390.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 // Load RegExp data. 686 // Load RegExp data.
687 __ bind(&success); 687 __ bind(&success);
688 __ movp(rax, args.GetArgumentOperand(JS_REG_EXP_OBJECT_ARGUMENT_INDEX)); 688 __ movp(rax, args.GetArgumentOperand(JS_REG_EXP_OBJECT_ARGUMENT_INDEX));
689 __ movp(rcx, FieldOperand(rax, JSRegExp::kDataOffset)); 689 __ movp(rcx, FieldOperand(rax, JSRegExp::kDataOffset));
690 __ SmiToInteger32(rax, 690 __ SmiToInteger32(rax,
691 FieldOperand(rcx, JSRegExp::kIrregexpCaptureCountOffset)); 691 FieldOperand(rcx, JSRegExp::kIrregexpCaptureCountOffset));
692 // Calculate number of capture registers (number_of_captures + 1) * 2. 692 // Calculate number of capture registers (number_of_captures + 1) * 2.
693 __ leal(rdx, Operand(rax, rax, times_1, 2)); 693 __ leal(rdx, Operand(rax, rax, times_1, 2));
694 694
695 // rdx: Number of capture registers 695 // rdx: Number of capture registers
696 // Check that the fourth object is a JSArray object. 696 // Check that the fourth object is a JSObject.
697 __ movp(r15, args.GetArgumentOperand(LAST_MATCH_INFO_ARGUMENT_INDEX)); 697 __ movp(r15, args.GetArgumentOperand(LAST_MATCH_INFO_ARGUMENT_INDEX));
698 __ JumpIfSmi(r15, &runtime); 698 __ JumpIfSmi(r15, &runtime);
699 __ CmpObjectType(r15, JS_ARRAY_TYPE, kScratchRegister); 699 __ CmpObjectType(r15, JS_OBJECT_TYPE, kScratchRegister);
700 __ j(not_equal, &runtime); 700 __ j(not_equal, &runtime);
701 // Check that the JSArray is in fast case. 701 // Check that the object has fast elements.
702 __ movp(rbx, FieldOperand(r15, JSArray::kElementsOffset)); 702 __ movp(rbx, FieldOperand(r15, JSArray::kElementsOffset));
703 __ movp(rax, FieldOperand(rbx, HeapObject::kMapOffset)); 703 __ movp(rax, FieldOperand(rbx, HeapObject::kMapOffset));
704 __ CompareRoot(rax, Heap::kFixedArrayMapRootIndex); 704 __ CompareRoot(rax, Heap::kFixedArrayMapRootIndex);
705 __ j(not_equal, &runtime); 705 __ j(not_equal, &runtime);
706 // Check that the last match info has space for the capture registers and the 706 // Check that the last match info has space for the capture registers and the
707 // additional information. Ensure no overflow in add. 707 // additional information. Ensure no overflow in add.
708 STATIC_ASSERT(FixedArray::kMaxLength < kMaxInt - FixedArray::kLengthOffset); 708 STATIC_ASSERT(FixedArray::kMaxLength < kMaxInt - FixedArray::kLengthOffset);
709 __ SmiToInteger32(rax, FieldOperand(rbx, FixedArray::kLengthOffset)); 709 __ SmiToInteger32(rax, FieldOperand(rbx, FixedArray::kLengthOffset));
710 __ subl(rax, Immediate(RegExpImpl::kLastMatchOverhead)); 710 __ subl(rax, Immediate(RegExpImpl::kLastMatchOverhead));
711 __ cmpl(rdx, rax); 711 __ cmpl(rdx, rax);
(...skipping 4492 matching lines...) Expand 10 before | Expand all | Expand 10 after
5204 kStackUnwindSpace, nullptr, return_value_operand, 5204 kStackUnwindSpace, nullptr, return_value_operand,
5205 NULL); 5205 NULL);
5206 } 5206 }
5207 5207
5208 #undef __ 5208 #undef __
5209 5209
5210 } // namespace internal 5210 } // namespace internal
5211 } // namespace v8 5211 } // namespace v8
5212 5212
5213 #endif // V8_TARGET_ARCH_X64 5213 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/s390/code-stubs-s390.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698