OLD | NEW |
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 2351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2362 HValue* min_growth = Add<HConstant>(16); | 2362 HValue* min_growth = Add<HConstant>(16); |
2363 | 2363 |
2364 new_capacity = AddUncasted<HAdd>(new_capacity, min_growth); | 2364 new_capacity = AddUncasted<HAdd>(new_capacity, min_growth); |
2365 new_capacity->ClearFlag(HValue::kCanOverflow); | 2365 new_capacity->ClearFlag(HValue::kCanOverflow); |
2366 | 2366 |
2367 return new_capacity; | 2367 return new_capacity; |
2368 } | 2368 } |
2369 | 2369 |
2370 | 2370 |
2371 void HGraphBuilder::BuildNewSpaceArrayCheck(HValue* length, ElementsKind kind) { | 2371 void HGraphBuilder::BuildNewSpaceArrayCheck(HValue* length, ElementsKind kind) { |
2372 Heap* heap = isolate()->heap(); | |
2373 int element_size = IsFastDoubleElementsKind(kind) ? kDoubleSize | 2372 int element_size = IsFastDoubleElementsKind(kind) ? kDoubleSize |
2374 : kPointerSize; | 2373 : kPointerSize; |
2375 int max_size = heap->MaxRegularSpaceAllocationSize() / element_size; | 2374 int max_size = Page::kMaxRegularHeapObjectSize / element_size; |
2376 max_size -= JSArray::kSize / element_size; | 2375 max_size -= JSArray::kSize / element_size; |
2377 HConstant* max_size_constant = Add<HConstant>(max_size); | 2376 HConstant* max_size_constant = Add<HConstant>(max_size); |
2378 Add<HBoundsCheck>(length, max_size_constant); | 2377 Add<HBoundsCheck>(length, max_size_constant); |
2379 } | 2378 } |
2380 | 2379 |
2381 | 2380 |
2382 HValue* HGraphBuilder::BuildGrowElementsCapacity(HValue* object, | 2381 HValue* HGraphBuilder::BuildGrowElementsCapacity(HValue* object, |
2383 HValue* elements, | 2382 HValue* elements, |
2384 ElementsKind kind, | 2383 ElementsKind kind, |
2385 ElementsKind new_kind, | 2384 ElementsKind new_kind, |
(...skipping 8614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11000 if (ShouldProduceTraceOutput()) { | 10999 if (ShouldProduceTraceOutput()) { |
11001 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11000 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11002 } | 11001 } |
11003 | 11002 |
11004 #ifdef DEBUG | 11003 #ifdef DEBUG |
11005 graph_->Verify(false); // No full verify. | 11004 graph_->Verify(false); // No full verify. |
11006 #endif | 11005 #endif |
11007 } | 11006 } |
11008 | 11007 |
11009 } } // namespace v8::internal | 11008 } } // namespace v8::internal |
OLD | NEW |