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

Side by Side Diff: src/ia32/code-stubs-ia32.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/debug/liveedit.cc ('k') | src/js/macros.py » ('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 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/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 __ bind(&success); 803 __ bind(&success);
804 __ mov(eax, Operand(esp, kJSRegExpOffset)); 804 __ mov(eax, Operand(esp, kJSRegExpOffset));
805 __ mov(ecx, FieldOperand(eax, JSRegExp::kDataOffset)); 805 __ mov(ecx, FieldOperand(eax, JSRegExp::kDataOffset));
806 __ mov(edx, FieldOperand(ecx, JSRegExp::kIrregexpCaptureCountOffset)); 806 __ mov(edx, FieldOperand(ecx, JSRegExp::kIrregexpCaptureCountOffset));
807 // Calculate number of capture registers (number_of_captures + 1) * 2. 807 // Calculate number of capture registers (number_of_captures + 1) * 2.
808 STATIC_ASSERT(kSmiTag == 0); 808 STATIC_ASSERT(kSmiTag == 0);
809 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1); 809 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1);
810 __ add(edx, Immediate(2)); // edx was a smi. 810 __ add(edx, Immediate(2)); // edx was a smi.
811 811
812 // edx: Number of capture registers 812 // edx: Number of capture registers
813 // Load last_match_info which is still known to be a fast case JSArray. 813 // Load last_match_info which is still known to be a fast-elements JSObject.
814 // Check that the fourth object is a JSArray object. 814 // Check that the fourth object is a JSObject.
815 __ mov(eax, Operand(esp, kLastMatchInfoOffset)); 815 __ mov(eax, Operand(esp, kLastMatchInfoOffset));
816 __ JumpIfSmi(eax, &runtime); 816 __ JumpIfSmi(eax, &runtime);
817 __ CmpObjectType(eax, JS_ARRAY_TYPE, ebx); 817 __ CmpObjectType(eax, JS_OBJECT_TYPE, ebx);
818 __ j(not_equal, &runtime); 818 __ j(not_equal, &runtime);
819 // Check that the JSArray is in fast case. 819 // Check that the object has fast elements.
820 __ mov(ebx, FieldOperand(eax, JSArray::kElementsOffset)); 820 __ mov(ebx, FieldOperand(eax, JSArray::kElementsOffset));
821 __ mov(eax, FieldOperand(ebx, HeapObject::kMapOffset)); 821 __ mov(eax, FieldOperand(ebx, HeapObject::kMapOffset));
822 __ cmp(eax, factory->fixed_array_map()); 822 __ cmp(eax, factory->fixed_array_map());
823 __ j(not_equal, &runtime); 823 __ j(not_equal, &runtime);
824 // Check that the last match info has space for the capture registers and the 824 // Check that the last match info has space for the capture registers and the
825 // additional information. 825 // additional information.
826 __ mov(eax, FieldOperand(ebx, FixedArray::kLengthOffset)); 826 __ mov(eax, FieldOperand(ebx, FixedArray::kLengthOffset));
827 __ SmiUntag(eax); 827 __ SmiUntag(eax);
828 __ sub(eax, Immediate(RegExpImpl::kLastMatchOverhead)); 828 __ sub(eax, Immediate(RegExpImpl::kLastMatchOverhead));
829 __ cmp(edx, eax); 829 __ cmp(edx, eax);
(...skipping 4656 matching lines...) Expand 10 before | Expand all | Expand 10 after
5486 kStackUnwindSpace, nullptr, return_value_operand, 5486 kStackUnwindSpace, nullptr, return_value_operand,
5487 NULL); 5487 NULL);
5488 } 5488 }
5489 5489
5490 #undef __ 5490 #undef __
5491 5491
5492 } // namespace internal 5492 } // namespace internal
5493 } // namespace v8 5493 } // namespace v8
5494 5494
5495 #endif // V8_TARGET_ARCH_IA32 5495 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/debug/liveedit.cc ('k') | src/js/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698