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

Side by Side Diff: src/compiler/bytecode-graph-builder.cc

Issue 2557593004: [ignition] desugar GetIterator() via bytecode rather than via AST (Closed)
Patch Set: georg's comments Created 4 years 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/compiler/bytecode-graph-builder.h ('k') | src/crankshaft/hydrogen.cc » ('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/compiler/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler/compiler-source-position-table.h" 10 #include "src/compiler/compiler-source-position-table.h"
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 void BytecodeGraphBuilder::VisitJumpIfToBooleanFalseConstant() { 1708 void BytecodeGraphBuilder::VisitJumpIfToBooleanFalseConstant() {
1709 BuildJumpIfToBooleanFalse(); 1709 BuildJumpIfToBooleanFalse();
1710 } 1710 }
1711 1711
1712 void BytecodeGraphBuilder::VisitJumpIfNotHole() { BuildJumpIfNotHole(); } 1712 void BytecodeGraphBuilder::VisitJumpIfNotHole() { BuildJumpIfNotHole(); }
1713 1713
1714 void BytecodeGraphBuilder::VisitJumpIfNotHoleConstant() { 1714 void BytecodeGraphBuilder::VisitJumpIfNotHoleConstant() {
1715 BuildJumpIfNotHole(); 1715 BuildJumpIfNotHole();
1716 } 1716 }
1717 1717
1718 void BytecodeGraphBuilder::VisitJumpIfJSReceiver() { BuildJumpIfJSReceiver(); }
1719
1720 void BytecodeGraphBuilder::VisitJumpIfJSReceiverConstant() {
1721 BuildJumpIfJSReceiver();
1722 }
1723
1718 void BytecodeGraphBuilder::VisitJumpIfNull() { 1724 void BytecodeGraphBuilder::VisitJumpIfNull() {
1719 BuildJumpIfEqual(jsgraph()->NullConstant()); 1725 BuildJumpIfEqual(jsgraph()->NullConstant());
1720 } 1726 }
1721 1727
1722 void BytecodeGraphBuilder::VisitJumpIfNullConstant() { 1728 void BytecodeGraphBuilder::VisitJumpIfNullConstant() {
1723 BuildJumpIfEqual(jsgraph()->NullConstant()); 1729 BuildJumpIfEqual(jsgraph()->NullConstant());
1724 } 1730 }
1725 1731
1726 void BytecodeGraphBuilder::VisitJumpIfUndefined() { 1732 void BytecodeGraphBuilder::VisitJumpIfUndefined() {
1727 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); 1733 BuildJumpIfEqual(jsgraph()->UndefinedConstant());
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 } 2025 }
2020 2026
2021 void BytecodeGraphBuilder::BuildJumpIfNotHole() { 2027 void BytecodeGraphBuilder::BuildJumpIfNotHole() {
2022 Node* accumulator = environment()->LookupAccumulator(); 2028 Node* accumulator = environment()->LookupAccumulator();
2023 Node* condition = 2029 Node* condition =
2024 NewNode(javascript()->StrictEqual(CompareOperationHint::kAny), 2030 NewNode(javascript()->StrictEqual(CompareOperationHint::kAny),
2025 accumulator, jsgraph()->TheHoleConstant()); 2031 accumulator, jsgraph()->TheHoleConstant());
2026 BuildJumpIfNot(condition); 2032 BuildJumpIfNot(condition);
2027 } 2033 }
2028 2034
2035 void BytecodeGraphBuilder::BuildJumpIfJSReceiver() {
2036 Node* accumulator = environment()->LookupAccumulator();
2037 Node* condition = NewNode(simplified()->ObjectIsReceiver(), accumulator);
2038 BuildJumpIf(condition);
2039 }
2040
2029 Node** BytecodeGraphBuilder::EnsureInputBufferSize(int size) { 2041 Node** BytecodeGraphBuilder::EnsureInputBufferSize(int size) {
2030 if (size > input_buffer_size_) { 2042 if (size > input_buffer_size_) {
2031 size = size + kInputBufferSizeIncrement + input_buffer_size_; 2043 size = size + kInputBufferSizeIncrement + input_buffer_size_;
2032 input_buffer_ = local_zone()->NewArray<Node*>(size); 2044 input_buffer_ = local_zone()->NewArray<Node*>(size);
2033 input_buffer_size_ = size; 2045 input_buffer_size_ = size;
2034 } 2046 }
2035 return input_buffer_; 2047 return input_buffer_;
2036 } 2048 }
2037 2049
2038 void BytecodeGraphBuilder::EnterAndExitExceptionHandlers(int current_offset) { 2050 void BytecodeGraphBuilder::EnterAndExitExceptionHandlers(int current_offset) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
2221 it->source_position().ScriptOffset(), start_position_.InliningId())); 2233 it->source_position().ScriptOffset(), start_position_.InliningId()));
2222 it->Advance(); 2234 it->Advance();
2223 } else { 2235 } else {
2224 DCHECK_GT(it->code_offset(), offset); 2236 DCHECK_GT(it->code_offset(), offset);
2225 } 2237 }
2226 } 2238 }
2227 2239
2228 } // namespace compiler 2240 } // namespace compiler
2229 } // namespace internal 2241 } // namespace internal
2230 } // namespace v8 2242 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698