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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing wrongly wrapped lines Created 4 years, 6 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/bytecode-generator.h" 5 #include "src/interpreter/bytecode-generator.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/interpreter/bytecode-register-allocator.h" 10 #include "src/interpreter/bytecode-register-allocator.h"
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 1551
1552 execution_result()->SetResultInAccumulator(); 1552 execution_result()->SetResultInAccumulator();
1553 } 1553 }
1554 1554
1555 1555
1556 void BytecodeGenerator::VisitLiteral(Literal* expr) { 1556 void BytecodeGenerator::VisitLiteral(Literal* expr) {
1557 if (!execution_result()->IsEffect()) { 1557 if (!execution_result()->IsEffect()) {
1558 Handle<Object> value = expr->value(); 1558 Handle<Object> value = expr->value();
1559 if (value->IsSmi()) { 1559 if (value->IsSmi()) {
1560 builder()->LoadLiteral(Smi::cast(*value)); 1560 builder()->LoadLiteral(Smi::cast(*value));
1561 } else if (value->IsUndefined()) { 1561 } else if (value->IsUndefined(isolate())) {
1562 builder()->LoadUndefined(); 1562 builder()->LoadUndefined();
1563 } else if (value->IsTrue()) { 1563 } else if (value->IsTrue()) {
1564 builder()->LoadTrue(); 1564 builder()->LoadTrue();
1565 } else if (value->IsFalse()) { 1565 } else if (value->IsFalse()) {
1566 builder()->LoadFalse(); 1566 builder()->LoadFalse();
1567 } else if (value->IsNull()) { 1567 } else if (value->IsNull()) {
1568 builder()->LoadNull(); 1568 builder()->LoadNull();
1569 } else if (value->IsTheHole()) { 1569 } else if (value->IsTheHole(isolate())) {
1570 builder()->LoadTheHole(); 1570 builder()->LoadTheHole();
1571 } else { 1571 } else {
1572 builder()->LoadLiteral(value); 1572 builder()->LoadLiteral(value);
1573 } 1573 }
1574 execution_result()->SetResultInAccumulator(); 1574 execution_result()->SetResultInAccumulator();
1575 } 1575 }
1576 } 1576 }
1577 1577
1578 1578
1579 void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { 1579 void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after
3276 } 3276 }
3277 3277
3278 3278
3279 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 3279 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
3280 return TypeFeedbackVector::GetIndex(slot); 3280 return TypeFeedbackVector::GetIndex(slot);
3281 } 3281 }
3282 3282
3283 } // namespace interpreter 3283 } // namespace interpreter
3284 } // namespace internal 3284 } // namespace internal
3285 } // namespace v8 3285 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698