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

Side by Side Diff: src/hydrogen.cc

Issue 356213003: Support non-internalized string key lookups in Hydrogen KeyedLoadIC (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merge ToT 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 | src/runtime.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 // 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 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 Push(BuildDecodeField<String::ArrayIndexValueBits>(hash)); 1506 Push(BuildDecodeField<String::ArrayIndexValueBits>(hash));
1507 } 1507 }
1508 string_index_if.Else(); 1508 string_index_if.Else();
1509 { 1509 {
1510 // Key is a non-index String, check for uniqueness/internalization. If 1510 // Key is a non-index String, check for uniqueness/internalization. If
1511 // it's not, deopt. 1511 // it's not, deopt.
1512 HValue* not_internalized_bit = AddUncasted<HBitwise>( 1512 HValue* not_internalized_bit = AddUncasted<HBitwise>(
1513 Token::BIT_AND, 1513 Token::BIT_AND,
1514 instance_type, 1514 instance_type,
1515 Add<HConstant>(static_cast<int>(kIsNotInternalizedMask))); 1515 Add<HConstant>(static_cast<int>(kIsNotInternalizedMask)));
1516 DeoptimizeIf<HCompareNumericAndBranch>( 1516
1517 not_internalized_bit, 1517 IfBuilder internalized(this);
1518 graph()->GetConstant0(), 1518 internalized.If<HCompareNumericAndBranch>(not_internalized_bit,
1519 Token::NE, 1519 graph()->GetConstant0(),
1520 "BuildKeyedIndexCheck: string isn't internalized"); 1520 Token::EQ);
1521 // Key guaranteed to be a unqiue string 1521 internalized.Then();
1522 Push(key); 1522 Push(key);
1523
1524 internalized.Else();
1525 Add<HPushArguments>(key);
1526 HValue* intern_key = Add<HCallRuntime>(
1527 isolate()->factory()->empty_string(),
1528 Runtime::FunctionForId(Runtime::kInternalizeString), 1);
1529 Push(intern_key);
1530
1531 internalized.End();
1532 // Key guaranteed to be a unique string
1523 } 1533 }
1524 string_index_if.JoinContinuation(join_continuation); 1534 string_index_if.JoinContinuation(join_continuation);
1525 } 1535 }
1526 not_symbol_if.Else(); 1536 not_symbol_if.Else();
1527 { 1537 {
1528 Push(key); // Key is symbol 1538 Push(key); // Key is symbol
1529 } 1539 }
1530 not_symbol_if.JoinContinuation(join_continuation); 1540 not_symbol_if.JoinContinuation(join_continuation);
1531 } 1541 }
1532 not_string_or_name_if.JoinContinuation(join_continuation); 1542 not_string_or_name_if.JoinContinuation(join_continuation);
(...skipping 10831 matching lines...) Expand 10 before | Expand all | Expand 10 after
12364 if (ShouldProduceTraceOutput()) { 12374 if (ShouldProduceTraceOutput()) {
12365 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12375 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12366 } 12376 }
12367 12377
12368 #ifdef DEBUG 12378 #ifdef DEBUG
12369 graph_->Verify(false); // No full verify. 12379 graph_->Verify(false); // No full verify.
12370 #endif 12380 #endif
12371 } 12381 }
12372 12382
12373 } } // namespace v8::internal 12383 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698