OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "bootstrapper.h" | 5 #include "bootstrapper.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
9 #include "natives.h" | 9 #include "natives.h" |
10 #include "snapshot.h" | 10 #include "snapshot.h" |
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 // We can't use PoisonArgumentsAndCaller because that mutates accessor pairs | 1385 // We can't use PoisonArgumentsAndCaller because that mutates accessor pairs |
1386 // in place, and the initial state of the generator function map shares the | 1386 // in place, and the initial state of the generator function map shares the |
1387 // accessor pair with sloppy functions. Also the error message should be | 1387 // accessor pair with sloppy functions. Also the error message should be |
1388 // different. Also unhappily, we can't use the API accessors to implement | 1388 // different. Also unhappily, we can't use the API accessors to implement |
1389 // poisoning, because API accessors present themselves as data properties, | 1389 // poisoning, because API accessors present themselves as data properties, |
1390 // not accessor properties, and so getOwnPropertyDescriptor raises an | 1390 // not accessor properties, and so getOwnPropertyDescriptor raises an |
1391 // exception as it tries to get the values. Sadness. | 1391 // exception as it tries to get the values. Sadness. |
1392 Handle<AccessorPair> poison_pair(factory()->NewAccessorPair()); | 1392 Handle<AccessorPair> poison_pair(factory()->NewAccessorPair()); |
1393 PropertyAttributes rw_attribs = | 1393 PropertyAttributes rw_attribs = |
1394 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); | 1394 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); |
1395 poison_pair->set_getter(*GetGeneratorPoisonFunction()); | 1395 Handle<JSFunction> poison_function = GetGeneratorPoisonFunction(); |
1396 poison_pair->set_setter(*GetGeneratorPoisonFunction()); | 1396 poison_pair->set_getter(*poison_function); |
| 1397 poison_pair->set_setter(*poison_function); |
1397 ReplaceAccessors(generator_function_map, factory()->arguments_string(), | 1398 ReplaceAccessors(generator_function_map, factory()->arguments_string(), |
1398 rw_attribs, poison_pair); | 1399 rw_attribs, poison_pair); |
1399 ReplaceAccessors(generator_function_map, factory()->caller_string(), | 1400 ReplaceAccessors(generator_function_map, factory()->caller_string(), |
1400 rw_attribs, poison_pair); | 1401 rw_attribs, poison_pair); |
1401 | 1402 |
1402 Handle<Map> strict_function_map(native_context()->strict_function_map()); | 1403 Handle<Map> strict_function_map(native_context()->strict_function_map()); |
1403 Handle<Map> strict_generator_function_map = Map::Copy(strict_function_map); | 1404 Handle<Map> strict_generator_function_map = Map::Copy(strict_function_map); |
1404 // "arguments" and "caller" already poisoned. | 1405 // "arguments" and "caller" already poisoned. |
1405 strict_generator_function_map->set_prototype(*generator_function_prototype); | 1406 strict_generator_function_map->set_prototype(*generator_function_prototype); |
1406 native_context()->set_strict_generator_function_map( | 1407 native_context()->set_strict_generator_function_map( |
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2703 return from + sizeof(NestingCounterType); | 2704 return from + sizeof(NestingCounterType); |
2704 } | 2705 } |
2705 | 2706 |
2706 | 2707 |
2707 // Called when the top-level V8 mutex is destroyed. | 2708 // Called when the top-level V8 mutex is destroyed. |
2708 void Bootstrapper::FreeThreadResources() { | 2709 void Bootstrapper::FreeThreadResources() { |
2709 ASSERT(!IsActive()); | 2710 ASSERT(!IsActive()); |
2710 } | 2711 } |
2711 | 2712 |
2712 } } // namespace v8::internal | 2713 } } // namespace v8::internal |
OLD | NEW |