OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 } | 358 } |
359 | 359 |
360 | 360 |
361 Object* Context::DeoptimizedCodeListHead() { | 361 Object* Context::DeoptimizedCodeListHead() { |
362 ASSERT(IsNativeContext()); | 362 ASSERT(IsNativeContext()); |
363 return get(DEOPTIMIZED_CODE_LIST); | 363 return get(DEOPTIMIZED_CODE_LIST); |
364 } | 364 } |
365 | 365 |
366 | 366 |
367 Handle<Object> Context::ErrorMessageForCodeGenerationFromStrings() { | 367 Handle<Object> Context::ErrorMessageForCodeGenerationFromStrings() { |
368 Handle<Object> result(error_message_for_code_gen_from_strings(), | 368 Isolate* isolate = GetIsolate(); |
369 GetIsolate()); | 369 Handle<Object> result(error_message_for_code_gen_from_strings(), isolate); |
370 if (!result->IsUndefined()) return result; | 370 if (!result->IsUndefined()) return result; |
371 return GetIsolate()->factory()->NewStringFromOneByte(STATIC_ASCII_VECTOR( | 371 return isolate->factory()->NewStringFromStaticAscii( |
372 "Code generation from strings disallowed for this context")); | 372 "Code generation from strings disallowed for this context"); |
373 } | 373 } |
374 | 374 |
375 | 375 |
376 #ifdef DEBUG | 376 #ifdef DEBUG |
377 bool Context::IsBootstrappingOrValidParentContext( | 377 bool Context::IsBootstrappingOrValidParentContext( |
378 Object* object, Context* child) { | 378 Object* object, Context* child) { |
379 // During bootstrapping we allow all objects to pass as | 379 // During bootstrapping we allow all objects to pass as |
380 // contexts. This is necessary to fix circular dependencies. | 380 // contexts. This is necessary to fix circular dependencies. |
381 if (child->GetIsolate()->bootstrapper()->IsActive()) return true; | 381 if (child->GetIsolate()->bootstrapper()->IsActive()) return true; |
382 if (!object->IsContext()) return false; | 382 if (!object->IsContext()) return false; |
383 Context* context = Context::cast(object); | 383 Context* context = Context::cast(object); |
384 return context->IsNativeContext() || context->IsGlobalContext() || | 384 return context->IsNativeContext() || context->IsGlobalContext() || |
385 context->IsModuleContext() || !child->IsModuleContext(); | 385 context->IsModuleContext() || !child->IsModuleContext(); |
386 } | 386 } |
387 | 387 |
388 | 388 |
389 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { | 389 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { |
390 // During bootstrapping we allow all objects to pass as global | 390 // During bootstrapping we allow all objects to pass as global |
391 // objects. This is necessary to fix circular dependencies. | 391 // objects. This is necessary to fix circular dependencies. |
392 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 392 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
393 isolate->bootstrapper()->IsActive() || | 393 isolate->bootstrapper()->IsActive() || |
394 object->IsGlobalObject(); | 394 object->IsGlobalObject(); |
395 } | 395 } |
396 #endif | 396 #endif |
397 | 397 |
398 } } // namespace v8::internal | 398 } } // namespace v8::internal |
OLD | NEW |