OLD | NEW |
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 #include "src/full-codegen/full-codegen.h" | 5 #include "src/full-codegen/full-codegen.h" |
6 | 6 |
7 #include "src/ast/ast-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1534 | 1534 |
1535 if (lit->class_variable_proxy() != nullptr) { | 1535 if (lit->class_variable_proxy() != nullptr) { |
1536 EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT, | 1536 EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT, |
1537 lit->ProxySlot()); | 1537 lit->ProxySlot()); |
1538 } | 1538 } |
1539 } | 1539 } |
1540 | 1540 |
1541 context()->Plug(result_register()); | 1541 context()->Plug(result_register()); |
1542 } | 1542 } |
1543 | 1543 |
| 1544 void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { |
| 1545 Comment cmnt(masm_, "[ RegExpLiteral"); |
| 1546 Callable callable = CodeFactory::FastCloneRegExp(isolate()); |
| 1547 CallInterfaceDescriptor descriptor = callable.descriptor(); |
| 1548 LoadFromFrameField(JavaScriptFrameConstants::kFunctionOffset, |
| 1549 descriptor.GetRegisterParameter(0)); |
| 1550 __ Move(descriptor.GetRegisterParameter(1), |
| 1551 Smi::FromInt(expr->literal_index())); |
| 1552 __ Move(descriptor.GetRegisterParameter(2), expr->pattern()); |
| 1553 __ Move(descriptor.GetRegisterParameter(3), Smi::FromInt(expr->flags())); |
| 1554 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
| 1555 context()->Plug(result_register()); |
| 1556 } |
1544 | 1557 |
1545 void FullCodeGenerator::VisitNativeFunctionLiteral( | 1558 void FullCodeGenerator::VisitNativeFunctionLiteral( |
1546 NativeFunctionLiteral* expr) { | 1559 NativeFunctionLiteral* expr) { |
1547 Comment cmnt(masm_, "[ NativeFunctionLiteral"); | 1560 Comment cmnt(masm_, "[ NativeFunctionLiteral"); |
1548 Handle<SharedFunctionInfo> shared = | 1561 Handle<SharedFunctionInfo> shared = |
1549 Compiler::GetSharedFunctionInfoForNative(expr->extension(), expr->name()); | 1562 Compiler::GetSharedFunctionInfoForNative(expr->extension(), expr->name()); |
1550 EmitNewClosure(shared, false); | 1563 EmitNewClosure(shared, false); |
1551 } | 1564 } |
1552 | 1565 |
1553 | 1566 |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1974 return var->scope()->is_nonlinear() || | 1987 return var->scope()->is_nonlinear() || |
1975 var->initializer_position() >= proxy->position(); | 1988 var->initializer_position() >= proxy->position(); |
1976 } | 1989 } |
1977 | 1990 |
1978 | 1991 |
1979 #undef __ | 1992 #undef __ |
1980 | 1993 |
1981 | 1994 |
1982 } // namespace internal | 1995 } // namespace internal |
1983 } // namespace v8 | 1996 } // namespace v8 |
OLD | NEW |