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

Side by Side Diff: src/interpreter/bytecode-array-builder.h

Issue 1422033002: [Interpreter] Add support for for..in. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes for 32-bit. Created 5 years, 1 month 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 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_
6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ 6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "src/ast.h" 10 #include "src/ast.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label); 178 BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label);
179 // TODO(mythria) The following two functions should be merged into 179 // TODO(mythria) The following two functions should be merged into
180 // JumpIfTrue/False. These bytecodes should be automatically chosen rather 180 // JumpIfTrue/False. These bytecodes should be automatically chosen rather
181 // than explicitly using them. 181 // than explicitly using them.
182 BytecodeArrayBuilder& JumpIfToBooleanTrue(BytecodeLabel* label); 182 BytecodeArrayBuilder& JumpIfToBooleanTrue(BytecodeLabel* label);
183 BytecodeArrayBuilder& JumpIfToBooleanFalse(BytecodeLabel* label); 183 BytecodeArrayBuilder& JumpIfToBooleanFalse(BytecodeLabel* label);
184 184
185 BytecodeArrayBuilder& Throw(); 185 BytecodeArrayBuilder& Throw();
186 BytecodeArrayBuilder& Return(); 186 BytecodeArrayBuilder& Return();
187 187
188 // Complex flow control.
189 BytecodeArrayBuilder& ForInPrepare();
190 BytecodeArrayBuilder& ForInNext(Register for_in_state);
191 BytecodeArrayBuilder& ForInDone(Register for_in_state);
192
188 BytecodeArrayBuilder& EnterBlock(); 193 BytecodeArrayBuilder& EnterBlock();
189 BytecodeArrayBuilder& LeaveBlock(); 194 BytecodeArrayBuilder& LeaveBlock();
190 195
191 // Accessors 196 // Accessors
192 Zone* zone() const { return zone_; } 197 Zone* zone() const { return zone_; }
193 198
194 private: 199 private:
195 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; } 200 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; }
196 const ZoneVector<uint8_t>* bytecodes() const { return &bytecodes_; } 201 const ZoneVector<uint8_t>* bytecodes() const { return &bytecodes_; }
197 Isolate* isolate() const { return isolate_; } 202 Isolate* isolate() const { return isolate_; }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 280
276 private: 281 private:
277 static const size_t kInvalidOffset = static_cast<size_t>(-1); 282 static const size_t kInvalidOffset = static_cast<size_t>(-1);
278 283
279 INLINE(void bind_to(size_t offset)) { 284 INLINE(void bind_to(size_t offset)) {
280 DCHECK(!bound_ && offset != kInvalidOffset); 285 DCHECK(!bound_ && offset != kInvalidOffset);
281 offset_ = offset; 286 offset_ = offset;
282 bound_ = true; 287 bound_ = true;
283 } 288 }
284 INLINE(void set_referrer(size_t offset)) { 289 INLINE(void set_referrer(size_t offset)) {
285 DCHECK(!bound_ && offset != kInvalidOffset); 290 DCHECK(!bound_ && offset != kInvalidOffset && offset_ == kInvalidOffset);
286 offset_ = offset; 291 offset_ = offset;
287 } 292 }
288 INLINE(size_t offset() const) { return offset_; } 293 INLINE(size_t offset() const) { return offset_; }
289 INLINE(bool is_bound() const) { return bound_; } 294 INLINE(bool is_bound() const) { return bound_; }
290 INLINE(bool is_forward_target() const) { 295 INLINE(bool is_forward_target() const) {
291 return offset() != kInvalidOffset && !is_bound(); 296 return offset() != kInvalidOffset && !is_bound();
292 } 297 }
293 298
294 // There are three states for a label: 299 // There are three states for a label:
295 // bound_ offset_ 300 // bound_ offset_
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 333
329 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); 334 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope);
330 }; 335 };
331 336
332 337
333 } // namespace interpreter 338 } // namespace interpreter
334 } // namespace internal 339 } // namespace internal
335 } // namespace v8 340 } // namespace v8
336 341
337 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ 342 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698