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

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

Issue 2043183003: Replace all remaining Oddball checks with new function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: keep em coming 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
« no previous file with comments | « src/ic/ic.cc ('k') | src/isolate-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 execution_result()->SetResultInAccumulator(); 1502 execution_result()->SetResultInAccumulator();
1503 } 1503 }
1504 1504
1505 void BytecodeGenerator::VisitLiteral(Literal* expr) { 1505 void BytecodeGenerator::VisitLiteral(Literal* expr) {
1506 if (!execution_result()->IsEffect()) { 1506 if (!execution_result()->IsEffect()) {
1507 Handle<Object> value = expr->value(); 1507 Handle<Object> value = expr->value();
1508 if (value->IsSmi()) { 1508 if (value->IsSmi()) {
1509 builder()->LoadLiteral(Smi::cast(*value)); 1509 builder()->LoadLiteral(Smi::cast(*value));
1510 } else if (value->IsUndefined(isolate())) { 1510 } else if (value->IsUndefined(isolate())) {
1511 builder()->LoadUndefined(); 1511 builder()->LoadUndefined();
1512 } else if (value->IsTrue()) { 1512 } else if (value->IsTrue(isolate())) {
1513 builder()->LoadTrue(); 1513 builder()->LoadTrue();
1514 } else if (value->IsFalse()) { 1514 } else if (value->IsFalse(isolate())) {
1515 builder()->LoadFalse(); 1515 builder()->LoadFalse();
1516 } else if (value->IsNull()) { 1516 } else if (value->IsNull(isolate())) {
1517 builder()->LoadNull(); 1517 builder()->LoadNull();
1518 } else if (value->IsTheHole(isolate())) { 1518 } else if (value->IsTheHole(isolate())) {
1519 builder()->LoadTheHole(); 1519 builder()->LoadTheHole();
1520 } else { 1520 } else {
1521 builder()->LoadLiteral(value); 1521 builder()->LoadLiteral(value);
1522 } 1522 }
1523 execution_result()->SetResultInAccumulator(); 1523 execution_result()->SetResultInAccumulator();
1524 } 1524 }
1525 } 1525 }
1526 1526
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
3190 return execution_context()->scope()->language_mode(); 3190 return execution_context()->scope()->language_mode();
3191 } 3191 }
3192 3192
3193 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 3193 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
3194 return TypeFeedbackVector::GetIndex(slot); 3194 return TypeFeedbackVector::GetIndex(slot);
3195 } 3195 }
3196 3196
3197 } // namespace interpreter 3197 } // namespace interpreter
3198 } // namespace internal 3198 } // namespace internal
3199 } // namespace v8 3199 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/ic.cc ('k') | src/isolate-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698