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

Side by Side Diff: src/hydrogen.cc

Issue 246133005: Optimize numeric comparison with known successors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix Created 6 years, 8 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/arm64/lithium-arm64.cc ('k') | src/hydrogen-instructions.h » ('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 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 HValue* current_capacity = AddLoadFixedArrayLength(elements); 1307 HValue* current_capacity = AddLoadFixedArrayLength(elements);
1308 1308
1309 IfBuilder capacity_checker(this); 1309 IfBuilder capacity_checker(this);
1310 1310
1311 capacity_checker.If<HCompareNumericAndBranch>(key, current_capacity, 1311 capacity_checker.If<HCompareNumericAndBranch>(key, current_capacity,
1312 Token::GTE); 1312 Token::GTE);
1313 capacity_checker.Then(); 1313 capacity_checker.Then();
1314 1314
1315 HValue* max_gap = Add<HConstant>(static_cast<int32_t>(JSObject::kMaxGap)); 1315 HValue* max_gap = Add<HConstant>(static_cast<int32_t>(JSObject::kMaxGap));
1316 HValue* max_capacity = AddUncasted<HAdd>(current_capacity, max_gap); 1316 HValue* max_capacity = AddUncasted<HAdd>(current_capacity, max_gap);
1317 IfBuilder key_checker(this); 1317
1318 key_checker.If<HCompareNumericAndBranch>(key, max_capacity, Token::LT); 1318 Add<HBoundsCheck>(key, max_capacity);
1319 key_checker.Then();
1320 key_checker.ElseDeopt("Key out of capacity range");
1321 key_checker.End();
1322 1319
1323 HValue* new_capacity = BuildNewElementsCapacity(key); 1320 HValue* new_capacity = BuildNewElementsCapacity(key);
1324 HValue* new_elements = BuildGrowElementsCapacity(object, elements, 1321 HValue* new_elements = BuildGrowElementsCapacity(object, elements,
1325 kind, kind, length, 1322 kind, kind, length,
1326 new_capacity); 1323 new_capacity);
1327 1324
1328 environment()->Push(new_elements); 1325 environment()->Push(new_elements);
1329 capacity_checker.Else(); 1326 capacity_checker.Else();
1330 1327
1331 environment()->Push(elements); 1328 environment()->Push(elements);
(...skipping 10312 matching lines...) Expand 10 before | Expand all | Expand 10 after
11644 if (ShouldProduceTraceOutput()) { 11641 if (ShouldProduceTraceOutput()) {
11645 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11642 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11646 } 11643 }
11647 11644
11648 #ifdef DEBUG 11645 #ifdef DEBUG
11649 graph_->Verify(false); // No full verify. 11646 graph_->Verify(false); // No full verify.
11650 #endif 11647 #endif
11651 } 11648 }
11652 11649
11653 } } // namespace v8::internal 11650 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698