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

Side by Side Diff: src/interface-descriptors.cc

Issue 517993002: Refactoring InterfaceDescriptors away from code-stubs.h (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/interface-descriptors.h ('k') | src/isolate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/v8.h"
6
7 #include "src/interface-descriptors.h"
8
9 namespace v8 {
10 namespace internal {
11
12 InterfaceDescriptor::InterfaceDescriptor() : register_param_count_(-1) {}
13
14
15 void InterfaceDescriptor::Initialize(
16 int register_parameter_count, Register* registers,
17 Representation* register_param_representations,
18 PlatformInterfaceDescriptor* platform_descriptor) {
19 platform_specific_descriptor_ = platform_descriptor;
20 register_param_count_ = register_parameter_count;
21
22 // An interface descriptor must have a context register.
23 DCHECK(register_parameter_count > 0 && registers[0].is(ContextRegister()));
24
25 // InterfaceDescriptor owns a copy of the registers array.
26 register_params_.Reset(NewArray<Register>(register_parameter_count));
27 for (int i = 0; i < register_parameter_count; i++) {
28 register_params_[i] = registers[i];
29 }
30
31 // If a representations array is specified, then the descriptor owns that as
32 // well.
33 if (register_param_representations != NULL) {
34 register_param_representations_.Reset(
35 NewArray<Representation>(register_parameter_count));
36 for (int i = 0; i < register_parameter_count; i++) {
37 // If there is a context register, the representation must be tagged.
38 DCHECK(
39 i != 0 ||
40 register_param_representations[i].Equals(Representation::Tagged()));
41 register_param_representations_[i] = register_param_representations[i];
42 }
43 }
44 }
45
46
47 void CallInterfaceDescriptor::Initialize(
48 int register_parameter_count, Register* registers,
49 Representation* param_representations,
50 PlatformInterfaceDescriptor* platform_descriptor) {
51 InterfaceDescriptor::Initialize(register_parameter_count, registers,
52 param_representations, platform_descriptor);
53 }
54 }
55 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/interface-descriptors.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698