| OLD | NEW |
| 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/interpreter-assembler.h" | 5 #include "src/compiler/interpreter-assembler.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 Node* shared_info = | 262 Node* shared_info = |
| 263 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset); | 263 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset); |
| 264 Node* vector = | 264 Node* vector = |
| 265 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset); | 265 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset); |
| 266 return vector; | 266 return vector; |
| 267 } | 267 } |
| 268 | 268 |
| 269 | 269 |
| 270 Node* InterpreterAssembler::CallJS(Node* function, Node* first_arg, | 270 Node* InterpreterAssembler::CallJS(Node* function, Node* first_arg, |
| 271 Node* arg_count) { | 271 Node* arg_count) { |
| 272 Callable builtin = CodeFactory::PushArgsAndCall(isolate()); | 272 Callable builtin = CodeFactory::InterpreterPushArgsAndCall(isolate()); |
| 273 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( | 273 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( |
| 274 isolate(), zone(), builtin.descriptor(), 0, CallDescriptor::kNoFlags); | 274 isolate(), zone(), builtin.descriptor(), 0, CallDescriptor::kNoFlags); |
| 275 | 275 |
| 276 Node* code_target = HeapConstant(builtin.code()); | 276 Node* code_target = HeapConstant(builtin.code()); |
| 277 | 277 |
| 278 Node** args = zone()->NewArray<Node*>(4); | 278 Node** args = zone()->NewArray<Node*>(4); |
| 279 args[0] = arg_count; | 279 args[0] = arg_count; |
| 280 args[1] = first_arg; | 280 args[1] = first_arg; |
| 281 args[2] = function; | 281 args[2] = function; |
| 282 args[3] = ContextTaggedPointer(); | 282 args[3] = ContextTaggedPointer(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 313 args[0] = arg1; | 313 args[0] = arg1; |
| 314 args[1] = arg2; | 314 args[1] = arg2; |
| 315 args[2] = arg3; | 315 args[2] = arg3; |
| 316 args[3] = arg4; | 316 args[3] = arg4; |
| 317 args[4] = arg5; | 317 args[4] = arg5; |
| 318 args[5] = ContextTaggedPointer(); | 318 args[5] = ContextTaggedPointer(); |
| 319 return CallIC(descriptor, target, args); | 319 return CallIC(descriptor, target, args); |
| 320 } | 320 } |
| 321 | 321 |
| 322 | 322 |
| 323 Node* InterpreterAssembler::CallRuntime(Node* function_id, Node* first_arg, |
| 324 Node* arg_count) { |
| 325 Callable builtin = CodeFactory::InterpreterCEntry(isolate()); |
| 326 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( |
| 327 isolate(), zone(), builtin.descriptor(), 0, CallDescriptor::kNoFlags); |
| 328 |
| 329 Node* code_target = HeapConstant(builtin.code()); |
| 330 |
| 331 Node** args = zone()->NewArray<Node*>(4); |
| 332 args[0] = arg_count; |
| 333 args[1] = first_arg; |
| 334 args[2] = function_id; |
| 335 args[3] = ContextTaggedPointer(); |
| 336 |
| 337 return raw_assembler_->CallN(descriptor, code_target, args); |
| 338 } |
| 339 |
| 340 |
| 323 Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id, | 341 Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id, |
| 324 Node* arg1) { | 342 Node* arg1) { |
| 325 return raw_assembler_->CallRuntime1(function_id, arg1, | 343 return raw_assembler_->CallRuntime1(function_id, arg1, |
| 326 ContextTaggedPointer()); | 344 ContextTaggedPointer()); |
| 327 } | 345 } |
| 328 | 346 |
| 329 | 347 |
| 330 Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id, | 348 Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id, |
| 331 Node* arg1, Node* arg2) { | 349 Node* arg1, Node* arg2) { |
| 332 return raw_assembler_->CallRuntime2(function_id, arg1, arg2, | 350 return raw_assembler_->CallRuntime2(function_id, arg1, arg2, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 return raw_assembler_->schedule(); | 466 return raw_assembler_->schedule(); |
| 449 } | 467 } |
| 450 | 468 |
| 451 | 469 |
| 452 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 470 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
| 453 | 471 |
| 454 | 472 |
| 455 } // namespace interpreter | 473 } // namespace interpreter |
| 456 } // namespace internal | 474 } // namespace internal |
| 457 } // namespace v8 | 475 } // namespace v8 |
| OLD | NEW |