| OLD | NEW | 
|---|
| 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 481     // Check that we have a simple object | 481     // Check that we have a simple object | 
| 482     a->GotoIf(a->TaggedIsSmi(properties), &call_runtime); | 482     a->GotoIf(a->TaggedIsSmi(properties), &call_runtime); | 
| 483     // Undefined implies no properties. | 483     // Undefined implies no properties. | 
| 484     a->GotoIf(a->WordEqual(properties, a->UndefinedConstant()), &no_properties); | 484     a->GotoIf(a->WordEqual(properties, a->UndefinedConstant()), &no_properties); | 
| 485     Node* properties_map = a->LoadMap(properties); | 485     Node* properties_map = a->LoadMap(properties); | 
| 486     a->GotoIf(a->IsSpecialReceiverMap(properties_map), &call_runtime); | 486     a->GotoIf(a->IsSpecialReceiverMap(properties_map), &call_runtime); | 
| 487     // Stay on the fast path only if there are no elements. | 487     // Stay on the fast path only if there are no elements. | 
| 488     a->GotoUnless(a->WordEqual(a->LoadElements(properties), | 488     a->GotoUnless(a->WordEqual(a->LoadElements(properties), | 
| 489                                a->LoadRoot(Heap::kEmptyFixedArrayRootIndex)), | 489                                a->LoadRoot(Heap::kEmptyFixedArrayRootIndex)), | 
| 490                   &call_runtime); | 490                   &call_runtime); | 
| 491     // Jump to the runtime for slow objects. | 491     // Handle dictionary objects or fast objects with properties in runtime. | 
| 492     Node* bit_field3 = a->LoadMapBitField3(properties_map); | 492     Node* bit_field3 = a->LoadMapBitField3(properties_map); | 
| 493     Node* is_fast_map = a->Word32Equal( | 493     a->GotoIf(a->IsSetWord32<Map::DictionaryMap>(bit_field3), &call_runtime); | 
| 494         a->BitFieldDecode<Map::DictionaryMap>(bit_field3), a->Int32Constant(0)); | 494     a->Branch(a->IsSetWord32<Map::NumberOfOwnDescriptorsBits>(bit_field3), | 
| 495     a->GotoUnless(is_fast_map, &call_runtime); | 495               &call_runtime, &no_properties); | 
| 496 |  | 
| 497     a->Branch( |  | 
| 498         a->WordEqual( |  | 
| 499             a->BitFieldDecodeWord<Map::NumberOfOwnDescriptorsBits>(bit_field3), |  | 
| 500             a->IntPtrConstant(0)), |  | 
| 501         &no_properties, &call_runtime); |  | 
| 502   } | 496   } | 
| 503 | 497 | 
| 504   // Create a new object with the given prototype. | 498   // Create a new object with the given prototype. | 
| 505   a->Bind(&no_properties); | 499   a->Bind(&no_properties); | 
| 506   { | 500   { | 
| 507     Variable map(a, MachineRepresentation::kTagged); | 501     Variable map(a, MachineRepresentation::kTagged); | 
| 508     Label non_null_proto(a), instantiate_map(a), good(a); | 502     Label non_null_proto(a), instantiate_map(a), good(a); | 
| 509 | 503 | 
| 510     a->Branch(a->WordEqual(prototype, a->NullConstant()), &good, | 504     a->Branch(a->WordEqual(prototype, a->NullConstant()), &good, | 
| 511               &non_null_proto); | 505               &non_null_proto); | 
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1052   typedef CompareDescriptor Descriptor; | 1046   typedef CompareDescriptor Descriptor; | 
| 1053   Node* object = assembler->Parameter(Descriptor::kLeft); | 1047   Node* object = assembler->Parameter(Descriptor::kLeft); | 
| 1054   Node* callable = assembler->Parameter(Descriptor::kRight); | 1048   Node* callable = assembler->Parameter(Descriptor::kRight); | 
| 1055   Node* context = assembler->Parameter(Descriptor::kContext); | 1049   Node* context = assembler->Parameter(Descriptor::kContext); | 
| 1056 | 1050 | 
| 1057   assembler->Return(assembler->InstanceOf(object, callable, context)); | 1051   assembler->Return(assembler->InstanceOf(object, callable, context)); | 
| 1058 } | 1052 } | 
| 1059 | 1053 | 
| 1060 }  // namespace internal | 1054 }  // namespace internal | 
| 1061 }  // namespace v8 | 1055 }  // namespace v8 | 
| OLD | NEW | 
|---|