OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 static Vector<const char> kRegexp = CStrVector("regexp"); | 245 static Vector<const char> kRegexp = CStrVector("regexp"); |
246 if (name->IsEqualTo(kRegexp)) | 246 if (name->IsEqualTo(kRegexp)) |
247 return true; | 247 return true; |
248 } | 248 } |
249 return false; | 249 return false; |
250 } | 250 } |
251 | 251 |
252 #endif | 252 #endif |
253 | 253 |
254 | 254 |
255 Handle<Code> CodeGenerator::ComputeCallInitialize( | |
256 int argc, | |
257 InLoopFlag in_loop) { | |
258 if (in_loop == IN_LOOP) { | |
259 // Force the creation of the corresponding stub outside loops, | |
260 // because it may be used when clearing the ICs later - it is | |
261 // possible for a series of IC transitions to lose the in-loop | |
262 // information, and the IC clearing code can't generate a stub | |
263 // that it needs so we need to ensure it is generated already. | |
264 ComputeCallInitialize(argc, NOT_IN_LOOP); | |
265 } | |
266 CALL_HEAP_FUNCTION( | |
267 StubCache::ComputeCallInitialize(argc, in_loop, Code::CALL_IC), | |
268 Code); | |
269 } | |
270 | |
271 | |
272 Handle<Code> CodeGenerator::ComputeKeyedCallInitialize( | |
273 int argc, | |
274 InLoopFlag in_loop) { | |
275 if (in_loop == IN_LOOP) { | |
276 // Force the creation of the corresponding stub outside loops, | |
277 // because it may be used when clearing the ICs later - it is | |
278 // possible for a series of IC transitions to lose the in-loop | |
279 // information, and the IC clearing code can't generate a stub | |
280 // that it needs so we need to ensure it is generated already. | |
281 ComputeKeyedCallInitialize(argc, NOT_IN_LOOP); | |
282 } | |
283 CALL_HEAP_FUNCTION( | |
284 StubCache::ComputeCallInitialize(argc, in_loop, Code::KEYED_CALL_IC), | |
285 Code); | |
286 } | |
287 | |
288 void CodeGenerator::ProcessDeclarations(ZoneList<Declaration*>* declarations) { | 255 void CodeGenerator::ProcessDeclarations(ZoneList<Declaration*>* declarations) { |
289 int length = declarations->length(); | 256 int length = declarations->length(); |
290 int globals = 0; | 257 int globals = 0; |
291 for (int i = 0; i < length; i++) { | 258 for (int i = 0; i < length; i++) { |
292 Declaration* node = declarations->at(i); | 259 Declaration* node = declarations->at(i); |
293 Variable* var = node->proxy()->var(); | 260 Variable* var = node->proxy()->var(); |
294 Slot* slot = var->AsSlot(); | 261 Slot* slot = var->AsSlot(); |
295 | 262 |
296 // If it was not possible to allocate the variable at compile | 263 // If it was not possible to allocate the variable at compile |
297 // time, we need to "declare" it at runtime to make sure it | 264 // time, we need to "declare" it at runtime to make sure it |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 int CEntryStub::MinorKey() { | 442 int CEntryStub::MinorKey() { |
476 ASSERT(result_size_ == 1 || result_size_ == 2); | 443 ASSERT(result_size_ == 1 || result_size_ == 2); |
477 #ifdef _WIN64 | 444 #ifdef _WIN64 |
478 return result_size_ == 1 ? 0 : 1; | 445 return result_size_ == 1 ? 0 : 1; |
479 #else | 446 #else |
480 return 0; | 447 return 0; |
481 #endif | 448 #endif |
482 } | 449 } |
483 | 450 |
484 | 451 |
485 // Implementation of CodeStub::GetCustomCache. | |
486 static bool GetCustomCacheHelper(Object* cache, Code** code_out) { | |
487 if (cache->IsUndefined()) { | |
488 return false; | |
489 } else { | |
490 *code_out = Code::cast(cache); | |
491 return true; | |
492 } | |
493 } | |
494 | |
495 | |
496 bool ApiGetterEntryStub::GetCustomCache(Code** code_out) { | |
497 return GetCustomCacheHelper(info()->load_stub_cache(), code_out); | |
498 } | |
499 | |
500 | |
501 void ApiGetterEntryStub::SetCustomCache(Code* value) { | |
502 info()->set_load_stub_cache(value); | |
503 } | |
504 | |
505 | |
506 bool ApiCallEntryStub::GetCustomCache(Code** code_out) { | |
507 return GetCustomCacheHelper(info()->call_stub_cache(), code_out); | |
508 } | |
509 | |
510 | |
511 void ApiCallEntryStub::SetCustomCache(Code* value) { | |
512 info()->set_call_stub_cache(value); | |
513 } | |
514 | |
515 | |
516 } } // namespace v8::internal | 452 } } // namespace v8::internal |
OLD | NEW |