OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 6077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6088 return Handle<String>(String::cast(*raw_name->handle())); | 6088 return Handle<String>(String::cast(*raw_name->handle())); |
6089 } | 6089 } |
6090 } | 6090 } |
6091 | 6091 |
6092 | 6092 |
6093 void Reference::GetValue(TypeofState typeof_state) { | 6093 void Reference::GetValue(TypeofState typeof_state) { |
6094 ASSERT(!cgen_->in_spilled_code()); | 6094 ASSERT(!cgen_->in_spilled_code()); |
6095 ASSERT(cgen_->HasValidEntryRegisters()); | 6095 ASSERT(cgen_->HasValidEntryRegisters()); |
6096 ASSERT(!is_illegal()); | 6096 ASSERT(!is_illegal()); |
6097 MacroAssembler* masm = cgen_->masm(); | 6097 MacroAssembler* masm = cgen_->masm(); |
| 6098 |
| 6099 // Record the source position for the property load. |
| 6100 Property* property = expression_->AsProperty(); |
| 6101 if (property != NULL) { |
| 6102 cgen_->CodeForSourcePosition(property->position()); |
| 6103 } |
| 6104 |
6098 switch (type_) { | 6105 switch (type_) { |
6099 case SLOT: { | 6106 case SLOT: { |
6100 Comment cmnt(masm, "[ Load from Slot"); | 6107 Comment cmnt(masm, "[ Load from Slot"); |
6101 Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot(); | 6108 Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot(); |
6102 ASSERT(slot != NULL); | 6109 ASSERT(slot != NULL); |
6103 cgen_->LoadFromSlotCheckForArguments(slot, typeof_state); | 6110 cgen_->LoadFromSlotCheckForArguments(slot, typeof_state); |
6104 break; | 6111 break; |
6105 } | 6112 } |
6106 | 6113 |
6107 case NAMED: { | 6114 case NAMED: { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6179 break; | 6186 break; |
6180 } | 6187 } |
6181 | 6188 |
6182 case KEYED: { | 6189 case KEYED: { |
6183 // TODO(1241834): Make sure that this it is safe to ignore the | 6190 // TODO(1241834): Make sure that this it is safe to ignore the |
6184 // distinction between expressions in a typeof and not in a typeof. | 6191 // distinction between expressions in a typeof and not in a typeof. |
6185 Comment cmnt(masm, "[ Load from keyed Property"); | 6192 Comment cmnt(masm, "[ Load from keyed Property"); |
6186 Variable* var = expression_->AsVariableProxy()->AsVariable(); | 6193 Variable* var = expression_->AsVariableProxy()->AsVariable(); |
6187 bool is_global = var != NULL; | 6194 bool is_global = var != NULL; |
6188 ASSERT(!is_global || var->is_global()); | 6195 ASSERT(!is_global || var->is_global()); |
| 6196 |
6189 // Inline array load code if inside of a loop. We do not know | 6197 // Inline array load code if inside of a loop. We do not know |
6190 // the receiver map yet, so we initially generate the code with | 6198 // the receiver map yet, so we initially generate the code with |
6191 // a check against an invalid map. In the inline cache code, we | 6199 // a check against an invalid map. In the inline cache code, we |
6192 // patch the map check if appropriate. | 6200 // patch the map check if appropriate. |
6193 if (cgen_->loop_nesting() > 0) { | 6201 if (cgen_->loop_nesting() > 0) { |
6194 Comment cmnt(masm, "[ Inlined load from keyed Property"); | 6202 Comment cmnt(masm, "[ Inlined load from keyed Property"); |
6195 | 6203 |
6196 Result key = cgen_->frame()->Pop(); | 6204 Result key = cgen_->frame()->Pop(); |
6197 Result receiver = cgen_->frame()->Pop(); | 6205 Result receiver = cgen_->frame()->Pop(); |
6198 key.ToRegister(); | 6206 key.ToRegister(); |
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7841 | 7849 |
7842 // Slow-case: Go through the JavaScript implementation. | 7850 // Slow-case: Go through the JavaScript implementation. |
7843 __ bind(&slow); | 7851 __ bind(&slow); |
7844 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 7852 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
7845 } | 7853 } |
7846 | 7854 |
7847 | 7855 |
7848 #undef __ | 7856 #undef __ |
7849 | 7857 |
7850 } } // namespace v8::internal | 7858 } } // namespace v8::internal |
OLD | NEW |