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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 1683103002: [compiler] Sanitize entry points to LookupSlot access. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Fixes. Comments. Created 4 years, 10 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 | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/interpreter/bytecode-array-builder.h" 7 #include "src/interpreter/bytecode-array-builder.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "src/interpreter/bytecode-register-allocator.h" 9 #include "src/interpreter/bytecode-register-allocator.h"
10 #include "test/unittests/test-utils.h" 10 #include "test/unittests/test-utils.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // Emit literal creation operations. 96 // Emit literal creation operations.
97 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) 97 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0)
98 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) 98 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0)
99 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0); 99 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0);
100 100
101 // Call operations. 101 // Call operations.
102 builder.Call(reg, other, 1, 0) 102 builder.Call(reg, other, 1, 0)
103 .Call(reg, wide, 1, 0) 103 .Call(reg, wide, 1, 0)
104 .CallRuntime(Runtime::kIsArray, reg, 1) 104 .CallRuntime(Runtime::kIsArray, reg, 1)
105 .CallRuntime(Runtime::kIsArray, wide, 1) 105 .CallRuntime(Runtime::kIsArray, wide, 1)
106 .CallRuntimeForPair(Runtime::kLoadLookupSlot, reg, 1, other) 106 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg, 1, other)
107 .CallRuntimeForPair(Runtime::kLoadLookupSlot, wide, 1, other) 107 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, wide, 1, other)
108 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1) 108 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1)
109 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, wide, 1); 109 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, wide, 1);
110 110
111 // Emit binary operator invocations. 111 // Emit binary operator invocations.
112 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 112 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
113 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) 113 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK)
114 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK) 114 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK)
115 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK) 115 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK)
116 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK); 116 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK);
117 117
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 iterator.Advance(); 659 iterator.Advance();
660 } 660 }
661 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 661 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
662 iterator.Advance(); 662 iterator.Advance();
663 CHECK(iterator.done()); 663 CHECK(iterator.done());
664 } 664 }
665 665
666 } // namespace interpreter 666 } // namespace interpreter
667 } // namespace internal 667 } // namespace internal
668 } // namespace v8 668 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698