| Index: src/debug.cc
|
| diff --git a/src/debug.cc b/src/debug.cc
|
| index e908126d895c3132c82ffe8f0aa1ecc606aac36c..3586a1836db64cf8ae8f721af0b6bdf33bbd5982 100644
|
| --- a/src/debug.cc
|
| +++ b/src/debug.cc
|
| @@ -622,7 +622,14 @@ void ScriptCache::Add(Handle<Script> script) {
|
| HashMap::Entry* entry =
|
| HashMap::Lookup(reinterpret_cast<void*>(id), Hash(id), true);
|
| if (entry->value != NULL) {
|
| - ASSERT(*script == *reinterpret_cast<Script**>(entry->value));
|
| +#ifdef DEBUG
|
| + // The code deserializer may introduce duplicate Script objects.
|
| + // Assert that the Script objects with the same id have the same name.
|
| + Handle<Script> found(reinterpret_cast<Script**>(entry->value));
|
| + ASSERT(script->id() == found->id());
|
| + ASSERT(!script->name()->IsString() ||
|
| + String::cast(script->name())->Equals(String::cast(found->name())));
|
| +#endif
|
| return;
|
| }
|
| // Globalize the script object, make it weak and use the location of the
|
| @@ -1482,17 +1489,7 @@ void Debug::PrepareStep(StepAction step_action,
|
| bool is_call_ic = call_function_stub->kind() == Code::CALL_IC;
|
|
|
| // Find out number of arguments from the stub minor key.
|
| - // Reverse lookup required as the minor key cannot be retrieved
|
| - // from the code object.
|
| - Handle<Object> obj(
|
| - isolate_->heap()->code_stubs()->SlowReverseLookup(
|
| - *call_function_stub),
|
| - isolate_);
|
| - ASSERT(!obj.is_null());
|
| - ASSERT(!(*obj)->IsUndefined());
|
| - ASSERT(obj->IsSmi());
|
| - // Get the STUB key and extract major and minor key.
|
| - uint32_t key = Smi::cast(*obj)->value();
|
| + uint32_t key = call_function_stub->stub_key();
|
| // Argc in the stub is the number of arguments passed - not the
|
| // expected arguments of the called function.
|
| int call_function_arg_count = is_call_ic
|
|
|