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

Side by Side Diff: src/hydrogen.cc

Issue 20070005: Adding Smi support to Add, Sub, Mul, and Bitwise (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed nit Created 7 years, 5 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 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 HValue* HGraphBuilder::JSArrayBuilder::EstablishAllocationSize( 1878 HValue* HGraphBuilder::JSArrayBuilder::EstablishAllocationSize(
1879 HValue* length_node) { 1879 HValue* length_node) {
1880 HValue* context = builder()->environment()->LookupContext(); 1880 HValue* context = builder()->environment()->LookupContext();
1881 ASSERT(length_node != NULL); 1881 ASSERT(length_node != NULL);
1882 1882
1883 int base_size = JSArray::kSize; 1883 int base_size = JSArray::kSize;
1884 if (mode_ == TRACK_ALLOCATION_SITE) { 1884 if (mode_ == TRACK_ALLOCATION_SITE) {
1885 base_size += AllocationMemento::kSize; 1885 base_size += AllocationMemento::kSize;
1886 } 1886 }
1887 1887
1888 if (IsFastDoubleElementsKind(kind_)) { 1888 STATIC_ASSERT(FixedDoubleArray::kHeaderSize == FixedArray::kHeaderSize);
1889 base_size += FixedDoubleArray::kHeaderSize; 1889 base_size += FixedArray::kHeaderSize;
1890 } else {
1891 base_size += FixedArray::kHeaderSize;
1892 }
1893 1890
1894 HInstruction* elements_size_value = 1891 HInstruction* elements_size_value =
1895 builder()->Add<HConstant>(elements_size()); 1892 builder()->Add<HConstant>(elements_size());
1896 HInstruction* mul = HMul::New(zone(), context, length_node, 1893 HInstruction* mul = HMul::New(zone(), context, length_node,
1897 elements_size_value); 1894 elements_size_value);
1898 mul->ClearFlag(HValue::kCanOverflow); 1895 mul->ClearFlag(HValue::kCanOverflow);
1899 builder()->AddInstruction(mul); 1896 builder()->AddInstruction(mul);
1900 1897
1901 HInstruction* base = builder()->Add<HConstant>(base_size); 1898 HInstruction* base = builder()->Add<HConstant>(base_size);
1902 HInstruction* total_size = HAdd::New(zone(), context, base, mul); 1899 HInstruction* total_size = HAdd::New(zone(), context, base, mul);
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after
3795 JoinContinue(stmt, current_block(), break_info.continue_block()); 3792 JoinContinue(stmt, current_block(), break_info.continue_block());
3796 3793
3797 if (body_exit != NULL) { 3794 if (body_exit != NULL) {
3798 set_current_block(body_exit); 3795 set_current_block(body_exit);
3799 3796
3800 HValue* current_index = Pop(); 3797 HValue* current_index = Pop();
3801 HInstruction* new_index = HAdd::New(zone(), 3798 HInstruction* new_index = HAdd::New(zone(),
3802 environment()->LookupContext(), 3799 environment()->LookupContext(),
3803 current_index, 3800 current_index,
3804 graph()->GetConstant1()); 3801 graph()->GetConstant1());
3805 new_index->AssumeRepresentation(Representation::Integer32());
3806 PushAndAdd(new_index); 3802 PushAndAdd(new_index);
3807 body_exit = current_block(); 3803 body_exit = current_block();
3808 } 3804 }
3809 3805
3810 HBasicBlock* loop_exit = CreateLoop(stmt, 3806 HBasicBlock* loop_exit = CreateLoop(stmt,
3811 loop_entry, 3807 loop_entry,
3812 body_exit, 3808 body_exit,
3813 loop_successor, 3809 loop_successor,
3814 break_info.break_block()); 3810 break_info.break_block());
3815 3811
(...skipping 6140 matching lines...) Expand 10 before | Expand all | Expand 10 after
9956 if (ShouldProduceTraceOutput()) { 9952 if (ShouldProduceTraceOutput()) {
9957 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9953 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9958 } 9954 }
9959 9955
9960 #ifdef DEBUG 9956 #ifdef DEBUG
9961 graph_->Verify(false); // No full verify. 9957 graph_->Verify(false); // No full verify.
9962 #endif 9958 #endif
9963 } 9959 }
9964 9960
9965 } } // namespace v8::internal 9961 } } // 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