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

Side by Side Diff: src/ic/ic.cc

Issue 2549773002: Internalize strings in-place (Closed)
Patch Set: forgot one Created 3 years, 12 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/ic/ic.h" 5 #include "src/ic/ic.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/api-arguments-inl.h" 10 #include "src/api-arguments-inl.h"
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 if (std::isnan(value)) { 1624 if (std::isnan(value)) {
1625 key = isolate->factory()->nan_string(); 1625 key = isolate->factory()->nan_string();
1626 } else { 1626 } else {
1627 int int_value = FastD2I(value); 1627 int int_value = FastD2I(value);
1628 if (value == int_value && Smi::IsValid(int_value)) { 1628 if (value == int_value && Smi::IsValid(int_value)) {
1629 key = handle(Smi::FromInt(int_value), isolate); 1629 key = handle(Smi::FromInt(int_value), isolate);
1630 } 1630 }
1631 } 1631 }
1632 } else if (key->IsUndefined(isolate)) { 1632 } else if (key->IsUndefined(isolate)) {
1633 key = isolate->factory()->undefined_string(); 1633 key = isolate->factory()->undefined_string();
1634 } else if (key->IsString()) {
1635 key = isolate->factory()->InternalizeString(Handle<String>::cast(key));
1634 } 1636 }
1635 return key; 1637 return key;
1636 } 1638 }
1637 1639
1638 void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver) { 1640 void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver) {
1639 Handle<Map> receiver_map(receiver->map(), isolate()); 1641 Handle<Map> receiver_map(receiver->map(), isolate());
1640 DCHECK(receiver_map->instance_type() != JS_VALUE_TYPE && 1642 DCHECK(receiver_map->instance_type() != JS_VALUE_TYPE &&
1641 receiver_map->instance_type() != JS_PROXY_TYPE); // Checked by caller. 1643 receiver_map->instance_type() != JS_PROXY_TYPE); // Checked by caller.
1642 MapHandleList target_receiver_maps; 1644 MapHandleList target_receiver_maps;
1643 TargetMaps(&target_receiver_maps); 1645 TargetMaps(&target_receiver_maps);
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after
3317 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); 3319 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state());
3318 it.Next(); 3320 it.Next();
3319 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 3321 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
3320 Object::GetProperty(&it)); 3322 Object::GetProperty(&it));
3321 } 3323 }
3322 3324
3323 return *result; 3325 return *result;
3324 } 3326 }
3325 } // namespace internal 3327 } // namespace internal
3326 } // namespace v8 3328 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698