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

Unified Diff: src/crankshaft/arm/lithium-codegen-arm.cc

Issue 1475823003: [runtime] First step to sanitize regexp literal creation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: src/crankshaft/arm/lithium-codegen-arm.cc
diff --git a/src/crankshaft/arm/lithium-codegen-arm.cc b/src/crankshaft/arm/lithium-codegen-arm.cc
index 4f2cf2410e9959cfbdd4d7986a7fc0a688a6c8c6..bb4c933c9f252b4dba898ca019052bda077dcb4c 100644
--- a/src/crankshaft/arm/lithium-codegen-arm.cc
+++ b/src/crankshaft/arm/lithium-codegen-arm.cc
@@ -5310,50 +5310,6 @@ void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
}
-void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
- DCHECK(ToRegister(instr->context()).is(cp));
- Label materialized;
- // Registers will be used as follows:
- // r6 = literals array.
- // r1 = regexp literal.
- // r0 = regexp literal clone.
- // r2-5 are used as temporaries.
- int literal_offset =
- LiteralsArray::OffsetOfLiteralAt(instr->hydrogen()->literal_index());
- __ Move(r6, instr->hydrogen()->literals());
- __ ldr(r1, FieldMemOperand(r6, literal_offset));
- __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
- __ cmp(r1, ip);
- __ b(ne, &materialized);
-
- // Create regexp literal using runtime function
- // Result will be in r0.
- __ mov(r5, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
- __ mov(r4, Operand(instr->hydrogen()->pattern()));
- __ mov(r3, Operand(instr->hydrogen()->flags()));
- __ Push(r6, r5, r4, r3);
- CallRuntime(Runtime::kMaterializeRegExpLiteral, 4, instr);
- __ mov(r1, r0);
-
- __ bind(&materialized);
- int size = JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kPointerSize;
- Label allocated, runtime_allocate;
-
- __ Allocate(size, r0, r2, r3, &runtime_allocate, TAG_OBJECT);
- __ jmp(&allocated);
-
- __ bind(&runtime_allocate);
- __ mov(r0, Operand(Smi::FromInt(size)));
- __ Push(r1, r0);
- CallRuntime(Runtime::kAllocateInNewSpace, 1, instr);
- __ pop(r1);
-
- __ bind(&allocated);
- // Copy the content into the newly allocated memory.
- __ CopyFields(r0, r1, double_scratch0(), size / kPointerSize);
-}
-
-
void LCodeGen::DoTypeof(LTypeof* instr) {
DCHECK(ToRegister(instr->value()).is(r3));
DCHECK(ToRegister(instr->result()).is(r0));

Powered by Google App Engine
This is Rietveld 408576698