| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 362 |
| 363 // Mark the global context with out of memory. | 363 // Mark the global context with out of memory. |
| 364 inline void mark_out_of_memory(); | 364 inline void mark_out_of_memory(); |
| 365 | 365 |
| 366 // A global context hold a list of all functions which have been optimized. | 366 // A global context hold a list of all functions which have been optimized. |
| 367 void AddOptimizedFunction(JSFunction* function); | 367 void AddOptimizedFunction(JSFunction* function); |
| 368 void RemoveOptimizedFunction(JSFunction* function); | 368 void RemoveOptimizedFunction(JSFunction* function); |
| 369 Object* OptimizedFunctionsListHead(); | 369 Object* OptimizedFunctionsListHead(); |
| 370 void ClearOptimizedFunctions(); | 370 void ClearOptimizedFunctions(); |
| 371 | 371 |
| 372 static int GetContextMapIndexFromElementsKind( |
| 373 ElementsKind elements_kind) { |
| 374 if (elements_kind == FAST_DOUBLE_ELEMENTS) { |
| 375 return Context::DOUBLE_JS_ARRAY_MAP_INDEX; |
| 376 } else if (elements_kind == FAST_ELEMENTS) { |
| 377 return Context::OBJECT_JS_ARRAY_MAP_INDEX; |
| 378 } else { |
| 379 ASSERT(elements_kind == FAST_SMI_ONLY_ELEMENTS); |
| 380 return Context::SMI_JS_ARRAY_MAP_INDEX; |
| 381 } |
| 382 } |
| 383 |
| 372 #define GLOBAL_CONTEXT_FIELD_ACCESSORS(index, type, name) \ | 384 #define GLOBAL_CONTEXT_FIELD_ACCESSORS(index, type, name) \ |
| 373 void set_##name(type* value) { \ | 385 void set_##name(type* value) { \ |
| 374 ASSERT(IsGlobalContext()); \ | 386 ASSERT(IsGlobalContext()); \ |
| 375 set(index, value); \ | 387 set(index, value); \ |
| 376 } \ | 388 } \ |
| 377 type* name() { \ | 389 type* name() { \ |
| 378 ASSERT(IsGlobalContext()); \ | 390 ASSERT(IsGlobalContext()); \ |
| 379 return type::cast(get(index)); \ | 391 return type::cast(get(index)); \ |
| 380 } | 392 } |
| 381 GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSORS) | 393 GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSORS) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 #ifdef DEBUG | 439 #ifdef DEBUG |
| 428 // Bootstrapping-aware type checks. | 440 // Bootstrapping-aware type checks. |
| 429 static bool IsBootstrappingOrContext(Object* object); | 441 static bool IsBootstrappingOrContext(Object* object); |
| 430 static bool IsBootstrappingOrGlobalObject(Object* object); | 442 static bool IsBootstrappingOrGlobalObject(Object* object); |
| 431 #endif | 443 #endif |
| 432 }; | 444 }; |
| 433 | 445 |
| 434 } } // namespace v8::internal | 446 } } // namespace v8::internal |
| 435 | 447 |
| 436 #endif // V8_CONTEXTS_H_ | 448 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |