OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 { \ | 49 { \ |
50 Failure* __failure__ = Failure::cast(RESULT); \ | 50 Failure* __failure__ = Failure::cast(RESULT); \ |
51 if (!Heap::CollectGarbage(__failure__->requested(), \ | 51 if (!Heap::CollectGarbage(__failure__->requested(), \ |
52 __failure__->allocation_space())) { \ | 52 __failure__->allocation_space())) { \ |
53 /* TODO(1181417): Fix this. */ \ | 53 /* TODO(1181417): Fix this. */ \ |
54 V8::FatalProcessOutOfMemory("Handles"); \ | 54 V8::FatalProcessOutOfMemory("Handles"); \ |
55 } \ | 55 } \ |
56 } | 56 } |
57 | 57 |
58 | 58 |
59 // Don't use the following names: __object__, __failure__. | |
60 #define CALL_HEAP_FUNCTION_VOID(FUNCTION_CALL) \ | |
61 GC_GREEDY_CHECK(); \ | |
62 Object* __object__ = FUNCTION_CALL; \ | |
63 if (__object__->IsFailure()) { \ | |
64 if (__object__->IsRetryAfterGC()) { \ | |
65 Failure* __failure__ = Failure::cast(__object__); \ | |
66 if (!Heap::CollectGarbage(__failure__->requested(), \ | |
67 __failure__->allocation_space())) { \ | |
68 /* TODO(1181417): Fix this. */ \ | |
69 V8::FatalProcessOutOfMemory("Handles"); \ | |
70 } \ | |
71 __object__ = FUNCTION_CALL; \ | |
72 if (__object__->IsFailure()) { \ | |
73 if (__object__->IsRetryAfterGC()) { \ | |
74 /* TODO(1181417): Fix this. */ \ | |
75 V8::FatalProcessOutOfMemory("Handles"); \ | |
76 } \ | |
77 return; \ | |
78 } \ | |
79 } else { \ | |
80 return; \ | |
81 } \ | |
82 } | |
83 | |
84 | |
85 | |
86 | |
87 Handle<FixedArray> AddKeysFromJSArray(Handle<FixedArray> content, | 59 Handle<FixedArray> AddKeysFromJSArray(Handle<FixedArray> content, |
88 Handle<JSArray> array) { | 60 Handle<JSArray> array) { |
89 CALL_HEAP_FUNCTION(content->AddKeysFromJSArray(*array), FixedArray); | 61 CALL_HEAP_FUNCTION(content->AddKeysFromJSArray(*array), FixedArray); |
90 } | 62 } |
91 | 63 |
92 | 64 |
93 Handle<FixedArray> UnionOfKeys(Handle<FixedArray> first, | 65 Handle<FixedArray> UnionOfKeys(Handle<FixedArray> first, |
94 Handle<FixedArray> second) { | 66 Handle<FixedArray> second) { |
95 CALL_HEAP_FUNCTION(first->UnionOfKeys(*second), FixedArray); | 67 CALL_HEAP_FUNCTION(first->UnionOfKeys(*second), FixedArray); |
96 } | 68 } |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 Handle<Context> security_context) { | 548 Handle<Context> security_context) { |
577 Handle<FixedArray> arr = Factory::NewFixedArray(4); | 549 Handle<FixedArray> arr = Factory::NewFixedArray(4); |
578 arr->set(0, Smi::FromInt(index)); | 550 arr->set(0, Smi::FromInt(index)); |
579 arr->set(1, *compile_context); // Compile in this context | 551 arr->set(1, *compile_context); // Compile in this context |
580 arr->set(2, *function_context); // Set function context to this | 552 arr->set(2, *function_context); // Set function context to this |
581 arr->set(3, *security_context); // Receiver for call | 553 arr->set(3, *security_context); // Receiver for call |
582 fun->shared()->set_lazy_load_data(*arr); | 554 fun->shared()->set_lazy_load_data(*arr); |
583 } | 555 } |
584 | 556 |
585 } } // namespace v8::internal | 557 } } // namespace v8::internal |
OLD | NEW |