Chromium Code Reviews| Index: src/interpreter/bytecode-generator.cc |
| diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
| index 052f29367dadd6a4fa1b5fca9948f9ffe4c66a41..6ab002e03e6270ddb26630df446b9855304f32d0 100644 |
| --- a/src/interpreter/bytecode-generator.cc |
| +++ b/src/interpreter/bytecode-generator.cc |
| @@ -635,7 +635,9 @@ BytecodeGenerator::BytecodeGenerator(CompilationInfo* info) |
| execution_result_(nullptr), |
| generator_resume_points_(info->literal()->yield_count(), info->zone()), |
| generator_state_(), |
| - loop_depth_(0) { |
| + loop_depth_(0), |
| + source_url_entry_(0), |
| + has_source_url_entry_(false) { |
| DCHECK_EQ(closure_scope(), closure_scope()->GetClosureScope()); |
| } |
| @@ -696,6 +698,11 @@ void BytecodeGenerator::AllocateDeferredConstants(Isolate* isolate) { |
| array_literal->GetOrBuildConstantElements(isolate); |
| builder()->SetDeferredConstantPoolEntry(literal.second, constant_elements); |
| } |
| + |
| + if (has_source_url_entry()) { |
| + Handle<String> url(String::cast(info()->script()->name())); |
| + builder()->SetDeferredConstantPoolEntry(source_url_entry(), url); |
| + } |
| } |
| void BytecodeGenerator::GenerateBytecode(uintptr_t stack_limit) { |
| @@ -3003,6 +3010,23 @@ void BytecodeGenerator::VisitEmptyParentheses(EmptyParentheses* expr) { |
| UNREACHABLE(); |
| } |
| +void BytecodeGenerator::VisitImportCallExpression(ImportCallExpression* expr) { |
| + size_t entry; |
| + if (has_source_url_entry()) { |
| + entry = source_url_entry(); |
| + } else { |
| + entry = builder()->AllocateDeferredConstantPoolEntry(); |
|
rmcilroy
2017/03/16 09:12:38
Instead of storing this seperately, could you just
gsathya
2017/03/17 00:47:22
Done.
|
| + set_source_url_entry(entry); |
| + } |
| + |
| + RegisterList args = register_allocator()->NewRegisterList(2); |
| + VisitForRegisterValue(expr->argument(), args[1]); |
| + builder() |
| + ->LoadConstantPoolEntry(entry) |
| + .StoreAccumulatorInRegister(args[0]) |
| + .CallRuntime(Runtime::kDynamicImportCall, args); |
| +} |
| + |
| void BytecodeGenerator::VisitGetIterator(GetIterator* expr) { |
| FeedbackSlot load_slot = expr->IteratorPropertyFeedbackSlot(); |
| FeedbackSlot call_slot = expr->IteratorCallFeedbackSlot(); |