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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 .StoreNamedProperty(reg, name, 0, LanguageMode::STRICT) | 92 .StoreNamedProperty(reg, name, 0, LanguageMode::STRICT) |
93 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT); | 93 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT); |
94 | 94 |
95 // Emit load / store lookup slots. | 95 // Emit load / store lookup slots. |
96 builder.LoadLookupSlot(name, TypeofMode::NOT_INSIDE_TYPEOF) | 96 builder.LoadLookupSlot(name, TypeofMode::NOT_INSIDE_TYPEOF) |
97 .LoadLookupSlot(name, TypeofMode::INSIDE_TYPEOF) | 97 .LoadLookupSlot(name, TypeofMode::INSIDE_TYPEOF) |
98 .StoreLookupSlot(name, LanguageMode::SLOPPY) | 98 .StoreLookupSlot(name, LanguageMode::SLOPPY) |
99 .StoreLookupSlot(name, LanguageMode::STRICT); | 99 .StoreLookupSlot(name, LanguageMode::STRICT); |
100 | 100 |
101 // Emit closure operations. | 101 // Emit closure operations. |
102 Handle<SharedFunctionInfo> shared_info = factory->NewSharedFunctionInfo( | 102 builder.CreateClosure(0, NOT_TENURED); |
103 factory->NewStringFromStaticChars("function_a"), MaybeHandle<Code>(), | |
104 false); | |
105 builder.CreateClosure(shared_info, NOT_TENURED); | |
106 | 103 |
107 // Emit literal creation operations. | 104 // Emit literal creation operations. |
108 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) | 105 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) |
109 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) | 106 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) |
110 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0); | 107 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0); |
111 | 108 |
112 // Call operations. | 109 // Call operations. |
113 builder.Call(reg, other, 0, 1) | 110 builder.Call(reg, other, 0, 1) |
114 .Call(reg, wide, 0, 1) | 111 .Call(reg, wide, 0, 1) |
115 .TailCall(reg, other, 0, 1) | 112 .TailCall(reg, other, 0, 1) |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 .LoadKeyedProperty(reg, 0) | 312 .LoadKeyedProperty(reg, 0) |
316 .StoreAccumulatorInRegister(reg) | 313 .StoreAccumulatorInRegister(reg) |
317 .LoadContextSlot(reg, 1) | 314 .LoadContextSlot(reg, 1) |
318 .StoreAccumulatorInRegister(reg) | 315 .StoreAccumulatorInRegister(reg) |
319 .LoadGlobal(0, TypeofMode::NOT_INSIDE_TYPEOF) | 316 .LoadGlobal(0, TypeofMode::NOT_INSIDE_TYPEOF) |
320 .StoreAccumulatorInRegister(reg) | 317 .StoreAccumulatorInRegister(reg) |
321 .LoadUndefined() | 318 .LoadUndefined() |
322 .StoreAccumulatorInRegister(reg); | 319 .StoreAccumulatorInRegister(reg); |
323 | 320 |
324 // CreateClosureWide | 321 // CreateClosureWide |
325 Handle<SharedFunctionInfo> shared_info2 = factory->NewSharedFunctionInfo( | 322 builder.CreateClosure(1000, NOT_TENURED); |
326 factory->NewStringFromStaticChars("function_b"), MaybeHandle<Code>(), | |
327 false); | |
328 builder.CreateClosure(shared_info2, NOT_TENURED); | |
329 | 323 |
330 // Emit wide variant of literal creation operations. | 324 // Emit wide variant of literal creation operations. |
331 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("wide_literal"), | 325 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("wide_literal"), |
332 0, 0) | 326 0, 0) |
333 .CreateArrayLiteral(factory->NewFixedArray(2), 0, 0) | 327 .CreateArrayLiteral(factory->NewFixedArray(2), 0, 0) |
334 .CreateObjectLiteral(factory->NewFixedArray(2), 0, 0); | 328 .CreateObjectLiteral(factory->NewFixedArray(2), 0, 0); |
335 | 329 |
336 // Longer jumps requiring ConstantWide operand | 330 // Longer jumps requiring ConstantWide operand |
337 { | 331 { |
338 BytecodeLabel after_jump; | 332 BytecodeLabel after_jump; |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 iterator.Advance(); | 833 iterator.Advance(); |
840 } | 834 } |
841 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 835 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
842 iterator.Advance(); | 836 iterator.Advance(); |
843 CHECK(iterator.done()); | 837 CHECK(iterator.done()); |
844 } | 838 } |
845 | 839 |
846 } // namespace interpreter | 840 } // namespace interpreter |
847 } // namespace internal | 841 } // namespace internal |
848 } // namespace v8 | 842 } // namespace v8 |
OLD | NEW |