Index: src/compiler/js-generic-lowering.cc |
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc |
index 58522dbf6e168362af81e19bbf89dc98ea44010b..c940b854e0908be81813d000c8fef1b2210274c8 100644 |
--- a/src/compiler/js-generic-lowering.cc |
+++ b/src/compiler/js-generic-lowering.cc |
@@ -506,7 +506,7 @@ void JSGenericLowering::LowerJSCreateClosure(Node* node) { |
void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { |
CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); |
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.index())); |
- node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constants())); |
+ node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant())); |
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags())); |
ReplaceWithRuntimeCall(node, Runtime::kCreateArrayLiteral); |
} |
@@ -515,12 +515,31 @@ void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { |
void JSGenericLowering::LowerJSCreateLiteralObject(Node* node) { |
CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); |
node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.index())); |
- node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constants())); |
+ node->InsertInput(zone(), 2, jsgraph()->HeapConstant(p.constant())); |
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.flags())); |
ReplaceWithRuntimeCall(node, Runtime::kCreateObjectLiteral); |
} |
+void JSGenericLowering::LowerJSCreateLiteralRegExp(Node* node) { |
+ CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); |
+ CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
+ Callable callable = CodeFactory::FastCloneRegExp(isolate()); |
+ CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
+ isolate(), graph()->zone(), callable.descriptor(), 0, flags); |
+ const Operator* new_op = common()->Call(desc); |
+ Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
Michael Starzinger
2015/11/25 14:49:15
Is it possible to use JSGenericLowering::ReplaceWi
|
+ Node* literal_index = jsgraph()->SmiConstant(p.index()); |
+ Node* literal_flags = jsgraph()->SmiConstant(p.flags()); |
+ Node* pattern = jsgraph()->HeapConstant(p.constant()); |
+ node->InsertInput(graph()->zone(), 0, stub_code); |
+ node->InsertInput(graph()->zone(), 2, literal_index); |
+ node->InsertInput(graph()->zone(), 3, pattern); |
+ node->InsertInput(graph()->zone(), 4, literal_flags); |
+ NodeProperties::ChangeOp(node, new_op); |
+} |
+ |
+ |
void JSGenericLowering::LowerJSCreateCatchContext(Node* node) { |
Handle<String> name = OpParameter<Handle<String>>(node); |
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(name)); |