Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: src/code-stubs.cc

Issue 1137703002: Add a MathFloor stub generated with TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ARM + co. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 21d11a93d053210cbaea3fe80833f4783b855848..5775e633cac9b028d3f0002cf43840baa90acc3e 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -13,6 +13,7 @@
#include "src/ic/handler-compiler.h"
#include "src/ic/ic.h"
#include "src/macro-assembler.h"
+#include "src/parser.h"
namespace v8 {
namespace internal {
@@ -453,6 +454,35 @@ void CompareNilICStub::UpdateStatus(Handle<Object> object) {
}
+namespace {
+
+Handle<JSFunction> GetFunction(Isolate* isolate, const char* name) {
+ v8::ExtensionConfiguration no_extensions;
+ Handle<Context> ctx = isolate->bootstrapper()->CreateEnvironment(
+ MaybeHandle<JSGlobalProxy>(), v8::Handle<v8::ObjectTemplate>(),
+ &no_extensions);
+ Handle<JSBuiltinsObject> builtins = handle(ctx->builtins());
+ MaybeHandle<Object> fun = Object::GetProperty(isolate, builtins, name);
+ Handle<JSFunction> function = Handle<JSFunction>::cast(fun.ToHandleChecked());
+ DCHECK(!function->IsUndefined() &&
+ "JavaScript implementation of stub not found");
+ // Just to make sure nobody calls this...
+ function->set_code(isolate->builtins()->builtin(Builtins::kIllegal));
+ return function;
+}
+} // namespace
+
+
+Handle<Code> TurboFanCodeStub::GenerateCode() {
+ Zone zone;
+ // Build a "hybrid" CompilationInfo for a JSFunction/CodeStub pair.
+ ParseInfo parse_info(&zone, GetFunction(isolate(), GetFunctionName()));
+ CompilationInfo info(&parse_info);
+ info.SetStub(this);
+ return info.GenerateCodeStub();
+}
+
+
template<class StateType>
void HydrogenCodeStub::TraceTransition(StateType from, StateType to) {
// Note: Although a no-op transition is semantically OK, it is hinting at a
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698