OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 return GetCodeWithFlags(flags, name); | 1135 return GetCodeWithFlags(flags, name); |
1136 } | 1136 } |
1137 | 1137 |
1138 | 1138 |
1139 Object* KeyedStoreStubCompiler::GetCode(PropertyType type, String* name) { | 1139 Object* KeyedStoreStubCompiler::GetCode(PropertyType type, String* name) { |
1140 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_STORE_IC, type); | 1140 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_STORE_IC, type); |
1141 return GetCodeWithFlags(flags, name); | 1141 return GetCodeWithFlags(flags, name); |
1142 } | 1142 } |
1143 | 1143 |
1144 | 1144 |
| 1145 Object* CallStubCompiler::CompileCustomCall(int generator_id, |
| 1146 Object* object, |
| 1147 JSObject* holder, |
| 1148 JSFunction* function, |
| 1149 String* fname, |
| 1150 CheckType check) { |
| 1151 ASSERT(generator_id >= 0 && generator_id < kNumCallGenerators); |
| 1152 switch (generator_id) { |
| 1153 #define CALL_GENERATOR_CASE(ignored1, ignored2, name) \ |
| 1154 case k##name##CallGenerator: \ |
| 1155 return CallStubCompiler::Compile##name##Call(object, \ |
| 1156 holder, \ |
| 1157 function, \ |
| 1158 fname, \ |
| 1159 check); |
| 1160 CUSTOM_CALL_IC_GENERATORS(CALL_GENERATOR_CASE) |
| 1161 #undef CALL_GENERATOR_CASE |
| 1162 } |
| 1163 UNREACHABLE(); |
| 1164 return Heap::undefined_value(); |
| 1165 } |
| 1166 |
| 1167 |
1145 Object* CallStubCompiler::GetCode(PropertyType type, String* name) { | 1168 Object* CallStubCompiler::GetCode(PropertyType type, String* name) { |
1146 int argc = arguments_.immediate(); | 1169 int argc = arguments_.immediate(); |
1147 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::CALL_IC, | 1170 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::CALL_IC, |
1148 type, | 1171 type, |
1149 in_loop_, | 1172 in_loop_, |
1150 argc); | 1173 argc); |
1151 return GetCodeWithFlags(flags, name); | 1174 return GetCodeWithFlags(flags, name); |
1152 } | 1175 } |
1153 | 1176 |
1154 | 1177 |
| 1178 Object* CallStubCompiler::GetCode(JSFunction* function) { |
| 1179 String* function_name = NULL; |
| 1180 if (function->shared()->name()->IsString()) { |
| 1181 function_name = String::cast(function->shared()->name()); |
| 1182 } |
| 1183 return GetCode(CONSTANT_FUNCTION, function_name); |
| 1184 } |
| 1185 |
| 1186 |
1155 Object* ConstructStubCompiler::GetCode() { | 1187 Object* ConstructStubCompiler::GetCode() { |
1156 Code::Flags flags = Code::ComputeFlags(Code::STUB); | 1188 Code::Flags flags = Code::ComputeFlags(Code::STUB); |
1157 Object* result = GetCodeWithFlags(flags, "ConstructStub"); | 1189 Object* result = GetCodeWithFlags(flags, "ConstructStub"); |
1158 if (!result->IsFailure()) { | 1190 if (!result->IsFailure()) { |
1159 Code* code = Code::cast(result); | 1191 Code* code = Code::cast(result); |
1160 USE(code); | 1192 USE(code); |
1161 PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, "ConstructStub")); | 1193 PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, "ConstructStub")); |
1162 } | 1194 } |
1163 return result; | 1195 return result; |
1164 } | 1196 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 expected_receiver_type_ = | 1257 expected_receiver_type_ = |
1226 FunctionTemplateInfo::cast(signature->receiver()); | 1258 FunctionTemplateInfo::cast(signature->receiver()); |
1227 } | 1259 } |
1228 } | 1260 } |
1229 | 1261 |
1230 is_simple_api_call_ = true; | 1262 is_simple_api_call_ = true; |
1231 } | 1263 } |
1232 | 1264 |
1233 | 1265 |
1234 } } // namespace v8::internal | 1266 } } // namespace v8::internal |
OLD | NEW |