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

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

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: One more test. Created 5 years, 2 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 #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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // Pop the current context and replace with |context|. 93 // Pop the current context and replace with |context|.
94 BytecodeArrayBuilder& PopContext(Register context); 94 BytecodeArrayBuilder& PopContext(Register context);
95 95
96 // Call a JS function. The JSFunction or Callable to be called should be in 96 // Call a JS function. The JSFunction or Callable to be called should be in
97 // |callable|, the receiver should be in |receiver| and all subsequent 97 // |callable|, the receiver should be in |receiver| and all subsequent
98 // arguments should be in registers <receiver + 1> to 98 // arguments should be in registers <receiver + 1> to
99 // <receiver + 1 + arg_count>. 99 // <receiver + 1 + arg_count>.
100 BytecodeArrayBuilder& Call(Register callable, Register receiver, 100 BytecodeArrayBuilder& Call(Register callable, Register receiver,
101 size_t arg_count); 101 size_t arg_count);
102 102
103 // Call the new operator. The |constructor| register is followed by
104 // |arg_count| consecutive registers containing arguments to be
105 // applied to the constructor.
106 BytecodeArrayBuilder& New(Register constructor, Register first_arg,
107 size_t arg_count);
108
103 // Call the runtime function with |function_id|. The first argument should be 109 // Call the runtime function with |function_id|. The first argument should be
104 // in |first_arg| and all subsequent arguments should be in registers 110 // in |first_arg| and all subsequent arguments should be in registers
105 // <first_arg + 1> to <first_arg + 1 + arg_count>. 111 // <first_arg + 1> to <first_arg + 1 + arg_count>.
106 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, 112 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id,
107 Register first_arg, size_t arg_count); 113 Register first_arg, size_t arg_count);
108 114
109 // Operators (register == lhs, accumulator = rhs). 115 // Operators (register holds the lhs value, accumulator holds the rhs value).
110 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, 116 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg,
111 Strength strength); 117 Strength strength);
112 118
113 // Unary Operators. 119 // Unary Operators.
114 BytecodeArrayBuilder& LogicalNot(); 120 BytecodeArrayBuilder& LogicalNot();
115 BytecodeArrayBuilder& TypeOf(); 121 BytecodeArrayBuilder& TypeOf();
116 122
117 // Tests. 123 // Tests.
118 BytecodeArrayBuilder& CompareOperation(Token::Value op, Register reg, 124 BytecodeArrayBuilder& CompareOperation(Token::Value op, Register reg,
119 Strength strength); 125 Strength strength);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 265
260 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); 266 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope);
261 }; 267 };
262 268
263 269
264 } // namespace interpreter 270 } // namespace interpreter
265 } // namespace internal 271 } // namespace internal
266 } // namespace v8 272 } // namespace v8
267 273
268 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ 274 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698