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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 // if (false) { const x; }; var y = x; | 1530 // if (false) { const x; }; var y = x; |
1531 // | 1531 // |
1532 // The condition on the declaration scopes is a conservative check for | 1532 // The condition on the declaration scopes is a conservative check for |
1533 // nested functions that access a binding and are called before the | 1533 // nested functions that access a binding and are called before the |
1534 // binding is initialized: | 1534 // binding is initialized: |
1535 // function() { f(); let x = 1; function f() { x = 2; } } | 1535 // function() { f(); let x = 1; function f() { x = 2; } } |
1536 // | 1536 // |
1537 bool skip_init_check; | 1537 bool skip_init_check; |
1538 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { | 1538 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { |
1539 skip_init_check = false; | 1539 skip_init_check = false; |
| 1540 } else if (var->is_this()) { |
| 1541 // TODO(dslomov): implement 'this' hole check elimination. |
| 1542 skip_init_check = false; |
1540 } else { | 1543 } else { |
1541 // Check that we always have valid source position. | 1544 // Check that we always have valid source position. |
1542 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); | 1545 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); |
1543 DCHECK(proxy->position() != RelocInfo::kNoPosition); | 1546 DCHECK(proxy->position() != RelocInfo::kNoPosition); |
1544 skip_init_check = var->mode() != CONST_LEGACY && | 1547 skip_init_check = var->mode() != CONST_LEGACY && |
1545 var->initializer_position() < proxy->position(); | 1548 var->initializer_position() < proxy->position(); |
1546 } | 1549 } |
1547 | 1550 |
1548 if (!skip_init_check) { | 1551 if (!skip_init_check) { |
1549 // Let and const need a read barrier. | 1552 // Let and const need a read barrier. |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3281 | 3284 |
3282 __ Move(r2, FeedbackVector()); | 3285 __ Move(r2, FeedbackVector()); |
3283 __ mov(r3, Operand(SmiFromSlot(expr->CallFeedbackSlot()))); | 3286 __ mov(r3, Operand(SmiFromSlot(expr->CallFeedbackSlot()))); |
3284 | 3287 |
3285 // TODO(dslomov): use a different stub and propagate new.target. | 3288 // TODO(dslomov): use a different stub and propagate new.target. |
3286 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 3289 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
3287 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3290 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3288 | 3291 |
3289 RecordJSReturnSite(expr); | 3292 RecordJSReturnSite(expr); |
3290 | 3293 |
3291 // TODO(dslomov): implement TDZ for `this`. | 3294 EmitVariableAssignment(super_ref->this_var()->var(), Token::INIT_CONST); |
3292 EmitVariableAssignment(super_ref->this_var()->var(), Token::ASSIGN); | |
3293 context()->Plug(r0); | 3295 context()->Plug(r0); |
3294 } | 3296 } |
3295 | 3297 |
3296 | 3298 |
3297 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 3299 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
3298 ZoneList<Expression*>* args = expr->arguments(); | 3300 ZoneList<Expression*>* args = expr->arguments(); |
3299 DCHECK(args->length() == 1); | 3301 DCHECK(args->length() == 1); |
3300 | 3302 |
3301 VisitForAccumulatorValue(args->at(0)); | 3303 VisitForAccumulatorValue(args->at(0)); |
3302 | 3304 |
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5410 | 5412 |
5411 DCHECK(interrupt_address == | 5413 DCHECK(interrupt_address == |
5412 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5414 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5413 return OSR_AFTER_STACK_CHECK; | 5415 return OSR_AFTER_STACK_CHECK; |
5414 } | 5416 } |
5415 | 5417 |
5416 | 5418 |
5417 } } // namespace v8::internal | 5419 } } // namespace v8::internal |
5418 | 5420 |
5419 #endif // V8_TARGET_ARCH_ARM | 5421 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |