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

Side by Side Diff: src/hydrogen.cc

Issue 16206004: Add smi support to all binops minus shr, sar, shl, div and mod. (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 | « src/flag-definitions.h ('k') | src/hydrogen-canonicalize.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 HValue* HGraphBuilder::JSArrayBuilder::EstablishAllocationSize( 1873 HValue* HGraphBuilder::JSArrayBuilder::EstablishAllocationSize(
1874 HValue* length_node) { 1874 HValue* length_node) {
1875 HValue* context = builder()->environment()->LookupContext(); 1875 HValue* context = builder()->environment()->LookupContext();
1876 ASSERT(length_node != NULL); 1876 ASSERT(length_node != NULL);
1877 1877
1878 int base_size = JSArray::kSize; 1878 int base_size = JSArray::kSize;
1879 if (mode_ == TRACK_ALLOCATION_SITE) { 1879 if (mode_ == TRACK_ALLOCATION_SITE) {
1880 base_size += AllocationMemento::kSize; 1880 base_size += AllocationMemento::kSize;
1881 } 1881 }
1882 1882
1883 if (IsFastDoubleElementsKind(kind_)) { 1883 STATIC_ASSERT(FixedDoubleArray::kHeaderSize == FixedArray::kHeaderSize);
1884 base_size += FixedDoubleArray::kHeaderSize; 1884 base_size += FixedArray::kHeaderSize;
1885 } else {
1886 base_size += FixedArray::kHeaderSize;
1887 }
1888 1885
1889 HInstruction* elements_size_value = 1886 HInstruction* elements_size_value =
1890 builder()->Add<HConstant>(elements_size()); 1887 builder()->Add<HConstant>(elements_size());
1891 HInstruction* mul = HMul::New(zone(), context, length_node, 1888 HInstruction* mul = HMul::New(zone(), context, length_node,
1892 elements_size_value); 1889 elements_size_value);
1893 mul->ClearFlag(HValue::kCanOverflow); 1890 mul->ClearFlag(HValue::kCanOverflow);
1894 builder()->AddInstruction(mul); 1891 builder()->AddInstruction(mul);
1895 1892
1896 HInstruction* base = builder()->Add<HConstant>(base_size); 1893 HInstruction* base = builder()->Add<HConstant>(base_size);
1897 HInstruction* total_size = HAdd::New(zone(), context, base, mul); 1894 HInstruction* total_size = HAdd::New(zone(), context, base, mul);
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after
3790 JoinContinue(stmt, current_block(), break_info.continue_block()); 3787 JoinContinue(stmt, current_block(), break_info.continue_block());
3791 3788
3792 if (body_exit != NULL) { 3789 if (body_exit != NULL) {
3793 set_current_block(body_exit); 3790 set_current_block(body_exit);
3794 3791
3795 HValue* current_index = Pop(); 3792 HValue* current_index = Pop();
3796 HInstruction* new_index = HAdd::New(zone(), 3793 HInstruction* new_index = HAdd::New(zone(),
3797 environment()->LookupContext(), 3794 environment()->LookupContext(),
3798 current_index, 3795 current_index,
3799 graph()->GetConstant1()); 3796 graph()->GetConstant1());
3800 new_index->AssumeRepresentation(Representation::Integer32());
3801 PushAndAdd(new_index); 3797 PushAndAdd(new_index);
3802 body_exit = current_block(); 3798 body_exit = current_block();
3803 } 3799 }
3804 3800
3805 HBasicBlock* loop_exit = CreateLoop(stmt, 3801 HBasicBlock* loop_exit = CreateLoop(stmt,
3806 loop_entry, 3802 loop_entry,
3807 body_exit, 3803 body_exit,
3808 loop_successor, 3804 loop_successor,
3809 break_info.break_block()); 3805 break_info.break_block());
3810 3806
(...skipping 6136 matching lines...) Expand 10 before | Expand all | Expand 10 after
9947 if (ShouldProduceTraceOutput()) { 9943 if (ShouldProduceTraceOutput()) {
9948 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9944 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9949 } 9945 }
9950 9946
9951 #ifdef DEBUG 9947 #ifdef DEBUG
9952 graph_->Verify(false); // No full verify. 9948 graph_->Verify(false); // No full verify.
9953 #endif 9949 #endif
9954 } 9950 }
9955 9951
9956 } } // namespace v8::internal 9952 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/hydrogen-canonicalize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698