| Index: src/objects.cc
|
| ===================================================================
|
| --- src/objects.cc (revision 11394)
|
| +++ src/objects.cc (working copy)
|
| @@ -7918,6 +7918,23 @@
|
| }
|
|
|
|
|
| +Code* SharedFunctionInfo::SearchOptimizedCodeMap(Context* global_context) {
|
| + ASSERT(global_context->IsGlobalContext());
|
| + Object* value = optimized_code_map();
|
| + if (!value->IsSmi()) {
|
| + FixedArray* optimized_code_map = FixedArray::cast(value);
|
| + int length = optimized_code_map->length();
|
| + for (int i = 0; i < length; i += 2) {
|
| + if (optimized_code_map->get(i) == global_context) {
|
| + return Code::cast(optimized_code_map->get(i + 1));
|
| + }
|
| + }
|
| + }
|
| +
|
| + return NULL;
|
| +}
|
| +
|
| +
|
| void SharedFunctionInfo::SharedFunctionInfoIterateBody(ObjectVisitor* v) {
|
| v->VisitSharedFunctionInfo(this);
|
| SharedFunctionInfo::BodyDescriptor::IterateBody(this, v);
|
| @@ -8189,11 +8206,14 @@
|
| case Translation::JS_FRAME: {
|
| int ast_id = iterator.Next();
|
| int function_id = iterator.Next();
|
| - JSFunction* function =
|
| - JSFunction::cast(LiteralArray()->get(function_id));
|
| unsigned height = iterator.Next();
|
| PrintF(out, "{ast_id=%d, function=", ast_id);
|
| - function->PrintName(out);
|
| + if (function_id != Translation::kSelfLiteralId) {
|
| + Object* function = LiteralArray()->get(function_id);
|
| + JSFunction::cast(function)->PrintName(out);
|
| + } else {
|
| + PrintF(out, "<self>");
|
| + }
|
| PrintF(out, ", height=%u}", height);
|
| break;
|
| }
|
|
|