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/accessors.h" | 5 #include "src/accessors.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/execution.h" | 10 #include "src/execution.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 info->set_is_special_data_property(true); | 34 info->set_is_special_data_property(true); |
35 info->set_name(*name); | 35 info->set_name(*name); |
36 Handle<Object> get = v8::FromCData(isolate, getter); | 36 Handle<Object> get = v8::FromCData(isolate, getter); |
37 Handle<Object> set = v8::FromCData(isolate, setter); | 37 Handle<Object> set = v8::FromCData(isolate, setter); |
38 info->set_getter(*get); | 38 info->set_getter(*get); |
39 info->set_setter(*set); | 39 info->set_setter(*set); |
40 return info; | 40 return info; |
41 } | 41 } |
42 | 42 |
43 | 43 |
44 Handle<AccessorInfo> Accessors::CloneAccessor(Isolate* isolate, | |
45 Handle<AccessorInfo> accessor) { | |
46 Factory* factory = isolate->factory(); | |
47 Handle<AccessorInfo> info = factory->NewAccessorInfo(); | |
48 info->set_name(accessor->name()); | |
49 info->set_flag(accessor->flag()); | |
50 info->set_expected_receiver_type(accessor->expected_receiver_type()); | |
51 info->set_getter(accessor->getter()); | |
52 info->set_setter(accessor->setter()); | |
53 info->set_data(accessor->data()); | |
54 return info; | |
55 } | |
56 | |
57 | |
58 static V8_INLINE bool CheckForName(Handle<Name> name, | 44 static V8_INLINE bool CheckForName(Handle<Name> name, |
59 Handle<String> property_name, | 45 Handle<String> property_name, |
60 int offset, | 46 int offset, |
61 int* object_offset) { | 47 int* object_offset) { |
62 if (Name::Equals(name, property_name)) { | 48 if (Name::Equals(name, property_name)) { |
63 *object_offset = offset; | 49 *object_offset = offset; |
64 return true; | 50 return true; |
65 } | 51 } |
66 return false; | 52 return false; |
67 } | 53 } |
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 Isolate* isolate = name->GetIsolate(); | 1419 Isolate* isolate = name->GetIsolate(); |
1434 Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport, | 1420 Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport, |
1435 &ModuleSetExport, attributes); | 1421 &ModuleSetExport, attributes); |
1436 info->set_data(Smi::FromInt(index)); | 1422 info->set_data(Smi::FromInt(index)); |
1437 return info; | 1423 return info; |
1438 } | 1424 } |
1439 | 1425 |
1440 | 1426 |
1441 } // namespace internal | 1427 } // namespace internal |
1442 } // namespace v8 | 1428 } // namespace v8 |
OLD | NEW |