| 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 HValue* boilerplate_size = | 418 HValue* boilerplate_size = |
| 419 AddInstruction(new(zone) HInstanceSize(boilerplate)); | 419 AddInstruction(new(zone) HInstanceSize(boilerplate)); |
| 420 HValue* size_in_words = Add<HConstant>(size >> kPointerSizeLog2); | 420 HValue* size_in_words = Add<HConstant>(size >> kPointerSizeLog2); |
| 421 checker.If<HCompareNumericAndBranch>(boilerplate_size, | 421 checker.If<HCompareNumericAndBranch>(boilerplate_size, |
| 422 size_in_words, Token::EQ); | 422 size_in_words, Token::EQ); |
| 423 checker.Then(); | 423 checker.Then(); |
| 424 | 424 |
| 425 HValue* size_in_bytes = Add<HConstant>(size); | 425 HValue* size_in_bytes = Add<HConstant>(size); |
| 426 | 426 |
| 427 HInstruction* object = Add<HAllocate>(size_in_bytes, HType::JSObject(), | 427 HInstruction* object = Add<HAllocate>(size_in_bytes, HType::JSObject(), |
| 428 isolate()->heap()->ShouldGloballyPretenure()); | 428 isolate()->heap()->GetPretenureMode(), JS_OBJECT_TYPE); |
| 429 | 429 |
| 430 for (int i = 0; i < size; i += kPointerSize) { | 430 for (int i = 0; i < size; i += kPointerSize) { |
| 431 HObjectAccess access = HObjectAccess::ForJSObjectOffset(i); | 431 HObjectAccess access = HObjectAccess::ForJSObjectOffset(i); |
| 432 Add<HStoreNamedField>(object, access, | 432 Add<HStoreNamedField>(object, access, |
| 433 Add<HLoadNamedField>(boilerplate, access)); | 433 Add<HLoadNamedField>(boilerplate, access)); |
| 434 } | 434 } |
| 435 | 435 |
| 436 environment()->Push(object); | 436 environment()->Push(object); |
| 437 checker.ElseDeopt(); | 437 checker.ElseDeopt(); |
| 438 checker.End(); | 438 checker.End(); |
| 439 | 439 |
| 440 return environment()->Pop(); | 440 return environment()->Pop(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 | 443 |
| 444 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { | 444 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { |
| 445 return DoGenerateCode(this); | 445 return DoGenerateCode(this); |
| 446 } | 446 } |
| 447 | 447 |
| 448 | 448 |
| 449 template <> | 449 template <> |
| 450 HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() { | 450 HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() { |
| 451 HValue* size = Add<HConstant>(AllocationSite::kSize); | 451 HValue* size = Add<HConstant>(AllocationSite::kSize); |
| 452 HInstruction* object = Add<HAllocate>(size, HType::JSObject(), true); | 452 HInstruction* object = Add<HAllocate>(size, HType::JSObject(), TENURED, |
| 453 JS_OBJECT_TYPE); |
| 453 | 454 |
| 454 // Store the map | 455 // Store the map |
| 455 Handle<Map> allocation_site_map(isolate()->heap()->allocation_site_map(), | 456 Handle<Map> allocation_site_map(isolate()->heap()->allocation_site_map(), |
| 456 isolate()); | 457 isolate()); |
| 457 AddStoreMapConstant(object, allocation_site_map); | 458 AddStoreMapConstant(object, allocation_site_map); |
| 458 | 459 |
| 459 // Store the payload (smi elements kind) | 460 // Store the payload (smi elements kind) |
| 460 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind()); | 461 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind()); |
| 461 Add<HStoreNamedField>(object, | 462 Add<HStoreNamedField>(object, |
| 462 HObjectAccess::ForAllocationSiteTransitionInfo(), | 463 HObjectAccess::ForAllocationSiteTransitionInfo(), |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 return value; | 935 return value; |
| 935 } | 936 } |
| 936 | 937 |
| 937 | 938 |
| 938 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { | 939 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { |
| 939 return DoGenerateCode(this); | 940 return DoGenerateCode(this); |
| 940 } | 941 } |
| 941 | 942 |
| 942 | 943 |
| 943 } } // namespace v8::internal | 944 } } // namespace v8::internal |
| OLD | NEW |