Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 21074004: Cleaning up HAllocate space and double alignment selection. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/heap.h » ('j') | src/heap.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 HValue* size_in_words = 430 HValue* size_in_words =
431 AddInstruction(new(zone) HConstant(size >> kPointerSizeLog2)); 431 AddInstruction(new(zone) HConstant(size >> kPointerSizeLog2));
432 checker.If<HCompareNumericAndBranch>(boilerplate_size, 432 checker.If<HCompareNumericAndBranch>(boilerplate_size,
433 size_in_words, Token::EQ); 433 size_in_words, Token::EQ);
434 checker.Then(); 434 checker.Then();
435 435
436 HValue* size_in_bytes = AddInstruction(new(zone) HConstant(size)); 436 HValue* size_in_bytes = AddInstruction(new(zone) HConstant(size));
437 437
438 HInstruction* object = AddInstruction(new(zone) 438 HInstruction* object = AddInstruction(new(zone)
439 HAllocate(context(), size_in_bytes, HType::JSObject(), 439 HAllocate(context(), size_in_bytes, HType::JSObject(),
440 isolate()->heap()->ShouldGloballyPretenure())); 440 isolate()->heap()->GetAllocationMode(), JS_OBJECT_TYPE));
441 441
442 for (int i = 0; i < size; i += kPointerSize) { 442 for (int i = 0; i < size; i += kPointerSize) {
443 HObjectAccess access = HObjectAccess::ForJSObjectOffset(i); 443 HObjectAccess access = HObjectAccess::ForJSObjectOffset(i);
444 AddStore(object, access, AddLoad(boilerplate, access)); 444 AddStore(object, access, AddLoad(boilerplate, access));
445 } 445 }
446 446
447 environment()->Push(object); 447 environment()->Push(object);
448 checker.ElseDeopt(); 448 checker.ElseDeopt();
449 checker.End(); 449 checker.End();
450 450
451 return environment()->Pop(); 451 return environment()->Pop();
452 } 452 }
453 453
454 454
455 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { 455 Handle<Code> FastCloneShallowObjectStub::GenerateCode() {
456 return DoGenerateCode(this); 456 return DoGenerateCode(this);
457 } 457 }
458 458
459 459
460 template <> 460 template <>
461 HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() { 461 HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() {
462 Zone* zone = this->zone(); 462 Zone* zone = this->zone();
463 463
464 HValue* size = AddInstruction(new(zone) HConstant(AllocationSite::kSize)); 464 HValue* size = AddInstruction(new(zone) HConstant(AllocationSite::kSize));
465 HInstruction* object = AddInstruction(new(zone) 465 HInstruction* object = AddInstruction(new(zone)
466 HAllocate(context(), size, HType::JSObject(), true)); 466 HAllocate(context(), size, HType::JSObject(), OLD_SPACE_ALLOCATION,
467 JS_OBJECT_TYPE));
467 468
468 // Store the map 469 // Store the map
469 Handle<Map> allocation_site_map(isolate()->heap()->allocation_site_map(), 470 Handle<Map> allocation_site_map(isolate()->heap()->allocation_site_map(),
470 isolate()); 471 isolate());
471 AddStoreMapConstant(object, allocation_site_map); 472 AddStoreMapConstant(object, allocation_site_map);
472 473
473 // Store the payload (smi elements kind) 474 // Store the payload (smi elements kind)
474 HValue* initial_elements_kind = AddInstruction(new(zone) HConstant( 475 HValue* initial_elements_kind = AddInstruction(new(zone) HConstant(
475 GetInitialFastElementsKind())); 476 GetInitialFastElementsKind()));
476 Add<HStoreNamedField>(object, 477 Add<HStoreNamedField>(object,
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 return value; 952 return value;
952 } 953 }
953 954
954 955
955 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { 956 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() {
956 return DoGenerateCode(this); 957 return DoGenerateCode(this);
957 } 958 }
958 959
959 960
960 } } // namespace v8::internal 961 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap.h » ('j') | src/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698