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

Side by Side Diff: src/hydrogen.cc

Issue 366083005: HGraphBuilder::BuildJSObjectCheck: Tighten instance type comparison (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « no previous file | no next file » | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 HObjectAccess access(HObjectAccess::ForMapInstanceTypeAndBitField()); 1424 HObjectAccess access(HObjectAccess::ForMapInstanceTypeAndBitField());
1425 HValue* instance_type_and_bit_field = 1425 HValue* instance_type_and_bit_field =
1426 Add<HLoadNamedField>(map, static_cast<HValue*>(NULL), access); 1426 Add<HLoadNamedField>(map, static_cast<HValue*>(NULL), access);
1427 1427
1428 HValue* mask = Add<HConstant>(0x00FF | (bit_field_mask << 8)); 1428 HValue* mask = Add<HConstant>(0x00FF | (bit_field_mask << 8));
1429 HValue* and_result = AddUncasted<HBitwise>(Token::BIT_AND, 1429 HValue* and_result = AddUncasted<HBitwise>(Token::BIT_AND,
1430 instance_type_and_bit_field, 1430 instance_type_and_bit_field,
1431 mask); 1431 mask);
1432 HValue* sub_result = AddUncasted<HSub>(and_result, 1432 HValue* sub_result = AddUncasted<HSub>(and_result,
1433 Add<HConstant>(JS_OBJECT_TYPE)); 1433 Add<HConstant>(JS_OBJECT_TYPE));
1434 Add<HBoundsCheck>(sub_result, Add<HConstant>(0x100 - JS_OBJECT_TYPE)); 1434 Add<HBoundsCheck>(sub_result,
1435 Add<HConstant>(LAST_JS_OBJECT_TYPE + 1 - JS_OBJECT_TYPE));
1435 } 1436 }
1436 1437
1437 1438
1438 void HGraphBuilder::BuildKeyedIndexCheck(HValue* key, 1439 void HGraphBuilder::BuildKeyedIndexCheck(HValue* key,
1439 HIfContinuation* join_continuation) { 1440 HIfContinuation* join_continuation) {
1440 // The sometimes unintuitively backward ordering of the ifs below is 1441 // The sometimes unintuitively backward ordering of the ifs below is
1441 // convoluted, but necessary. All of the paths must guarantee that the 1442 // convoluted, but necessary. All of the paths must guarantee that the
1442 // if-true of the continuation returns a smi element index and the if-false of 1443 // if-true of the continuation returns a smi element index and the if-false of
1443 // the continuation returns either a symbol or a unique string key. All other 1444 // the continuation returns either a symbol or a unique string key. All other
1444 // object types cause a deopt to fall back to the runtime. 1445 // object types cause a deopt to fall back to the runtime.
(...skipping 10931 matching lines...) Expand 10 before | Expand all | Expand 10 after
12376 if (ShouldProduceTraceOutput()) { 12377 if (ShouldProduceTraceOutput()) {
12377 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12378 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12378 } 12379 }
12379 12380
12380 #ifdef DEBUG 12381 #ifdef DEBUG
12381 graph_->Verify(false); // No full verify. 12382 graph_->Verify(false); // No full verify.
12382 #endif 12383 #endif
12383 } 12384 }
12384 12385
12385 } } // namespace v8::internal 12386 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698