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

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

Issue 15763004: Replace tagged keys for fast access by smi, and use smi in boundscheck. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed comment Created 7 years, 7 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 | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { 411 Handle<Code> FastCloneShallowObjectStub::GenerateCode() {
412 return DoGenerateCode(this); 412 return DoGenerateCode(this);
413 } 413 }
414 414
415 415
416 template <> 416 template <>
417 HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() { 417 HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() {
418 HInstruction* load = BuildUncheckedMonomorphicElementAccess( 418 HInstruction* load = BuildUncheckedMonomorphicElementAccess(
419 GetParameter(0), GetParameter(1), NULL, NULL, 419 GetParameter(0), GetParameter(1), NULL, NULL,
420 casted_stub()->is_js_array(), casted_stub()->elements_kind(), 420 casted_stub()->is_js_array(), casted_stub()->elements_kind(),
421 false, NEVER_RETURN_HOLE, STANDARD_STORE, Representation::Tagged()); 421 false, NEVER_RETURN_HOLE, STANDARD_STORE, Representation::Smi());
422 return load; 422 return load;
423 } 423 }
424 424
425 425
426 Handle<Code> KeyedLoadFastElementStub::GenerateCode() { 426 Handle<Code> KeyedLoadFastElementStub::GenerateCode() {
427 return DoGenerateCode(this); 427 return DoGenerateCode(this);
428 } 428 }
429 429
430 430
431 template<> 431 template<>
(...skipping 25 matching lines...) Expand all
457 return DoGenerateCode(this); 457 return DoGenerateCode(this);
458 } 458 }
459 459
460 460
461 template <> 461 template <>
462 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { 462 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() {
463 BuildUncheckedMonomorphicElementAccess( 463 BuildUncheckedMonomorphicElementAccess(
464 GetParameter(0), GetParameter(1), GetParameter(2), NULL, 464 GetParameter(0), GetParameter(1), GetParameter(2), NULL,
465 casted_stub()->is_js_array(), casted_stub()->elements_kind(), 465 casted_stub()->is_js_array(), casted_stub()->elements_kind(),
466 true, NEVER_RETURN_HOLE, casted_stub()->store_mode(), 466 true, NEVER_RETURN_HOLE, casted_stub()->store_mode(),
467 Representation::Tagged()); 467 Representation::Smi());
468 468
469 return GetParameter(2); 469 return GetParameter(2);
470 } 470 }
471 471
472 472
473 Handle<Code> KeyedStoreFastElementStub::GenerateCode() { 473 Handle<Code> KeyedStoreFastElementStub::GenerateCode() {
474 return DoGenerateCode(this); 474 return DoGenerateCode(this);
475 } 475 }
476 476
477 477
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 581
582 HConstant* max_alloc_length = 582 HConstant* max_alloc_length =
583 new(zone()) HConstant(JSObject::kInitialMaxFastElementArray, 583 new(zone()) HConstant(JSObject::kInitialMaxFastElementArray,
584 Representation::Tagged()); 584 Representation::Tagged());
585 AddInstruction(max_alloc_length); 585 AddInstruction(max_alloc_length);
586 const int initial_capacity = JSArray::kPreallocatedArrayElements; 586 const int initial_capacity = JSArray::kPreallocatedArrayElements;
587 HConstant* initial_capacity_node = 587 HConstant* initial_capacity_node =
588 new(zone()) HConstant(initial_capacity, Representation::Tagged()); 588 new(zone()) HConstant(initial_capacity, Representation::Tagged());
589 AddInstruction(initial_capacity_node); 589 AddInstruction(initial_capacity_node);
590 590
591 // Since we're forcing Integer32 representation for this HBoundsCheck,
592 // there's no need to Smi-check the index.
593 HBoundsCheck* checked_arg = AddBoundsCheck(argument, max_alloc_length, 591 HBoundsCheck* checked_arg = AddBoundsCheck(argument, max_alloc_length,
594 ALLOW_SMI_KEY, 592 ALLOW_SMI_KEY,
595 Representation::Tagged()); 593 Representation::Smi());
596 IfBuilder if_builder(this); 594 IfBuilder if_builder(this);
597 if_builder.IfCompare(checked_arg, constant_zero, Token::EQ); 595 if_builder.IfCompare(checked_arg, constant_zero, Token::EQ);
598 if_builder.Then(); 596 if_builder.Then();
599 Push(initial_capacity_node); // capacity 597 Push(initial_capacity_node); // capacity
600 Push(constant_zero); // length 598 Push(constant_zero); // length
601 if_builder.Else(); 599 if_builder.Else();
602 Push(checked_arg); // capacity 600 Push(checked_arg); // capacity
603 Push(checked_arg); // length 601 Push(checked_arg); // length
604 if_builder.End(); 602 if_builder.End();
605 603
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 ? graph()->GetConstantSmi1() 692 ? graph()->GetConstantSmi1()
695 : graph()->GetConstantUndefined(); 693 : graph()->GetConstantUndefined();
696 } 694 }
697 695
698 696
699 Handle<Code> CompareNilICStub::GenerateCode() { 697 Handle<Code> CompareNilICStub::GenerateCode() {
700 return DoGenerateCode(this); 698 return DoGenerateCode(this);
701 } 699 }
702 700
703 } } // namespace v8::internal 701 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698