OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/full-codegen/full-codegen.h" | 5 #include "src/full-codegen/full-codegen.h" |
6 | 6 |
7 #include "src/ast/ast-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 void FullCodeGenerator::CallStoreIC(TypeFeedbackId id) { | 238 void FullCodeGenerator::CallStoreIC(TypeFeedbackId id) { |
239 Handle<Code> ic = CodeFactory::StoreIC(isolate(), language_mode()).code(); | 239 Handle<Code> ic = CodeFactory::StoreIC(isolate(), language_mode()).code(); |
240 CallIC(ic, id); | 240 CallIC(ic, id); |
241 } | 241 } |
242 | 242 |
243 void FullCodeGenerator::CallKeyedStoreIC() { | 243 void FullCodeGenerator::CallKeyedStoreIC() { |
244 Handle<Code> ic = | 244 Handle<Code> ic = |
245 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | 245 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
246 CallIC(ic); | 246 CallIC(ic); |
| 247 RestoreContext(); |
247 } | 248 } |
248 | 249 |
249 void FullCodeGenerator::RecordJSReturnSite(Call* call) { | 250 void FullCodeGenerator::RecordJSReturnSite(Call* call) { |
250 // We record the offset of the function return so we can rebuild the frame | 251 // We record the offset of the function return so we can rebuild the frame |
251 // if the function was inlined, i.e., this is the return address in the | 252 // if the function was inlined, i.e., this is the return address in the |
252 // inlined function's frame. | 253 // inlined function's frame. |
253 // | 254 // |
254 // The bailout state is ignored. We defensively set it to TOS_REGISTER, which | 255 // The bailout state is ignored. We defensively set it to TOS_REGISTER, which |
255 // is the real state of the unoptimized code at the return site. | 256 // is the real state of the unoptimized code at the return site. |
256 PrepareForBailoutForId(call->ReturnId(), BailoutState::TOS_REGISTER); | 257 PrepareForBailoutForId(call->ReturnId(), BailoutState::TOS_REGISTER); |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 PushOperand(key->value()); | 1087 PushOperand(key->value()); |
1087 CallRuntimeWithOperands(Runtime::kLoadFromSuper); | 1088 CallRuntimeWithOperands(Runtime::kLoadFromSuper); |
1088 } | 1089 } |
1089 | 1090 |
1090 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 1091 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
1091 SetExpressionPosition(prop); | 1092 SetExpressionPosition(prop); |
1092 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 1093 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
1093 __ Move(LoadDescriptor::SlotRegister(), | 1094 __ Move(LoadDescriptor::SlotRegister(), |
1094 SmiFromSlot(prop->PropertyFeedbackSlot())); | 1095 SmiFromSlot(prop->PropertyFeedbackSlot())); |
1095 CallIC(ic); | 1096 CallIC(ic); |
1096 if (FLAG_tf_load_ic_stub) RestoreContext(); | 1097 RestoreContext(); |
1097 } | 1098 } |
1098 | 1099 |
1099 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 1100 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
1100 // Stack: receiver, home_object, key. | 1101 // Stack: receiver, home_object, key. |
1101 SetExpressionPosition(prop); | 1102 SetExpressionPosition(prop); |
1102 CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper); | 1103 CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper); |
1103 } | 1104 } |
1104 | 1105 |
1105 void FullCodeGenerator::EmitPropertyKey(LiteralProperty* property, | 1106 void FullCodeGenerator::EmitPropertyKey(LiteralProperty* property, |
1106 BailoutId bailout_id) { | 1107 BailoutId bailout_id) { |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2013 return info_->has_simple_parameters(); | 2014 return info_->has_simple_parameters(); |
2014 } | 2015 } |
2015 | 2016 |
2016 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } | 2017 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } |
2017 | 2018 |
2018 #undef __ | 2019 #undef __ |
2019 | 2020 |
2020 | 2021 |
2021 } // namespace internal | 2022 } // namespace internal |
2022 } // namespace v8 | 2023 } // namespace v8 |
OLD | NEW |