Commit c0766d66 authored by jgruber's avatar jgruber Committed by Commit Bot

[regexp] Typify RegExpExecInternal

Bug: v8:7754
Change-Id: Ie58571682f4dff76108180e8a707159997f7abfa
Reviewed-on: https://chromium-review.googlesource.com/1145277Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54606}
parent 1f82fb54
This diff is collapsed.
...@@ -58,9 +58,10 @@ class RegExpBuiltinsAssembler : public CodeStubAssembler { ...@@ -58,9 +58,10 @@ class RegExpBuiltinsAssembler : public CodeStubAssembler {
Variable* var_string_end); Variable* var_string_end);
// Low level logic around the actual call into pattern matching code. // Low level logic around the actual call into pattern matching code.
Node* RegExpExecInternal(Node* const context, Node* const regexp, TNode<Object> RegExpExecInternal(TNode<Context> context,
Node* const string, Node* const last_index, TNode<JSRegExp> regexp, TNode<String> string,
Node* const match_info); TNode<Number> last_index,
TNode<FixedArray> match_info);
Node* ConstructNewResultFromMatchInfo(Node* const context, Node* const regexp, Node* ConstructNewResultFromMatchInfo(Node* const context, Node* const regexp,
Node* const match_info, Node* const match_info,
......
...@@ -6088,11 +6088,11 @@ TNode<String> ToDirectStringAssembler::TryToDirect(Label* if_bailout) { ...@@ -6088,11 +6088,11 @@ TNode<String> ToDirectStringAssembler::TryToDirect(Label* if_bailout) {
return CAST(var_string_.value()); return CAST(var_string_.value());
} }
Node* ToDirectStringAssembler::TryToSequential(StringPointerKind ptr_kind, TNode<RawPtrT> ToDirectStringAssembler::TryToSequential(
Label* if_bailout) { StringPointerKind ptr_kind, Label* if_bailout) {
CHECK(ptr_kind == PTR_TO_DATA || ptr_kind == PTR_TO_STRING); CHECK(ptr_kind == PTR_TO_DATA || ptr_kind == PTR_TO_STRING);
VARIABLE(var_result, MachineType::PointerRepresentation()); TVARIABLE(RawPtrT, var_result);
Label out(this), if_issequential(this), if_isexternal(this, Label::kDeferred); Label out(this), if_issequential(this), if_isexternal(this, Label::kDeferred);
Branch(is_external(), &if_isexternal, &if_issequential); Branch(is_external(), &if_isexternal, &if_issequential);
...@@ -6100,12 +6100,12 @@ Node* ToDirectStringAssembler::TryToSequential(StringPointerKind ptr_kind, ...@@ -6100,12 +6100,12 @@ Node* ToDirectStringAssembler::TryToSequential(StringPointerKind ptr_kind,
{ {
STATIC_ASSERT(SeqOneByteString::kHeaderSize == STATIC_ASSERT(SeqOneByteString::kHeaderSize ==
SeqTwoByteString::kHeaderSize); SeqTwoByteString::kHeaderSize);
Node* result = BitcastTaggedToWord(var_string_.value()); TNode<IntPtrT> result = BitcastTaggedToWord(var_string_.value());
if (ptr_kind == PTR_TO_DATA) { if (ptr_kind == PTR_TO_DATA) {
result = IntPtrAdd(result, IntPtrConstant(SeqOneByteString::kHeaderSize - result = IntPtrAdd(result, IntPtrConstant(SeqOneByteString::kHeaderSize -
kHeapObjectTag)); kHeapObjectTag));
} }
var_result.Bind(result); var_result = ReinterpretCast<RawPtrT>(result);
Goto(&out); Goto(&out);
} }
...@@ -6114,14 +6114,14 @@ Node* ToDirectStringAssembler::TryToSequential(StringPointerKind ptr_kind, ...@@ -6114,14 +6114,14 @@ Node* ToDirectStringAssembler::TryToSequential(StringPointerKind ptr_kind,
GotoIf(IsShortExternalStringInstanceType(var_instance_type_.value()), GotoIf(IsShortExternalStringInstanceType(var_instance_type_.value()),
if_bailout); if_bailout);
Node* const string = var_string_.value(); TNode<String> string = CAST(var_string_.value());
Node* result = LoadObjectField(string, ExternalString::kResourceDataOffset, TNode<IntPtrT> result =
MachineType::Pointer()); LoadObjectField<IntPtrT>(string, ExternalString::kResourceDataOffset);
if (ptr_kind == PTR_TO_STRING) { if (ptr_kind == PTR_TO_STRING) {
result = IntPtrSub(result, IntPtrConstant(SeqOneByteString::kHeaderSize - result = IntPtrSub(result, IntPtrConstant(SeqOneByteString::kHeaderSize -
kHeapObjectTag)); kHeapObjectTag));
} }
var_result.Bind(result); var_result = ReinterpretCast<RawPtrT>(result);
Goto(&out); Goto(&out);
} }
......
...@@ -2946,13 +2946,13 @@ class ToDirectStringAssembler : public CodeStubAssembler { ...@@ -2946,13 +2946,13 @@ class ToDirectStringAssembler : public CodeStubAssembler {
// Returns a pointer to the beginning of the string data. // Returns a pointer to the beginning of the string data.
// Jumps to if_bailout if the external string cannot be unpacked. // Jumps to if_bailout if the external string cannot be unpacked.
Node* PointerToData(Label* if_bailout) { TNode<RawPtrT> PointerToData(Label* if_bailout) {
return TryToSequential(PTR_TO_DATA, if_bailout); return TryToSequential(PTR_TO_DATA, if_bailout);
} }
// Returns a pointer that, offset-wise, looks like a String. // Returns a pointer that, offset-wise, looks like a String.
// Jumps to if_bailout if the external string cannot be unpacked. // Jumps to if_bailout if the external string cannot be unpacked.
Node* PointerToString(Label* if_bailout) { TNode<RawPtrT> PointerToString(Label* if_bailout) {
return TryToSequential(PTR_TO_STRING, if_bailout); return TryToSequential(PTR_TO_STRING, if_bailout);
} }
...@@ -2964,7 +2964,7 @@ class ToDirectStringAssembler : public CodeStubAssembler { ...@@ -2964,7 +2964,7 @@ class ToDirectStringAssembler : public CodeStubAssembler {
Node* is_external() { return var_is_external_.value(); } Node* is_external() { return var_is_external_.value(); }
private: private:
Node* TryToSequential(StringPointerKind ptr_kind, Label* if_bailout); TNode<RawPtrT> TryToSequential(StringPointerKind ptr_kind, Label* if_bailout);
Variable var_string_; Variable var_string_;
Variable var_instance_type_; Variable var_instance_type_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment