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

Side by Side Diff: src/compiler/interpreter-assembler.cc

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix missing receiver slot. 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
« no previous file with comments | « src/compiler/interpreter-assembler.h ('k') | src/ia32/builtins-ia32.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/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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 kMachAnyTagged, RegisterFileRawPointer(), 310 kMachAnyTagged, RegisterFileRawPointer(),
311 IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer)); 311 IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer));
312 Node* shared_info = 312 Node* shared_info =
313 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset); 313 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset);
314 Node* vector = 314 Node* vector =
315 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset); 315 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset);
316 return vector; 316 return vector;
317 } 317 }
318 318
319 319
320 Node* InterpreterAssembler::CallConstruct(Node* original_constructor,
321 Node* constructor, Node* first_arg,
322 Node* arg_count) {
323 Callable callable = CodeFactory::InterpreterPushArgsAndConstruct(isolate());
324 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor(
325 isolate(), zone(), callable.descriptor(), 0, CallDescriptor::kNoFlags);
326
327 Node* code_target = HeapConstant(callable.code());
328
329 Node** args = zone()->NewArray<Node*>(5);
330 args[0] = arg_count;
331 args[1] = original_constructor;
332 args[2] = constructor;
333 args[3] = first_arg;
334 args[4] = GetContext();
335
336 return CallN(descriptor, code_target, args);
337 }
338
339
320 Node* InterpreterAssembler::CallN(CallDescriptor* descriptor, Node* code_target, 340 Node* InterpreterAssembler::CallN(CallDescriptor* descriptor, Node* code_target,
321 Node** args) { 341 Node** args) {
322 Node* stack_pointer_before_call = nullptr; 342 Node* stack_pointer_before_call = nullptr;
323 if (FLAG_debug_code) { 343 if (FLAG_debug_code) {
324 stack_pointer_before_call = raw_assembler_->LoadStackPointer(); 344 stack_pointer_before_call = raw_assembler_->LoadStackPointer();
325 } 345 }
326 Node* return_val = raw_assembler_->CallN(descriptor, code_target, args); 346 Node* return_val = raw_assembler_->CallN(descriptor, code_target, args);
327 if (FLAG_debug_code) { 347 if (FLAG_debug_code) {
328 Node* stack_pointer_after_call = raw_assembler_->LoadStackPointer(); 348 Node* stack_pointer_after_call = raw_assembler_->LoadStackPointer();
329 AbortIfWordNotEqual(stack_pointer_before_call, stack_pointer_after_call, 349 AbortIfWordNotEqual(stack_pointer_before_call, stack_pointer_after_call,
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 return raw_assembler_->schedule(); 606 return raw_assembler_->schedule();
587 } 607 }
588 608
589 609
590 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } 610 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); }
591 611
592 612
593 } // namespace compiler 613 } // namespace compiler
594 } // namespace internal 614 } // namespace internal
595 } // namespace v8 615 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/interpreter-assembler.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698