OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 // if (false) { const x; }; var y = x; | 1510 // if (false) { const x; }; var y = x; |
1511 // | 1511 // |
1512 // The condition on the declaration scopes is a conservative check for | 1512 // The condition on the declaration scopes is a conservative check for |
1513 // nested functions that access a binding and are called before the | 1513 // nested functions that access a binding and are called before the |
1514 // binding is initialized: | 1514 // binding is initialized: |
1515 // function() { f(); let x = 1; function f() { x = 2; } } | 1515 // function() { f(); let x = 1; function f() { x = 2; } } |
1516 // | 1516 // |
1517 bool skip_init_check; | 1517 bool skip_init_check; |
1518 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { | 1518 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { |
1519 skip_init_check = false; | 1519 skip_init_check = false; |
| 1520 } else if (var->is_this()) { |
| 1521 // TODO(dslomov): implement 'this' hole check elimination. |
| 1522 skip_init_check = false; |
1520 } else { | 1523 } else { |
1521 // Check that we always have valid source position. | 1524 // Check that we always have valid source position. |
1522 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); | 1525 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); |
1523 DCHECK(proxy->position() != RelocInfo::kNoPosition); | 1526 DCHECK(proxy->position() != RelocInfo::kNoPosition); |
1524 skip_init_check = var->mode() != CONST_LEGACY && | 1527 skip_init_check = var->mode() != CONST_LEGACY && |
1525 var->initializer_position() < proxy->position(); | 1528 var->initializer_position() < proxy->position(); |
1526 } | 1529 } |
1527 | 1530 |
1528 if (!skip_init_check) { | 1531 if (!skip_init_check) { |
1529 // Let and const need a read barrier. | 1532 // Let and const need a read barrier. |
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2970 | 2973 |
2971 __ LoadObject(x2, FeedbackVector()); | 2974 __ LoadObject(x2, FeedbackVector()); |
2972 __ Mov(x3, SmiFromSlot(expr->CallFeedbackSlot())); | 2975 __ Mov(x3, SmiFromSlot(expr->CallFeedbackSlot())); |
2973 | 2976 |
2974 // TODO(dslomov): use a different stub and propagate new.target. | 2977 // TODO(dslomov): use a different stub and propagate new.target. |
2975 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 2978 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
2976 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 2979 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
2977 | 2980 |
2978 RecordJSReturnSite(expr); | 2981 RecordJSReturnSite(expr); |
2979 | 2982 |
2980 // TODO(dslomov): implement TDZ for `this`. | 2983 EmitVariableAssignment(super_ref->this_var()->var(), Token::INIT_CONST); |
2981 EmitVariableAssignment(super_ref->this_var()->var(), Token::ASSIGN); | |
2982 context()->Plug(x0); | 2984 context()->Plug(x0); |
2983 } | 2985 } |
2984 | 2986 |
2985 | 2987 |
2986 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2988 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
2987 ZoneList<Expression*>* args = expr->arguments(); | 2989 ZoneList<Expression*>* args = expr->arguments(); |
2988 DCHECK(args->length() == 1); | 2990 DCHECK(args->length() == 1); |
2989 | 2991 |
2990 VisitForAccumulatorValue(args->at(0)); | 2992 VisitForAccumulatorValue(args->at(0)); |
2991 | 2993 |
(...skipping 2398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5390 return previous_; | 5392 return previous_; |
5391 } | 5393 } |
5392 | 5394 |
5393 | 5395 |
5394 #undef __ | 5396 #undef __ |
5395 | 5397 |
5396 | 5398 |
5397 } } // namespace v8::internal | 5399 } } // namespace v8::internal |
5398 | 5400 |
5399 #endif // V8_TARGET_ARCH_ARM64 | 5401 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |