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

Side by Side Diff: src/hydrogen.cc

Issue 859783002: add stub for api function calls with known number of parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 11 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/code-stubs.h ('k') | src/ia32/code-stubs-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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 8758 matching lines...) Expand 10 before | Expand all | Expand 10 after
8769 HInstruction* call = nullptr; 8769 HInstruction* call = nullptr;
8770 if (!is_function) { 8770 if (!is_function) {
8771 CallApiAccessorStub stub(isolate(), is_store, call_data_undefined); 8771 CallApiAccessorStub stub(isolate(), is_store, call_data_undefined);
8772 Handle<Code> code = stub.GetCode(); 8772 Handle<Code> code = stub.GetCode();
8773 HConstant* code_value = Add<HConstant>(code); 8773 HConstant* code_value = Add<HConstant>(code);
8774 ApiAccessorDescriptor descriptor(isolate()); 8774 ApiAccessorDescriptor descriptor(isolate());
8775 DCHECK(arraysize(op_vals) - 1 == descriptor.GetEnvironmentLength()); 8775 DCHECK(arraysize(op_vals) - 1 == descriptor.GetEnvironmentLength());
8776 call = New<HCallWithDescriptor>( 8776 call = New<HCallWithDescriptor>(
8777 code_value, argc + 1, descriptor, 8777 code_value, argc + 1, descriptor,
8778 Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength())); 8778 Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength()));
8779 } else if (argc <= CallApiFunctionWithFixedArgsStub::kMaxFixedArgs) {
8780 CallApiFunctionWithFixedArgsStub stub(isolate(), argc, call_data_undefined);
8781 Handle<Code> code = stub.GetCode();
8782 HConstant* code_value = Add<HConstant>(code);
8783 ApiFunctionWithFixedArgsDescriptor descriptor(isolate());
8784 DCHECK(arraysize(op_vals) - 1 == descriptor.GetEnvironmentLength());
8785 call = New<HCallWithDescriptor>(
8786 code_value, argc + 1, descriptor,
8787 Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength()));
8788 Drop(1); // Drop function.
8779 } else { 8789 } else {
8780 op_vals[arraysize(op_vals) - 1] = Add<HConstant>(argc); 8790 op_vals[arraysize(op_vals) - 1] = Add<HConstant>(argc);
8781 CallApiFunctionStub stub(isolate(), call_data_undefined); 8791 CallApiFunctionStub stub(isolate(), call_data_undefined);
8782 Handle<Code> code = stub.GetCode(); 8792 Handle<Code> code = stub.GetCode();
8783 HConstant* code_value = Add<HConstant>(code); 8793 HConstant* code_value = Add<HConstant>(code);
8784 ApiFunctionDescriptor descriptor(isolate()); 8794 ApiFunctionDescriptor descriptor(isolate());
8785 DCHECK(arraysize(op_vals) == descriptor.GetEnvironmentLength()); 8795 DCHECK(arraysize(op_vals) == descriptor.GetEnvironmentLength());
8786 call = New<HCallWithDescriptor>( 8796 call = New<HCallWithDescriptor>(
8787 code_value, argc + 1, descriptor, 8797 code_value, argc + 1, descriptor,
8788 Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength())); 8798 Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength()));
(...skipping 4668 matching lines...) Expand 10 before | Expand all | Expand 10 after
13457 if (ShouldProduceTraceOutput()) { 13467 if (ShouldProduceTraceOutput()) {
13458 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13468 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13459 } 13469 }
13460 13470
13461 #ifdef DEBUG 13471 #ifdef DEBUG
13462 graph_->Verify(false); // No full verify. 13472 graph_->Verify(false); // No full verify.
13463 #endif 13473 #endif
13464 } 13474 }
13465 13475
13466 } } // namespace v8::internal 13476 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698