示例#1
0
  void test_recycle() {
    MethodContext* ctx = MethodContext::create(state, 10);

    TS_ASSERT(state->om->context_on_stack_p(ctx));
    TS_ASSERT(!state->om->context_referenced_p(ctx));

    TS_ASSERT(ctx->recycle(state));

    MethodContext* ctx2 = MethodContext::create(state, 10);
    TS_ASSERT_EQUALS(ctx, ctx2);
  }
示例#2
0
 void test_recycle_ignores_mature_contexts() {
   MethodContext* ctx = MethodContext::create(state, 10);
   ctx->zone = MatureObjectZone; // GROSS
   TS_ASSERT(!ctx->recycle(state));
 }