| OLD | NEW |
| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/contexts.h" | 9 #include "src/contexts.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 bool Accessors::IsJSObjectFieldAccessor(Handle<Map> map, Handle<Name> name, | 72 bool Accessors::IsJSObjectFieldAccessor(Handle<Map> map, Handle<Name> name, |
| 73 int* object_offset) { | 73 int* object_offset) { |
| 74 Isolate* isolate = name->GetIsolate(); | 74 Isolate* isolate = name->GetIsolate(); |
| 75 | 75 |
| 76 switch (map->instance_type()) { | 76 switch (map->instance_type()) { |
| 77 case JS_ARRAY_TYPE: | 77 case JS_ARRAY_TYPE: |
| 78 return | 78 return |
| 79 CheckForName(name, isolate->factory()->length_string(), | 79 CheckForName(name, isolate->factory()->length_string(), |
| 80 JSArray::kLengthOffset, object_offset); | 80 JSArray::kLengthOffset, object_offset); |
| 81 case JS_TYPED_ARRAY_TYPE: | 81 case JS_TYPED_ARRAY_TYPE: |
| 82 case JS_SHARED_TYPED_ARRAY_TYPE: |
| 82 // %TypedArray%.prototype is non-configurable, and so are the following | 83 // %TypedArray%.prototype is non-configurable, and so are the following |
| 83 // named properties on %TypedArray%.prototype, so we can directly inline | 84 // named properties on %TypedArray%.prototype, so we can directly inline |
| 84 // the field-load for typed array maps that still use their | 85 // the field-load for typed array maps that still use their |
| 85 // %TypedArray%.prototype. | 86 // %TypedArray%.prototype. |
| 86 if (JSFunction::cast(map->GetConstructor())->prototype() != | 87 if (JSFunction::cast(map->GetConstructor())->prototype() != |
| 87 map->prototype()) { | 88 map->prototype()) { |
| 88 return false; | 89 return false; |
| 89 } | 90 } |
| 90 return | 91 return |
| 91 CheckForName(name, isolate->factory()->length_string(), | 92 CheckForName(name, isolate->factory()->length_string(), |
| 92 JSTypedArray::kLengthOffset, object_offset) || | 93 JSTypedArray::kLengthOffset, object_offset) || |
| 93 CheckForName(name, isolate->factory()->byte_length_string(), | 94 CheckForName(name, isolate->factory()->byte_length_string(), |
| 94 JSTypedArray::kByteLengthOffset, object_offset) || | 95 JSTypedArray::kByteLengthOffset, object_offset) || |
| 95 CheckForName(name, isolate->factory()->byte_offset_string(), | 96 CheckForName(name, isolate->factory()->byte_offset_string(), |
| 96 JSTypedArray::kByteOffsetOffset, object_offset); | 97 JSTypedArray::kByteOffsetOffset, object_offset); |
| 97 case JS_ARRAY_BUFFER_TYPE: | 98 case JS_ARRAY_BUFFER_TYPE: |
| 99 case JS_SHARED_ARRAY_BUFFER_TYPE: |
| 98 return | 100 return |
| 99 CheckForName(name, isolate->factory()->byte_length_string(), | 101 CheckForName(name, isolate->factory()->byte_length_string(), |
| 100 JSArrayBuffer::kByteLengthOffset, object_offset); | 102 JSArrayBuffer::kByteLengthOffset, object_offset); |
| 101 case JS_DATA_VIEW_TYPE: | 103 case JS_DATA_VIEW_TYPE: |
| 102 return | 104 return |
| 103 CheckForName(name, isolate->factory()->byte_length_string(), | 105 CheckForName(name, isolate->factory()->byte_length_string(), |
| 104 JSDataView::kByteLengthOffset, object_offset) || | 106 JSDataView::kByteLengthOffset, object_offset) || |
| 105 CheckForName(name, isolate->factory()->byte_offset_string(), | 107 CheckForName(name, isolate->factory()->byte_offset_string(), |
| 106 JSDataView::kByteOffsetOffset, object_offset); | 108 JSDataView::kByteOffsetOffset, object_offset); |
| 107 default: | 109 default: |
| (...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1568 info->set_data(Smi::FromInt(index)); | 1570 info->set_data(Smi::FromInt(index)); |
| 1569 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1571 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
| 1570 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1572 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
| 1571 info->set_getter(*getter); | 1573 info->set_getter(*getter); |
| 1572 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1574 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
| 1573 return info; | 1575 return info; |
| 1574 } | 1576 } |
| 1575 | 1577 |
| 1576 | 1578 |
| 1577 } } // namespace v8::internal | 1579 } } // namespace v8::internal |
| OLD | NEW |