OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5222 (!has_cc() && frame_->height() == original_height + 1)); | 5222 (!has_cc() && frame_->height() == original_height + 1)); |
5223 } | 5223 } |
5224 | 5224 |
5225 | 5225 |
5226 class DeferredReferenceGetNamedValue: public DeferredCode { | 5226 class DeferredReferenceGetNamedValue: public DeferredCode { |
5227 public: | 5227 public: |
5228 explicit DeferredReferenceGetNamedValue(Handle<String> name) : name_(name) { | 5228 explicit DeferredReferenceGetNamedValue(Handle<String> name) : name_(name) { |
5229 set_comment("[ DeferredReferenceGetNamedValue"); | 5229 set_comment("[ DeferredReferenceGetNamedValue"); |
5230 } | 5230 } |
5231 | 5231 |
| 5232 virtual void BeforeGenerate(); |
5232 virtual void Generate(); | 5233 virtual void Generate(); |
| 5234 virtual void AfterGenerate(); |
5233 | 5235 |
5234 private: | 5236 private: |
5235 Handle<String> name_; | 5237 Handle<String> name_; |
5236 }; | 5238 }; |
5237 | 5239 |
5238 | 5240 |
| 5241 void DeferredReferenceGetNamedValue::BeforeGenerate() { |
| 5242 __ StartBlockConstPool(); |
| 5243 } |
| 5244 |
| 5245 |
5239 void DeferredReferenceGetNamedValue::Generate() { | 5246 void DeferredReferenceGetNamedValue::Generate() { |
5240 __ IncrementCounter(&Counters::named_load_inline_miss, 1, r1, r2); | 5247 __ IncrementCounter(&Counters::named_load_inline_miss, 1, r1, r2); |
5241 // Setup the name register and call load IC. | 5248 // Setup the name register and call load IC. |
5242 __ mov(r2, Operand(name_)); | 5249 __ mov(r2, Operand(name_)); |
5243 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); | 5250 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); |
5244 __ Call(ic, RelocInfo::CODE_TARGET); | 5251 __ Call(ic, RelocInfo::CODE_TARGET); |
5245 // The call must be followed by a b instruction to indicate that the inobject | 5252 // The call must be followed by a nop(1) instruction to indicate that the |
5246 // property case was inlined. Jumping back from the deferred code ensures | 5253 // inobject has been inlined. |
5247 // that. | 5254 __ nop(NAMED_PROPERTY_LOAD_INLINED); |
| 5255 } |
| 5256 |
| 5257 |
| 5258 void DeferredReferenceGetNamedValue::AfterGenerate() { |
| 5259 __ EndBlockConstPool(); |
5248 } | 5260 } |
5249 | 5261 |
5250 | 5262 |
5251 void CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) { | 5263 void CodeGenerator::EmitNamedLoad(Handle<String> name, bool is_contextual) { |
5252 if (is_contextual || scope()->is_global_scope() || loop_nesting() == 0) { | 5264 if (is_contextual || scope()->is_global_scope() || loop_nesting() == 0) { |
5253 Comment cmnt(masm(), "[ Load from named Property"); | 5265 Comment cmnt(masm(), "[ Load from named Property"); |
5254 // Setup the name register and call load IC. | 5266 // Setup the name register and call load IC. |
5255 __ mov(r2, Operand(name)); | 5267 __ mov(r2, Operand(name)); |
5256 frame_->CallLoadIC(is_contextual | 5268 frame_->CallLoadIC(is_contextual |
5257 ? RelocInfo::CODE_TARGET_CONTEXT | 5269 ? RelocInfo::CODE_TARGET_CONTEXT |
(...skipping 4056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9314 | 9326 |
9315 // Just jump to runtime to add the two strings. | 9327 // Just jump to runtime to add the two strings. |
9316 __ bind(&string_add_runtime); | 9328 __ bind(&string_add_runtime); |
9317 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | 9329 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
9318 } | 9330 } |
9319 | 9331 |
9320 | 9332 |
9321 #undef __ | 9333 #undef __ |
9322 | 9334 |
9323 } } // namespace v8::internal | 9335 } } // namespace v8::internal |
OLD | NEW |