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

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

Issue 2580413002: Merged: [stubs] Fix negative index lookup in hasOwnProperty (Closed)
Patch Set: fix formatting Created 4 years 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 | « no previous file | src/code-stub-assembler.cc » ('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.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/property-descriptor.h" 9 #include "src/property-descriptor.h"
10 10
(...skipping 28 matching lines...) Expand all
39 39
40 Label keyisindex(assembler), if_iskeyunique(assembler); 40 Label keyisindex(assembler), if_iskeyunique(assembler);
41 assembler->TryToName(key, &keyisindex, &var_index, &if_iskeyunique, 41 assembler->TryToName(key, &keyisindex, &var_index, &if_iskeyunique,
42 &call_runtime); 42 &call_runtime);
43 43
44 assembler->Bind(&if_iskeyunique); 44 assembler->Bind(&if_iskeyunique);
45 assembler->TryHasOwnProperty(object, map, instance_type, key, &return_true, 45 assembler->TryHasOwnProperty(object, map, instance_type, key, &return_true,
46 &return_false, &call_runtime); 46 &return_false, &call_runtime);
47 47
48 assembler->Bind(&keyisindex); 48 assembler->Bind(&keyisindex);
49 // Handle negative keys in the runtime.
50 assembler->GotoIf(assembler->IntPtrLessThan(var_index.value(),
51 assembler->IntPtrConstant(0)),
52 &call_runtime);
49 assembler->TryLookupElement(object, map, instance_type, var_index.value(), 53 assembler->TryLookupElement(object, map, instance_type, var_index.value(),
50 &return_true, &return_false, &call_runtime); 54 &return_true, &return_false, &call_runtime);
51 55
52 assembler->Bind(&return_true); 56 assembler->Bind(&return_true);
53 assembler->Return(assembler->BooleanConstant(true)); 57 assembler->Return(assembler->BooleanConstant(true));
54 58
55 assembler->Bind(&return_false); 59 assembler->Bind(&return_false);
56 assembler->Return(assembler->BooleanConstant(false)); 60 assembler->Return(assembler->BooleanConstant(false));
57 61
58 assembler->Bind(&call_runtime); 62 assembler->Bind(&call_runtime);
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 Node* constructor = assembler->Parameter(Descriptor::kLeft); 1063 Node* constructor = assembler->Parameter(Descriptor::kLeft);
1060 Node* object = assembler->Parameter(Descriptor::kRight); 1064 Node* object = assembler->Parameter(Descriptor::kRight);
1061 Node* context = assembler->Parameter(Descriptor::kContext); 1065 Node* context = assembler->Parameter(Descriptor::kContext);
1062 1066
1063 assembler->Return( 1067 assembler->Return(
1064 assembler->OrdinaryHasInstance(context, constructor, object)); 1068 assembler->OrdinaryHasInstance(context, constructor, object));
1065 } 1069 }
1066 1070
1067 } // namespace internal 1071 } // namespace internal
1068 } // namespace v8 1072 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698