OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/interpreter/bytecode-array-builder.h" | 7 #include "src/interpreter/bytecode-array-builder.h" |
8 #include "src/interpreter/bytecode-array-iterator.h" | 8 #include "src/interpreter/bytecode-array-iterator.h" |
9 #include "src/interpreter/bytecode-label.h" | 9 #include "src/interpreter/bytecode-label.h" |
10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 builder.LoadContextSlot(reg, 1024, 0).StoreContextSlot(reg, 1024, 0); | 303 builder.LoadContextSlot(reg, 1024, 0).StoreContextSlot(reg, 1024, 0); |
304 | 304 |
305 // Emit wide load / store lookup slots. | 305 // Emit wide load / store lookup slots. |
306 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) | 306 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) |
307 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) | 307 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) |
308 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) | 308 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) |
309 .StoreLookupSlot(wide_name, LanguageMode::STRICT); | 309 .StoreLookupSlot(wide_name, LanguageMode::STRICT); |
310 | 310 |
311 // Emit loads which will be transformed to Ldr equivalents by the peephole | 311 // Emit loads which will be transformed to Ldr equivalents by the peephole |
312 // optimizer. | 312 // optimizer. |
313 builder.LoadNamedProperty(reg, name, 0) | 313 builder.LoadContextSlot(reg, 1, 0) |
314 .StoreAccumulatorInRegister(reg) | |
315 .LoadKeyedProperty(reg, 0) | |
316 .StoreAccumulatorInRegister(reg) | |
317 .LoadContextSlot(reg, 1, 0) | |
318 .StoreAccumulatorInRegister(reg) | 314 .StoreAccumulatorInRegister(reg) |
319 .LoadContextSlot(Register::current_context(), 1, 0) | 315 .LoadContextSlot(Register::current_context(), 1, 0) |
320 .StoreAccumulatorInRegister(reg) | 316 .StoreAccumulatorInRegister(reg) |
321 .LoadGlobal(0, TypeofMode::NOT_INSIDE_TYPEOF) | 317 .LoadGlobal(0, TypeofMode::NOT_INSIDE_TYPEOF) |
322 .StoreAccumulatorInRegister(reg) | 318 .StoreAccumulatorInRegister(reg) |
323 .LoadUndefined() | 319 .LoadUndefined() |
324 .StoreAccumulatorInRegister(reg); | 320 .StoreAccumulatorInRegister(reg); |
325 | 321 |
326 // CreateClosureWide | 322 // CreateClosureWide |
327 builder.CreateClosure(1000, NOT_TENURED); | 323 builder.CreateClosure(1000, NOT_TENURED); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 } | 385 } |
390 | 386 |
391 // Insert entry for illegal bytecode as this is never willingly emitted. | 387 // Insert entry for illegal bytecode as this is never willingly emitted. |
392 scorecard[Bytecodes::ToByte(Bytecode::kIllegal)] = 1; | 388 scorecard[Bytecodes::ToByte(Bytecode::kIllegal)] = 1; |
393 | 389 |
394 // Insert entry for nop bytecode as this often gets optimized out. | 390 // Insert entry for nop bytecode as this often gets optimized out. |
395 scorecard[Bytecodes::ToByte(Bytecode::kNop)] = 1; | 391 scorecard[Bytecodes::ToByte(Bytecode::kNop)] = 1; |
396 | 392 |
397 if (!FLAG_ignition_peephole) { | 393 if (!FLAG_ignition_peephole) { |
398 // Insert entries for bytecodes only emitted by peephole optimizer. | 394 // Insert entries for bytecodes only emitted by peephole optimizer. |
399 scorecard[Bytecodes::ToByte(Bytecode::kLdrNamedProperty)] = 1; | |
400 scorecard[Bytecodes::ToByte(Bytecode::kLdrKeyedProperty)] = 1; | |
401 scorecard[Bytecodes::ToByte(Bytecode::kLdrGlobal)] = 1; | 395 scorecard[Bytecodes::ToByte(Bytecode::kLdrGlobal)] = 1; |
402 scorecard[Bytecodes::ToByte(Bytecode::kLdrContextSlot)] = 1; | 396 scorecard[Bytecodes::ToByte(Bytecode::kLdrContextSlot)] = 1; |
403 scorecard[Bytecodes::ToByte(Bytecode::kLdrCurrentContextSlot)] = 1; | 397 scorecard[Bytecodes::ToByte(Bytecode::kLdrCurrentContextSlot)] = 1; |
404 scorecard[Bytecodes::ToByte(Bytecode::kLdrUndefined)] = 1; | 398 scorecard[Bytecodes::ToByte(Bytecode::kLdrUndefined)] = 1; |
405 scorecard[Bytecodes::ToByte(Bytecode::kLogicalNot)] = 1; | 399 scorecard[Bytecodes::ToByte(Bytecode::kLogicalNot)] = 1; |
406 scorecard[Bytecodes::ToByte(Bytecode::kJump)] = 1; | 400 scorecard[Bytecodes::ToByte(Bytecode::kJump)] = 1; |
407 scorecard[Bytecodes::ToByte(Bytecode::kJumpIfTrue)] = 1; | 401 scorecard[Bytecodes::ToByte(Bytecode::kJumpIfTrue)] = 1; |
408 scorecard[Bytecodes::ToByte(Bytecode::kJumpIfFalse)] = 1; | 402 scorecard[Bytecodes::ToByte(Bytecode::kJumpIfFalse)] = 1; |
409 scorecard[Bytecodes::ToByte(Bytecode::kJumpIfTrueConstant)] = 1; | 403 scorecard[Bytecodes::ToByte(Bytecode::kJumpIfTrueConstant)] = 1; |
410 scorecard[Bytecodes::ToByte(Bytecode::kJumpIfFalseConstant)] = 1; | 404 scorecard[Bytecodes::ToByte(Bytecode::kJumpIfFalseConstant)] = 1; |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 iterator.Advance(); | 740 iterator.Advance(); |
747 } | 741 } |
748 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 742 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
749 iterator.Advance(); | 743 iterator.Advance(); |
750 CHECK(iterator.done()); | 744 CHECK(iterator.done()); |
751 } | 745 } |
752 | 746 |
753 } // namespace interpreter | 747 } // namespace interpreter |
754 } // namespace internal | 748 } // namespace internal |
755 } // namespace v8 | 749 } // namespace v8 |
OLD | NEW |