Chromium Code Reviews| Index: src/x64/stub-cache-x64.cc |
| diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
| index bd723df653fe014dccccbe3e7efe60d4add426b2..be79ab43ab0a6921e0484e645156e2a3c43c5f02 100644 |
| --- a/src/x64/stub-cache-x64.cc |
| +++ b/src/x64/stub-cache-x64.cc |
| @@ -82,7 +82,55 @@ static void ProbeTable(Isolate* isolate, |
| // must always call a backup property check that is complete. |
| // This function is safe to call if the receiver has fast properties. |
| // Name must be a symbol and receiver must be a heap object. |
| -MUST_USE_RESULT static MaybeObject* GenerateDictionaryNegativeLookup( |
| +static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, |
| + Label* miss_label, |
|
ulan
2011/10/24 16:28:25
Indentation is broken.
|
| + Register receiver, |
| + Handle<String> name, |
| + Register r0, |
| + Register r1) { |
| + ASSERT(name->IsSymbol()); |
| + Counters* counters = masm->isolate()->counters(); |
| + __ IncrementCounter(counters->negative_lookups(), 1); |
| + __ IncrementCounter(counters->negative_lookups_miss(), 1); |
| + |
| + __ movq(r0, FieldOperand(receiver, HeapObject::kMapOffset)); |
| + |
| + const int kInterceptorOrAccessCheckNeededMask = |
| + (1 << Map::kHasNamedInterceptor) | (1 << Map::kIsAccessCheckNeeded); |
| + |
| + // Bail out if the receiver has a named interceptor or requires access checks. |
| + __ testb(FieldOperand(r0, Map::kBitFieldOffset), |
| + Immediate(kInterceptorOrAccessCheckNeededMask)); |
| + __ j(not_zero, miss_label); |
| + |
| + // Check that receiver is a JSObject. |
| + __ CmpInstanceType(r0, FIRST_SPEC_OBJECT_TYPE); |
| + __ j(below, miss_label); |
| + |
| + // Load properties array. |
| + Register properties = r0; |
| + __ movq(properties, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
| + |
| + // Check that the properties array is a dictionary. |
| + __ CompareRoot(FieldOperand(properties, HeapObject::kMapOffset), |
| + Heap::kHashTableMapRootIndex); |
| + __ j(not_equal, miss_label); |
| + |
| + Label done; |
| + StringDictionaryLookupStub::GenerateNegativeLookup(masm, |
| + miss_label, |
| + &done, |
| + properties, |
| + name, |
| + r1); |
| + __ bind(&done); |
| + __ DecrementCounter(counters->negative_lookups_miss(), 1); |
| +} |
| + |
| + |
| +// TODO(kmillikin): Eliminate this function when the stub cache is fully |
| +// handlified. |
| +MUST_USE_RESULT static MaybeObject* TryGenerateDictionaryNegativeLookup( |
| MacroAssembler* masm, |
| Label* miss_label, |
| Register receiver, |
| @@ -118,7 +166,7 @@ MUST_USE_RESULT static MaybeObject* GenerateDictionaryNegativeLookup( |
| __ j(not_equal, miss_label); |
| Label done; |
| - MaybeObject* result = StringDictionaryLookupStub::GenerateNegativeLookup( |
| + MaybeObject* result = StringDictionaryLookupStub::TryGenerateNegativeLookup( |
| masm, |
| miss_label, |
| &done, |
| @@ -312,8 +360,10 @@ void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm, |
| // are loaded directly otherwise the property is loaded from the properties |
| // fixed array. |
| void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, |
| - Register dst, Register src, |
| - JSObject* holder, int index) { |
| + Register dst, |
| + Register src, |
| + Handle<JSObject> holder, |
| + int index) { |
| // Adjust for the number of properties stored in the holder. |
| index -= holder->map()->inobject_properties(); |
| if (index < 0) { |
| @@ -808,7 +858,24 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm, |
| // Generate code to check that a global property cell is empty. Create |
| // the property cell at compilation time if no cell exists for the |
| // property. |
| -MUST_USE_RESULT static MaybeObject* GenerateCheckPropertyCell( |
| +static void GenerateCheckPropertyCell(MacroAssembler* masm, |
| + Handle<GlobalObject> global, |
| + Handle<String> name, |
| + Register scratch, |
| + Label* miss) { |
| + Handle<JSGlobalPropertyCell> cell = |
| + GlobalObject::EnsurePropertyCell(global, name); |
| + ASSERT(cell->value()->IsTheHole()); |
| + __ Move(scratch, cell); |
| + __ Cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset), |
| + masm->isolate()->factory()->the_hole_value()); |
| + __ j(not_equal, miss); |
| +} |
| + |
| + |
| +// TODO(kmillikin): Eliminate this function when the stub cache is fully |
| +// handlified. |
| +MUST_USE_RESULT static MaybeObject* TryGenerateCheckPropertyCell( |
| MacroAssembler* masm, |
| GlobalObject* global, |
| String* name, |
| @@ -828,10 +895,172 @@ MUST_USE_RESULT static MaybeObject* GenerateCheckPropertyCell( |
| } |
| +// Calls GenerateCheckPropertyCell for each global object in the prototype chain |
| +// from object to (but not including) holder. |
| +static void GenerateCheckPropertyCells(MacroAssembler* masm, |
| + Handle<JSObject> object, |
| + Handle<JSObject> holder, |
| + Handle<String> name, |
| + Register scratch, |
| + Label* miss) { |
| + Handle<JSObject> current = object; |
| + while (!current.is_identical_to(holder)) { |
| + if (current->IsGlobalObject()) { |
| + GenerateCheckPropertyCell(masm, |
| + Handle<GlobalObject>::cast(current), |
| + name, |
| + scratch, |
| + miss); |
| + } |
| + current = Handle<JSObject>(JSObject::cast(current->GetPrototype())); |
| + } |
| +} |
| + |
| + |
| +// TODO(kmillikin): Eliminate this function when the stub cache is fully |
| +// handlified. |
| +MUST_USE_RESULT static MaybeObject* TryGenerateCheckPropertyCells( |
| + MacroAssembler* masm, |
| + JSObject* object, |
| + JSObject* holder, |
| + String* name, |
| + Register scratch, |
| + Label* miss) { |
| + JSObject* current = object; |
| + while (current != holder) { |
| + if (current->IsGlobalObject()) { |
| + // Returns a cell or a failure. |
| + MaybeObject* result = TryGenerateCheckPropertyCell( |
| + masm, |
| + GlobalObject::cast(current), |
| + name, |
| + scratch, |
| + miss); |
| + if (result->IsFailure()) return result; |
| + } |
| + ASSERT(current->IsJSObject()); |
| + current = JSObject::cast(current->GetPrototype()); |
| + } |
| + return NULL; |
| +} |
| + |
| + |
| #undef __ |
| #define __ ACCESS_MASM((masm())) |
| +Register StubCompiler::CheckPrototypes(Handle<JSObject> object, |
| + Register object_reg, |
| + Handle<JSObject> holder, |
| + Register holder_reg, |
| + Register scratch1, |
| + Register scratch2, |
| + Handle<String> name, |
| + int save_at_depth, |
| + Label* miss) { |
| + // Make sure there's no overlap between holder and object registers. |
| + ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); |
| + ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg) |
| + && !scratch2.is(scratch1)); |
| + |
| + // Keep track of the current object in register reg. On the first |
| + // iteration, reg is an alias for object_reg, on later iterations, |
| + // it is an alias for holder_reg. |
| + Register reg = object_reg; |
| + int depth = 0; |
| + |
| + if (save_at_depth == depth) { |
| + __ movq(Operand(rsp, kPointerSize), object_reg); |
| + } |
| + |
| + // Check the maps in the prototype chain. |
| + // Traverse the prototype chain from the object and do map checks. |
| + Handle<JSObject> current = object; |
| + while (!current.is_identical_to(holder)) { |
| + ++depth; |
| + |
| + // Only global objects and objects that do not require access |
| + // checks are allowed in stubs. |
| + ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded()); |
| + |
| + Handle<JSObject> prototype(JSObject::cast(current->GetPrototype())); |
| + if (!current->HasFastProperties() && |
| + !current->IsJSGlobalObject() && |
| + !current->IsJSGlobalProxy()) { |
| + if (!name->IsSymbol()) { |
| + name = factory()->LookupSymbol(name); |
| + } |
| + ASSERT(current->property_dictionary()->FindEntry(*name) == |
| + StringDictionary::kNotFound); |
| + |
| + GenerateDictionaryNegativeLookup(masm(), miss, reg, name, |
| + scratch1, scratch2); |
| + |
| + __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); |
| + reg = holder_reg; // From now on the object will be in holder_reg. |
| + __ movq(reg, FieldOperand(scratch1, Map::kPrototypeOffset)); |
| + } else { |
| + bool in_new_space = heap()->InNewSpace(*prototype); |
| + Handle<Map> current_map(current->map()); |
| + if (in_new_space) { |
| + // Save the map in scratch1 for later. |
| + __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset)); |
| + __ Cmp(scratch1, current_map); |
| + } else { |
| + __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), current_map); |
| + } |
| + // Branch on the result of the map check. |
| + __ j(not_equal, miss); |
| + // Check access rights to the global object. This has to happen after |
| + // the map check so that we know that the object is actually a global |
| + // object. |
| + if (current->IsJSGlobalProxy()) { |
| + __ CheckAccessGlobalProxy(reg, scratch2, miss); |
| + } |
| + reg = holder_reg; // From now on the object will be in holder_reg. |
| + |
| + if (in_new_space) { |
| + // The prototype is in new space; we cannot store a reference to it |
| + // in the code. Load it from the map. |
| + __ movq(reg, FieldOperand(scratch1, Map::kPrototypeOffset)); |
| + } else { |
| + // The prototype is in old space; load it directly. |
| + __ Move(reg, prototype); |
| + } |
| + } |
| + |
| + if (save_at_depth == depth) { |
| + __ movq(Operand(rsp, kPointerSize), reg); |
| + } |
| + |
| + // Go to the next object in the prototype chain. |
| + current = prototype; |
| + } |
| + ASSERT(current.is_identical_to(holder)); |
| + |
| + // Log the check depth. |
| + LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
| + |
| + // Check the holder map. |
| + __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), Handle<Map>(holder->map())); |
| + __ j(not_equal, miss); |
| + |
| + // Perform security check for access to the global object. |
| + ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded()); |
| + if (current->IsJSGlobalProxy()) { |
| + __ CheckAccessGlobalProxy(reg, scratch1, miss); |
| + } |
| + |
| + // If we've skipped any global objects, it's not enough to verify that |
| + // their maps haven't changed. We also need to check that the property |
| + // cell for the property is still empty. |
| + GenerateCheckPropertyCells(masm(), object, holder, name, scratch1, miss); |
| + |
| + // Return the register containing the holder. |
| + return reg; |
| +} |
| + |
| + |
| Register StubCompiler::CheckPrototypes(JSObject* object, |
| Register object_reg, |
| JSObject* holder, |
| @@ -882,12 +1111,13 @@ Register StubCompiler::CheckPrototypes(JSObject* object, |
| ASSERT(current->property_dictionary()->FindEntry(name) == |
| StringDictionary::kNotFound); |
| - MaybeObject* negative_lookup = GenerateDictionaryNegativeLookup(masm(), |
| - miss, |
| - reg, |
| - name, |
| - scratch1, |
| - scratch2); |
| + MaybeObject* negative_lookup = |
| + TryGenerateDictionaryNegativeLookup(masm(), |
| + miss, |
| + reg, |
| + name, |
| + scratch1, |
| + scratch2); |
| if (negative_lookup->IsFailure()) { |
| set_failure(Failure::cast(negative_lookup)); |
| return reg; |
| @@ -960,21 +1190,13 @@ Register StubCompiler::CheckPrototypes(JSObject* object, |
| // If we've skipped any global objects, it's not enough to verify |
| // that their maps haven't changed. We also need to check that the |
| // property cell for the property is still empty. |
| - current = object; |
| - while (current != holder) { |
| - if (current->IsGlobalObject()) { |
| - MaybeObject* cell = GenerateCheckPropertyCell(masm(), |
| - GlobalObject::cast(current), |
| - name, |
| - scratch1, |
| - miss); |
| - if (cell->IsFailure()) { |
| - set_failure(Failure::cast(cell)); |
| - return reg; |
| - } |
| - } |
| - current = JSObject::cast(current->GetPrototype()); |
| - } |
| + MaybeObject* result = TryGenerateCheckPropertyCells(masm(), |
| + object, |
| + holder, |
| + name, |
| + scratch1, |
| + miss); |
| + if (result->IsFailure()) set_failure(Failure::cast(result)); |
|
ulan
2011/10/24 16:28:25
The result can be NULL. It works but looks suspici
|
| // Return the register containing the holder. |
| return reg; |
| @@ -999,7 +1221,7 @@ void StubCompiler::GenerateLoadField(JSObject* object, |
| scratch1, scratch2, scratch3, name, miss); |
| // Get the value from the properties. |
| - GenerateFastPropertyLoad(masm(), rax, reg, holder, index); |
| + GenerateFastPropertyLoad(masm(), rax, reg, Handle<JSObject>(holder), index); |
| __ ret(0); |
| } |
| @@ -1198,7 +1420,8 @@ void StubCompiler::GenerateLoadInterceptor(JSObject* object, |
| // We found FIELD property in prototype chain of interceptor's holder. |
| // Retrieve a field from field's holder. |
| GenerateFastPropertyLoad(masm(), rax, holder_reg, |
| - lookup->holder(), lookup->GetFieldIndex()); |
| + Handle<JSObject>(lookup->holder()), |
| + lookup->GetFieldIndex()); |
| __ ret(0); |
| } else { |
| // We found CALLBACKS property in prototype chain of interceptor's |
| @@ -1244,9 +1467,9 @@ void StubCompiler::GenerateLoadInterceptor(JSObject* object, |
| } |
| -void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) { |
| +void CallStubCompiler::GenerateNameCheck(Handle<String> name, Label* miss) { |
| if (kind_ == Code::KEYED_CALL_IC) { |
| - __ Cmp(rcx, Handle<String>(name)); |
| + __ Cmp(rcx, name); |
| __ j(not_equal, miss); |
| } |
| } |
| @@ -1305,7 +1528,18 @@ void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell, |
| } |
| -MaybeObject* CallStubCompiler::GenerateMissBranch() { |
| +void CallStubCompiler::GenerateMissBranch() { |
| + Handle<Code> code = |
| + isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(), |
| + kind_, |
| + extra_state_); |
| + __ Jump(code, RelocInfo::CODE_TARGET); |
| +} |
| + |
| + |
| +// TODO(kmillikin): Eliminate this function when the stub cache is fully |
| +// handlified. |
| +MaybeObject* CallStubCompiler::TryGenerateMissBranch() { |
| MaybeObject* maybe_obj = |
| isolate()->stub_cache()->TryComputeCallMiss(arguments().immediate(), |
| kind_, |
| @@ -1317,10 +1551,10 @@ MaybeObject* CallStubCompiler::GenerateMissBranch() { |
| } |
| -MaybeObject* CallStubCompiler::CompileCallField(JSObject* object, |
| - JSObject* holder, |
| +Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object, |
| + Handle<JSObject> holder, |
| int index, |
| - String* name) { |
| + Handle<String> name) { |
| // ----------- S t a t e ------------- |
| // rcx : function name |
| // rsp[0] : return address |
| @@ -1367,9 +1601,7 @@ MaybeObject* CallStubCompiler::CompileCallField(JSObject* object, |
| NullCallWrapper(), call_kind); |
| // Handle call cache miss. |
| - __ bind(&miss); |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| - if (maybe_result->IsFailure()) return maybe_result; |
| + __ bind(&miss);GenerateMissBranch(); |
|
ulan
2011/10/24 16:28:25
New line between statements.
|
| // Return the generated code. |
| return GetCode(FIELD, name); |
| @@ -1394,7 +1626,7 @@ MaybeObject* CallStubCompiler::CompileArrayPushCall(Object* object, |
| Label miss; |
| - GenerateNameCheck(name, &miss); |
| + GenerateNameCheck(Handle<String>(name), &miss); |
| // Get the receiver from the stack. |
| const int argc = arguments().immediate(); |
| @@ -1553,11 +1785,11 @@ MaybeObject* CallStubCompiler::CompileArrayPushCall(Object* object, |
| } |
| __ bind(&miss); |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| + MaybeObject* maybe_result = TryGenerateMissBranch(); |
| if (maybe_result->IsFailure()) return maybe_result; |
| // Return the generated code. |
| - return GetCode(function); |
| + return TryGetCode(function); |
| } |
| @@ -1579,7 +1811,7 @@ MaybeObject* CallStubCompiler::CompileArrayPopCall(Object* object, |
| Label miss, return_undefined, call_builtin; |
| - GenerateNameCheck(name, &miss); |
| + GenerateNameCheck(Handle<String>(name), &miss); |
| // Get the receiver from the stack. |
| const int argc = arguments().immediate(); |
| @@ -1636,11 +1868,11 @@ MaybeObject* CallStubCompiler::CompileArrayPopCall(Object* object, |
| 1); |
| __ bind(&miss); |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| + MaybeObject* maybe_result = TryGenerateMissBranch(); |
| if (maybe_result->IsFailure()) return maybe_result; |
| // Return the generated code. |
| - return GetCode(function); |
| + return TryGetCode(function); |
| } |
| @@ -1674,7 +1906,7 @@ MaybeObject* CallStubCompiler::CompileStringCharCodeAtCall( |
| index_out_of_range_label = &miss; |
| } |
| - GenerateNameCheck(name, &name_miss); |
| + GenerateNameCheck(Handle<String>(name), &name_miss); |
| // Check that the maps starting from the prototype haven't changed. |
| GenerateDirectLoadGlobalFunctionPrototype(masm(), |
| @@ -1720,11 +1952,11 @@ MaybeObject* CallStubCompiler::CompileStringCharCodeAtCall( |
| // Restore function name in rcx. |
| __ Move(rcx, Handle<String>(name)); |
| __ bind(&name_miss); |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| + MaybeObject* maybe_result = TryGenerateMissBranch(); |
| if (maybe_result->IsFailure()) return maybe_result; |
| // Return the generated code. |
| - return GetCode(function); |
| + return TryGetCode(function); |
| } |
| @@ -1758,7 +1990,7 @@ MaybeObject* CallStubCompiler::CompileStringCharAtCall( |
| index_out_of_range_label = &miss; |
| } |
| - GenerateNameCheck(name, &name_miss); |
| + GenerateNameCheck(Handle<String>(name), &name_miss); |
| // Check that the maps starting from the prototype haven't changed. |
| GenerateDirectLoadGlobalFunctionPrototype(masm(), |
| @@ -1806,11 +2038,11 @@ MaybeObject* CallStubCompiler::CompileStringCharAtCall( |
| // Restore function name in rcx. |
| __ Move(rcx, Handle<String>(name)); |
| __ bind(&name_miss); |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| + MaybeObject* maybe_result = TryGenerateMissBranch(); |
| if (maybe_result->IsFailure()) return maybe_result; |
| // Return the generated code. |
| - return GetCode(function); |
| + return TryGetCode(function); |
| } |
| @@ -1835,7 +2067,7 @@ MaybeObject* CallStubCompiler::CompileStringFromCharCodeCall( |
| if (!object->IsJSObject() || argc != 1) return heap()->undefined_value(); |
| Label miss; |
| - GenerateNameCheck(name, &miss); |
| + GenerateNameCheck(Handle<String>(name), &miss); |
| if (cell == NULL) { |
| __ movq(rdx, Operand(rsp, 2 * kPointerSize)); |
| @@ -1879,11 +2111,11 @@ MaybeObject* CallStubCompiler::CompileStringFromCharCodeCall( |
| __ bind(&miss); |
| // rcx: function name. |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| + MaybeObject* maybe_result = TryGenerateMissBranch(); |
| if (maybe_result->IsFailure()) return maybe_result; |
| // Return the generated code. |
| - return (cell == NULL) ? GetCode(function) : GetCode(NORMAL, name); |
| + return (cell == NULL) ? TryGetCode(function) : TryGetCode(NORMAL, name); |
| } |
| @@ -1917,7 +2149,7 @@ MaybeObject* CallStubCompiler::CompileMathAbsCall(Object* object, |
| if (!object->IsJSObject() || argc != 1) return heap()->undefined_value(); |
| Label miss; |
| - GenerateNameCheck(name, &miss); |
| + GenerateNameCheck(Handle<String>(name), &miss); |
| if (cell == NULL) { |
| __ movq(rdx, Operand(rsp, 2 * kPointerSize)); |
| @@ -1996,11 +2228,11 @@ MaybeObject* CallStubCompiler::CompileMathAbsCall(Object* object, |
| __ bind(&miss); |
| // rcx: function name. |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| + MaybeObject* maybe_result = TryGenerateMissBranch(); |
| if (maybe_result->IsFailure()) return maybe_result; |
| // Return the generated code. |
| - return (cell == NULL) ? GetCode(function) : GetCode(NORMAL, name); |
| + return (cell == NULL) ? TryGetCode(function) : TryGetCode(NORMAL, name); |
| } |
| @@ -2023,7 +2255,7 @@ MaybeObject* CallStubCompiler::CompileFastApiCall( |
| Label miss, miss_before_stack_reserved; |
| - GenerateNameCheck(name, &miss_before_stack_reserved); |
| + GenerateNameCheck(Handle<String>(name), &miss_before_stack_reserved); |
| // Get the receiver from the stack. |
| const int argc = arguments().immediate(); |
| @@ -2055,11 +2287,11 @@ MaybeObject* CallStubCompiler::CompileFastApiCall( |
| __ addq(rsp, Immediate(kFastApiCallArguments * kPointerSize)); |
| __ bind(&miss_before_stack_reserved); |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| + MaybeObject* maybe_result = TryGenerateMissBranch(); |
| if (maybe_result->IsFailure()) return maybe_result; |
| // Return the generated code. |
| - return GetCode(function); |
| + return TryGetCode(function); |
| } |
| @@ -2089,7 +2321,7 @@ MaybeObject* CallStubCompiler::CompileCallConstant(Object* object, |
| Label miss; |
| - GenerateNameCheck(name, &miss); |
| + GenerateNameCheck(Handle<String>(name), &miss); |
| // Get the receiver from the stack. |
| const int argc = arguments().immediate(); |
| @@ -2194,11 +2426,11 @@ MaybeObject* CallStubCompiler::CompileCallConstant(Object* object, |
| // Handle call cache miss. |
| __ bind(&miss); |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| + MaybeObject* maybe_result = TryGenerateMissBranch(); |
| if (maybe_result->IsFailure()) return maybe_result; |
| // Return the generated code. |
| - return GetCode(function); |
| + return TryGetCode(function); |
| } |
| @@ -2216,7 +2448,7 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object, |
| // ----------------------------------- |
| Label miss; |
| - GenerateNameCheck(name, &miss); |
| + GenerateNameCheck(Handle<String>(name), &miss); |
| // Get the number of arguments. |
| const int argc = arguments().immediate(); |
| @@ -2265,11 +2497,11 @@ MaybeObject* CallStubCompiler::CompileCallInterceptor(JSObject* object, |
| // Handle load cache miss. |
| __ bind(&miss); |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| + MaybeObject* maybe_result = TryGenerateMissBranch(); |
| if (maybe_result->IsFailure()) return maybe_result; |
| // Return the generated code. |
| - return GetCode(INTERCEPTOR, name); |
| + return TryGetCode(INTERCEPTOR, name); |
| } |
| @@ -2299,7 +2531,7 @@ MaybeObject* CallStubCompiler::CompileCallGlobal(JSObject* object, |
| Label miss; |
| - GenerateNameCheck(name, &miss); |
| + GenerateNameCheck(Handle<String>(name), &miss); |
| // Get the number of arguments. |
| const int argc = arguments().immediate(); |
| @@ -2334,11 +2566,11 @@ MaybeObject* CallStubCompiler::CompileCallGlobal(JSObject* object, |
| // Handle call cache miss. |
| __ bind(&miss); |
| __ IncrementCounter(counters->call_global_inline_miss(), 1); |
| - MaybeObject* maybe_result = GenerateMissBranch(); |
| + MaybeObject* maybe_result = TryGenerateMissBranch(); |
| if (maybe_result->IsFailure()) return maybe_result; |
| // Return the generated code. |
| - return GetCode(NORMAL, name); |
| + return TryGetCode(NORMAL, name); |
| } |
| @@ -2658,11 +2890,11 @@ MaybeObject* LoadStubCompiler::CompileLoadNonexistent(String* name, |
| // If the last object in the prototype chain is a global object, |
| // check that the global property cell is empty. |
| if (last->IsGlobalObject()) { |
| - MaybeObject* cell = GenerateCheckPropertyCell(masm(), |
| - GlobalObject::cast(last), |
| - name, |
| - rdx, |
| - &miss); |
| + MaybeObject* cell = TryGenerateCheckPropertyCell(masm(), |
| + GlobalObject::cast(last), |
| + name, |
| + rdx, |
| + &miss); |
| if (cell->IsFailure()) { |
| miss.Unuse(); |
| return cell; |