OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 return environment()->Pop(); | 469 return environment()->Pop(); |
470 } | 470 } |
471 | 471 |
472 | 472 |
473 Handle<Code> FastCloneShallowObjectStub::GenerateCode(Isolate* isolate) { | 473 Handle<Code> FastCloneShallowObjectStub::GenerateCode(Isolate* isolate) { |
474 return DoGenerateCode(isolate, this); | 474 return DoGenerateCode(isolate, this); |
475 } | 475 } |
476 | 476 |
477 | 477 |
478 template <> | 478 template <> |
479 HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() { | |
480 HValue* size = Add<HConstant>(AllocationSite::kSize); | |
481 HInstruction* object = Add<HAllocate>(size, HType::JSObject(), TENURED, | |
482 JS_OBJECT_TYPE); | |
483 | |
484 // Store the map | |
485 Handle<Map> allocation_site_map = isolate()->factory()->allocation_site_map(); | |
486 AddStoreMapConstant(object, allocation_site_map); | |
487 | |
488 // Store the payload (smi elements kind) | |
489 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind()); | |
490 Add<HStoreNamedField>(object, | |
491 HObjectAccess::ForAllocationSiteOffset( | |
492 AllocationSite::kTransitionInfoOffset), | |
493 initial_elements_kind); | |
494 | |
495 // Unlike literals, constructed arrays don't have nested sites | |
496 Add<HStoreNamedField>(object, | |
497 HObjectAccess::ForAllocationSiteOffset( | |
498 AllocationSite::kNestedSiteOffset), | |
499 graph()->GetConstant0()); | |
500 | |
501 // Pretenuring calculation field. | |
502 Add<HStoreNamedField>(object, | |
503 HObjectAccess::ForAllocationSiteOffset( | |
504 AllocationSite::kPretenureDataOffset), | |
505 graph()->GetConstant0()); | |
506 | |
507 // Pretenuring memento creation count field. | |
508 Add<HStoreNamedField>(object, | |
509 HObjectAccess::ForAllocationSiteOffset( | |
510 AllocationSite::kPretenureCreateCountOffset), | |
511 graph()->GetConstant0()); | |
512 | |
513 // Store an empty fixed array for the code dependency. | |
514 HConstant* empty_fixed_array = | |
515 Add<HConstant>(isolate()->factory()->empty_fixed_array()); | |
516 HStoreNamedField* store = Add<HStoreNamedField>( | |
517 object, | |
518 HObjectAccess::ForAllocationSiteOffset( | |
519 AllocationSite::kDependentCodeOffset), | |
520 empty_fixed_array); | |
521 | |
522 // Link the object to the allocation site list | |
523 HValue* site_list = Add<HConstant>( | |
524 ExternalReference::allocation_sites_list_address(isolate())); | |
525 HValue* site = Add<HLoadNamedField>( | |
526 site_list, static_cast<HValue*>(NULL), | |
527 HObjectAccess::ForAllocationSiteList()); | |
528 store = Add<HStoreNamedField>(object, | |
529 HObjectAccess::ForAllocationSiteOffset(AllocationSite::kWeakNextOffset), | |
530 site); | |
531 store->SkipWriteBarrier(); | |
532 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(), | |
533 object); | |
534 | |
535 HInstruction* feedback_vector = GetParameter(0); | |
536 HInstruction* slot = GetParameter(1); | |
537 Add<HStoreKeyed>(feedback_vector, slot, object, FAST_ELEMENTS, | |
538 INITIALIZING_STORE); | |
539 return feedback_vector; | |
540 } | |
541 | |
542 | |
543 Handle<Code> CreateAllocationSiteStub::GenerateCode(Isolate* isolate) { | |
544 return DoGenerateCode(isolate, this); | |
545 } | |
546 | |
547 | |
548 template <> | |
549 HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() { | 479 HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() { |
550 HInstruction* load = BuildUncheckedMonomorphicElementAccess( | 480 HInstruction* load = BuildUncheckedMonomorphicElementAccess( |
551 GetParameter(0), GetParameter(1), NULL, | 481 GetParameter(0), GetParameter(1), NULL, |
552 casted_stub()->is_js_array(), casted_stub()->elements_kind(), | 482 casted_stub()->is_js_array(), casted_stub()->elements_kind(), |
553 LOAD, NEVER_RETURN_HOLE, STANDARD_STORE); | 483 LOAD, NEVER_RETURN_HOLE, STANDARD_STORE); |
554 return load; | 484 return load; |
555 } | 485 } |
556 | 486 |
557 | 487 |
558 Handle<Code> KeyedLoadFastElementStub::GenerateCode(Isolate* isolate) { | 488 Handle<Code> KeyedLoadFastElementStub::GenerateCode(Isolate* isolate) { |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 return BuildRegExpConstructResult(length, index, input); | 1327 return BuildRegExpConstructResult(length, index, input); |
1398 } | 1328 } |
1399 | 1329 |
1400 | 1330 |
1401 Handle<Code> RegExpConstructResultStub::GenerateCode(Isolate* isolate) { | 1331 Handle<Code> RegExpConstructResultStub::GenerateCode(Isolate* isolate) { |
1402 return DoGenerateCode(isolate, this); | 1332 return DoGenerateCode(isolate, this); |
1403 } | 1333 } |
1404 | 1334 |
1405 | 1335 |
1406 } } // namespace v8::internal | 1336 } } // namespace v8::internal |
OLD | NEW |