OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 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 | 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 return Smi::FromInt(0); | 24 return Smi::FromInt(0); |
25 } | 25 } |
26 | 26 |
27 | 27 |
28 CodeStubDescriptor::CodeStubDescriptor(CodeStub* stub) | 28 CodeStubDescriptor::CodeStubDescriptor(CodeStub* stub) |
29 : call_descriptor_(stub->GetCallInterfaceDescriptor()), | 29 : call_descriptor_(stub->GetCallInterfaceDescriptor()), |
30 stack_parameter_count_(no_reg), | 30 stack_parameter_count_(no_reg), |
31 hint_stack_parameter_count_(-1), | 31 hint_stack_parameter_count_(-1), |
32 function_mode_(NOT_JS_FUNCTION_STUB_MODE), | 32 function_mode_(NOT_JS_FUNCTION_STUB_MODE), |
33 deoptimization_handler_(NULL), | 33 deoptimization_handler_(NULL), |
34 handler_arguments_mode_(DONT_PASS_ARGUMENTS), | |
35 miss_handler_(), | 34 miss_handler_(), |
36 has_miss_handler_(false) { | 35 has_miss_handler_(false) { |
37 stub->InitializeDescriptor(this); | 36 stub->InitializeDescriptor(this); |
38 } | 37 } |
39 | 38 |
40 | 39 |
41 CodeStubDescriptor::CodeStubDescriptor(Isolate* isolate, uint32_t stub_key) | 40 CodeStubDescriptor::CodeStubDescriptor(Isolate* isolate, uint32_t stub_key) |
42 : stack_parameter_count_(no_reg), | 41 : stack_parameter_count_(no_reg), |
43 hint_stack_parameter_count_(-1), | 42 hint_stack_parameter_count_(-1), |
44 function_mode_(NOT_JS_FUNCTION_STUB_MODE), | 43 function_mode_(NOT_JS_FUNCTION_STUB_MODE), |
45 deoptimization_handler_(NULL), | 44 deoptimization_handler_(NULL), |
46 handler_arguments_mode_(DONT_PASS_ARGUMENTS), | |
47 miss_handler_(), | 45 miss_handler_(), |
48 has_miss_handler_(false) { | 46 has_miss_handler_(false) { |
49 CodeStub::InitializeDescriptor(isolate, stub_key, this); | 47 CodeStub::InitializeDescriptor(isolate, stub_key, this); |
50 } | 48 } |
51 | 49 |
52 | 50 |
53 void CodeStubDescriptor::Initialize(Address deoptimization_handler, | 51 void CodeStubDescriptor::Initialize(Address deoptimization_handler, |
54 int hint_stack_parameter_count, | 52 int hint_stack_parameter_count, |
55 StubFunctionMode function_mode) { | 53 StubFunctionMode function_mode) { |
56 deoptimization_handler_ = deoptimization_handler; | 54 deoptimization_handler_ = deoptimization_handler; |
57 hint_stack_parameter_count_ = hint_stack_parameter_count; | 55 hint_stack_parameter_count_ = hint_stack_parameter_count; |
58 function_mode_ = function_mode; | 56 function_mode_ = function_mode; |
59 } | 57 } |
60 | 58 |
61 | 59 |
62 void CodeStubDescriptor::Initialize(Register stack_parameter_count, | 60 void CodeStubDescriptor::Initialize(Register stack_parameter_count, |
63 Address deoptimization_handler, | 61 Address deoptimization_handler, |
64 int hint_stack_parameter_count, | 62 int hint_stack_parameter_count, |
65 StubFunctionMode function_mode, | 63 StubFunctionMode function_mode) { |
66 HandlerArgumentsMode handler_mode) { | |
67 Initialize(deoptimization_handler, hint_stack_parameter_count, function_mode); | 64 Initialize(deoptimization_handler, hint_stack_parameter_count, function_mode); |
68 stack_parameter_count_ = stack_parameter_count; | 65 stack_parameter_count_ = stack_parameter_count; |
69 handler_arguments_mode_ = handler_mode; | |
70 } | 66 } |
71 | 67 |
72 | 68 |
73 bool CodeStub::FindCodeInCache(Code** code_out) { | 69 bool CodeStub::FindCodeInCache(Code** code_out) { |
74 UnseededNumberDictionary* stubs = isolate()->heap()->code_stubs(); | 70 UnseededNumberDictionary* stubs = isolate()->heap()->code_stubs(); |
75 int index = stubs->FindEntry(GetKey()); | 71 int index = stubs->FindEntry(GetKey()); |
76 if (index != UnseededNumberDictionary::kNotFound) { | 72 if (index != UnseededNumberDictionary::kNotFound) { |
77 *code_out = Code::cast(stubs->ValueAt(index)); | 73 *code_out = Code::cast(stubs->ValueAt(index)); |
78 return true; | 74 return true; |
79 } | 75 } |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 | 1080 |
1085 if (type->Is(Type::UntaggedPointer())) { | 1081 if (type->Is(Type::UntaggedPointer())) { |
1086 return Representation::External(); | 1082 return Representation::External(); |
1087 } | 1083 } |
1088 | 1084 |
1089 DCHECK(!type->Is(Type::Untagged())); | 1085 DCHECK(!type->Is(Type::Untagged())); |
1090 return Representation::Tagged(); | 1086 return Representation::Tagged(); |
1091 } | 1087 } |
1092 } // namespace internal | 1088 } // namespace internal |
1093 } // namespace v8 | 1089 } // namespace v8 |
OLD | NEW |