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

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

Issue 24250005: AllocationSites for all literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 2 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
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 Handle<Code> FastCloneShallowArrayStub::GenerateCode(Isolate* isolate) { 430 Handle<Code> FastCloneShallowArrayStub::GenerateCode(Isolate* isolate) {
431 return DoGenerateCode(isolate, this); 431 return DoGenerateCode(isolate, this);
432 } 432 }
433 433
434 434
435 template <> 435 template <>
436 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() { 436 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
437 Zone* zone = this->zone(); 437 Zone* zone = this->zone();
438 HValue* undefined = graph()->GetConstantUndefined(); 438 HValue* undefined = graph()->GetConstantUndefined();
439 439
440 HInstruction* boilerplate = Add<HLoadKeyed>(GetParameter(0), 440 HInstruction* allocation_site = Add<HLoadKeyed>(GetParameter(0),
441 GetParameter(1), 441 GetParameter(1),
442 static_cast<HValue*>(NULL), 442 static_cast<HValue*>(NULL),
443 FAST_ELEMENTS); 443 FAST_ELEMENTS);
444 444
445 IfBuilder checker(this); 445 IfBuilder checker(this);
446 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(boilerplate, 446 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site,
447 undefined); 447 undefined);
448 checker.And(); 448 checker.And();
449 449
450 HObjectAccess access = HObjectAccess::ForAllocationSiteTransitionInfo();
451 HInstruction* boilerplate = Add<HLoadNamedField>(allocation_site, access);
452
450 int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize; 453 int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize;
451 HValue* boilerplate_size = 454 HValue* boilerplate_size =
452 AddInstruction(new(zone) HInstanceSize(boilerplate)); 455 AddInstruction(new(zone) HInstanceSize(boilerplate));
453 HValue* size_in_words = Add<HConstant>(size >> kPointerSizeLog2); 456 HValue* size_in_words = Add<HConstant>(size >> kPointerSizeLog2);
454 checker.If<HCompareNumericAndBranch>(boilerplate_size, 457 checker.If<HCompareNumericAndBranch>(boilerplate_size,
455 size_in_words, Token::EQ); 458 size_in_words, Token::EQ);
456 checker.Then(); 459 checker.Then();
457 460
458 HValue* size_in_bytes = Add<HConstant>(size); 461 HValue* size_in_bytes = Add<HConstant>(size);
459 462
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 return js_function; 1235 return js_function;
1233 } 1236 }
1234 1237
1235 1238
1236 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { 1239 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) {
1237 return DoGenerateCode(isolate, this); 1240 return DoGenerateCode(isolate, this);
1238 } 1241 }
1239 1242
1240 1243
1241 } } // namespace v8::internal 1244 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698