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

Side by Side Diff: src/builtins/builtins-object.cc

Issue 2621913002: Revert of Internalize strings in-place (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « src/ast/ast-types.cc ('k') | src/code-stub-assembler.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/builtins/builtins-utils.h" 5 #include "src/builtins/builtins-utils.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stub-assembler.h" 8 #include "src/code-stub-assembler.h"
9 #include "src/property-descriptor.h" 9 #include "src/property-descriptor.h"
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 // Smi receivers do not have own properties. 31 // Smi receivers do not have own properties.
32 Label if_objectisnotsmi(&assembler); 32 Label if_objectisnotsmi(&assembler);
33 assembler.Branch(assembler.TaggedIsSmi(object), &return_false, 33 assembler.Branch(assembler.TaggedIsSmi(object), &return_false,
34 &if_objectisnotsmi); 34 &if_objectisnotsmi);
35 assembler.Bind(&if_objectisnotsmi); 35 assembler.Bind(&if_objectisnotsmi);
36 36
37 Node* map = assembler.LoadMap(object); 37 Node* map = assembler.LoadMap(object);
38 Node* instance_type = assembler.LoadMapInstanceType(map); 38 Node* instance_type = assembler.LoadMapInstanceType(map);
39 39
40 { 40 Variable var_index(&assembler, MachineType::PointerRepresentation());
41 Variable var_index(&assembler, MachineType::PointerRepresentation());
42 Variable var_unique(&assembler, MachineRepresentation::kTagged);
43 41
44 Label keyisindex(&assembler), if_iskeyunique(&assembler); 42 Label keyisindex(&assembler), if_iskeyunique(&assembler);
45 assembler.TryToName(key, &keyisindex, &var_index, &if_iskeyunique, 43 assembler.TryToName(key, &keyisindex, &var_index, &if_iskeyunique,
46 &var_unique, &call_runtime); 44 &call_runtime);
47 45
48 assembler.Bind(&if_iskeyunique); 46 assembler.Bind(&if_iskeyunique);
49 assembler.TryHasOwnProperty(object, map, instance_type, var_unique.value(), 47 assembler.TryHasOwnProperty(object, map, instance_type, key, &return_true,
50 &return_true, &return_false, &call_runtime); 48 &return_false, &call_runtime);
51 49
52 assembler.Bind(&keyisindex); 50 assembler.Bind(&keyisindex);
53 // Handle negative keys in the runtime. 51 // Handle negative keys in the runtime.
54 assembler.GotoIf(assembler.IntPtrLessThan(var_index.value(), 52 assembler.GotoIf(
55 assembler.IntPtrConstant(0)), 53 assembler.IntPtrLessThan(var_index.value(), assembler.IntPtrConstant(0)),
56 &call_runtime); 54 &call_runtime);
57 assembler.TryLookupElement(object, map, instance_type, var_index.value(), 55 assembler.TryLookupElement(object, map, instance_type, var_index.value(),
58 &return_true, &return_false, &call_runtime); 56 &return_true, &return_false, &call_runtime);
59 } 57
60 assembler.Bind(&return_true); 58 assembler.Bind(&return_true);
61 assembler.Return(assembler.BooleanConstant(true)); 59 assembler.Return(assembler.BooleanConstant(true));
62 60
63 assembler.Bind(&return_false); 61 assembler.Bind(&return_false);
64 assembler.Return(assembler.BooleanConstant(false)); 62 assembler.Return(assembler.BooleanConstant(false));
65 63
66 assembler.Bind(&call_runtime); 64 assembler.Bind(&call_runtime);
67 assembler.Return(assembler.CallRuntime(Runtime::kObjectHasOwnProperty, 65 assembler.Return(assembler.CallRuntime(Runtime::kObjectHasOwnProperty,
68 context, object, key)); 66 context, object, key));
69 } 67 }
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 CodeStubAssembler assembler(state); 985 CodeStubAssembler assembler(state);
988 986
989 Node* object = assembler.Parameter(Descriptor::kObject); 987 Node* object = assembler.Parameter(Descriptor::kObject);
990 Node* context = assembler.Parameter(Descriptor::kContext); 988 Node* context = assembler.Parameter(Descriptor::kContext);
991 989
992 assembler.Return(assembler.GetSuperConstructor(object, context)); 990 assembler.Return(assembler.GetSuperConstructor(object, context));
993 } 991 }
994 992
995 } // namespace internal 993 } // namespace internal
996 } // namespace v8 994 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast-types.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698