Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 07d6551417b7d5ff6e76a9fc98f0643d919ff94d..6fc529447953b4b3b48149e446c2bc283631167f 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -7,6 +7,7 @@ |
#include "src/compiler.h" |
#include "src/compiler/interpreter-assembler.h" |
#include "src/factory.h" |
+#include "src/interpreter/bytecode-generator.h" |
#include "src/interpreter/bytecodes.h" |
#include "src/zone.h" |
@@ -44,6 +45,22 @@ void Interpreter::Initialize(bool create_heap_objects) { |
} |
+// static |
+bool Interpreter::MakeBytecode(CompilationInfo* info) { |
+ Handle<SharedFunctionInfo> shared_info = |
+ Compiler::GetSharedFunctionInfo(info->function(), info->script(), info); |
+ BytecodeGenerator generator(info->isolate(), info->zone()); |
+ Handle<BytecodeArray> bytecodes = generator.MakeBytecode(info); |
+ bytecodes->Print(); |
rmcilroy
2015/07/30 10:12:25
nit - add a flag for printing the bytecodes (e.g.,
oth
2015/07/30 15:38:43
Done in the bytecode generation CL.
|
+ |
+ CHECK(shared_info->function_data()->IsUndefined()); |
+ shared_info->set_function_data(*bytecodes); |
+ // info->SetCode(info->isolate()->builtins()->InterpreterEntryTrampoline()); |
rmcilroy
2015/07/30 10:12:25
Just do this?
oth
2015/07/30 15:38:43
Other CL.
|
+ info->EnsureFeedbackVector(); |
+ return true; |
+} |
+ |
+ |
// LoadLiteral0 <dst> |
// |
// Load literal '0' into the destination register. |
@@ -58,7 +75,95 @@ void Interpreter::DoLoadLiteral0(compiler::InterpreterAssembler* assembler) { |
// |
// Load an 8-bit integer literal into destination register as a Smi. |
void Interpreter::DoLoadSmi8(compiler::InterpreterAssembler* assembler) { |
- // TODO(rmcilroy) Convert an 8-bit integer to a Smi. |
+ // TODO(rmcilroy) Implement 8-bit integer to SMI promotion. |
+} |
+ |
+ |
+// LdaUndefined |
+// |
+// Load Undefined into the accumulator. |
+void Interpreter::DoLdaUndefined(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement. |
+} |
+ |
+ |
+// LdaNull |
+// |
+// Load Null into the accumulator. |
+void Interpreter::DoLdaNull(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement. |
+} |
+ |
+ |
+// LdaTheHole |
+// |
+// Load TheHole into the accumulator. |
+void Interpreter::DoLdaTheHole(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement. |
+} |
+ |
+ |
+// LdaTrue |
+// |
+// Load True into the accumulator. |
+void Interpreter::DoLdaTrue(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement. |
+} |
+ |
+ |
+// LdaFalse |
+// |
+// Load False into the accumulator. |
+void Interpreter::DoLdaFalse(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement. |
+} |
+ |
+ |
+// Ldar <src> |
+// |
+// Load accumulator with value from register <src>. |
+void Interpreter::DoLdar(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement. |
+} |
+ |
+ |
+// Stra <dst> |
+// |
+// Store accumulator to register <dst>. |
+void Interpreter::DoStra(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement. |
+} |
+ |
+ |
+// Add <src> |
+// |
+// Add register <src> to accumulator. |
+void Interpreter::DoAdd(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement. |
+} |
+ |
+ |
+// Sub <src> |
+// |
+// Subtract register <src> from accumulator. |
+void Interpreter::DoSub(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement. |
+} |
+ |
+ |
+// Mul <src> |
+// |
+// Multiply accumulator by register <src>. |
+void Interpreter::DoMul(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement add register to accumulator. |
+} |
+ |
+ |
+// Div <src> |
+// |
+// Divide register <src> by accumulator. |
+void Interpreter::DoDiv(compiler::InterpreterAssembler* assembler) { |
+ // TODO(rmcilroy) Implement. |
} |